Fix ``set ifaddr''. The code was actually using an uninitialised variable,

but conveniently, because ncpaddr.ncpaddr_family != AF_INET, the call to
ncpaddr_getip4addr() became a no-op leaving the local address as it was
(defaulting to whatever my hostname resolves to).

PR:		62050
Submitted by:	Peter Jeremy <peter.jeremy@alcatel.com.au>
MFC after:	3 days
This commit is contained in:
Brian Somers 2004-07-15 09:42:16 +00:00
parent f009648120
commit 6489fd2148

View File

@ -1578,8 +1578,8 @@ SetInterfaceAddr(struct cmdargs const *arg)
}
/* 0.0.0.0 means any address (0 bits) */
ncpaddr_getip4(&ncpaddr, &ncp->ipcp.my_ip);
ncprange_getaddr(&ncp->ipcp.cfg.my_range, &ncpaddr);
ncpaddr_getip4(&ncpaddr, &ncp->ipcp.my_ip);
if (ncp->ipcp.my_ip.s_addr == INADDR_ANY)
ncprange_setwidth(&ncp->ipcp.cfg.my_range, 0);
bundle_AdjustFilters(arg->bundle, &ncpaddr, NULL);