From 3c42e513ed70ac7507df7ff796e8f0d19a0d2c7e Mon Sep 17 00:00:00 2001 From: Daniel Collins Date: Sat, 1 Dec 2012 14:44:18 +0000 Subject: [PATCH] Populate the wildcard interface IP list with the IPs of each enabled interface rather than 0.0.0.0/0.0.0.0 as the behaviour of broadcasting to 255.255.255.255 is unreliable. --- src/interface.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/src/interface.c b/src/interface.c index c3e99b1..1079567 100644 --- a/src/interface.c +++ b/src/interface.c @@ -125,29 +125,18 @@ ipx_interface_t *load_ipx_interfaces(void) ipx_interface_t *nics = NULL; - iface_config_t wc_config = get_iface_config(WILDCARD_IFACE_HWADDR); + iface_config_t wc_config = get_iface_config(WILDCARD_IFACE_HWADDR); + ipx_interface_t *wc_iface = NULL; if(wc_config.enabled) { /* Initialise wildcard interface. */ - ipx_interface_t *wc_iface = _new_iface(wc_config.netnum, wc_config.nodenum); - if(!wc_iface) + if(!(wc_iface = _new_iface(wc_config.netnum, wc_config.nodenum))) { return NULL; } - /* Use 0.0.0.0/0 as the IP/network of the wildcard interface - * to broadcast to 255.255.255.255 and match packets from any - * address. - */ - - if(!_push_addr(wc_iface, 0, 0)) - { - free_ipx_interface(wc_iface); - return NULL; - } - DL_APPEND(nics, wc_iface); } @@ -190,7 +179,7 @@ ipx_interface_t *load_ipx_interfaces(void) continue; } - if(!_push_addr(iface, ipaddr, netmask)) + if(!_push_addr(iface, ipaddr, netmask) || (wc_iface && !_push_addr(wc_iface, ipaddr, netmask))) { free_ipx_interface(iface); free_ipx_interface_list(&nics);