1
0
mirror of https://github.com/solemnwarning/ipxwrapper synced 2024-12-30 16:45:37 +01:00

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.
This commit is contained in:
Daniel Collins 2012-12-01 14:44:18 +00:00
parent fab32bf974
commit 3c42e513ed

View File

@ -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);