mirror of
https://github.com/berlin-open-wireless-lab/DAWN.git
synced 2025-03-09 15:40:12 +00:00
Merge pull request #12 from berlin-open-wireless-lab/hotfix/fix_multicast
Hotfix/fix multicast
This commit is contained in:
commit
b39d310c00
4 changed files with 13 additions and 3 deletions
|
@ -1,6 +1,7 @@
|
|||
config settings network
|
||||
option broadcast_ip '10.0.0.255'
|
||||
option broadcast_ip '226.94.1.1'
|
||||
option broadcast_port '1025'
|
||||
option multicast '1'
|
||||
option shared_key 'Niiiiiiiiiiiiiik'
|
||||
option iv 'Niiiiiiiiiiiiiik'
|
||||
|
||||
|
|
|
@ -28,6 +28,8 @@ start_service()
|
|||
config_get sort_order ordering sort_order
|
||||
config_get hostapd_dir hostapd hostapd_dir
|
||||
|
||||
config_get multicast network multicast
|
||||
|
||||
procd_open_instance
|
||||
echo "$PROG -p $broadcast_port -i $broadcast_ip -o $sort_order"
|
||||
procd_set_param command "$PROG"
|
||||
|
@ -38,6 +40,10 @@ start_service()
|
|||
procd_append_param command -k "${shared_key}"
|
||||
procd_append_param command -v "${iv}"
|
||||
|
||||
if [ "${multicast}" -gt 0 ]; then
|
||||
procd_append_param command -m
|
||||
fi
|
||||
|
||||
procd_set_param stdout 1
|
||||
procd_set_param stderr 1
|
||||
|
||||
|
|
|
@ -59,6 +59,7 @@ int main(int argc, char **argv) {
|
|||
|
||||
char shared_key[BUFSIZE_DIR];
|
||||
char iv[BUFSIZE_DIR];
|
||||
int multicast = 0;
|
||||
|
||||
while ((ch = getopt(argc, argv, "cs:p:i:b:o:h:i:k:v:")) != -1) {
|
||||
switch (ch) {
|
||||
|
@ -90,6 +91,8 @@ int main(int argc, char **argv) {
|
|||
snprintf(iv, BUFSIZE_DIR, "%s", optarg);
|
||||
printf("IV: %s\n", iv);
|
||||
break;
|
||||
case 'm':
|
||||
multicast = 1;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -135,7 +138,7 @@ int main(int argc, char **argv) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
init_socket_runopts(opt_broadcast_ip, opt_broadcast_port, 1);
|
||||
init_socket_runopts(opt_broadcast_ip, opt_broadcast_port, multicast);
|
||||
|
||||
dawn_init_ubus(ubus_socket, opt_hostapd_dir);
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ int setup_multicast_socket(const char *_multicast_ip, unsigned short _multicast_
|
|||
|
||||
memset(addr, 0, sizeof(*addr));
|
||||
addr->sin_family = AF_INET;
|
||||
addr->sin_addr.s_addr = htonl (INADDR_ANY);
|
||||
addr->sin_addr.s_addr = inet_addr(_multicast_ip);
|
||||
addr->sin_port = htons (_multicast_port);
|
||||
|
||||
if ((sock = socket(PF_INET, SOCK_DGRAM, 0)) == -1) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue