Handle situations where we've already got a P2P interface address

of a/x -> b and then negotiate a/x -> c by simply expecting SIOCAIFADDR
to do the change.

This was broken by the last commit that optimised out the deletion and
re-addition of the same a/x -> b combination, and forgot to compare
the old/new destination addresses.

Conveniently enough, this problem didn't effect setups where the
default route goes via the ppp link, and most other setups don't
care what the the destination address is actually set to.  It broke
test environments where ppp connects to the local machine rather
badly though....
This commit is contained in:
Brian Somers
2001-05-02 16:35:24 +00:00
parent 26e3096360
commit 0272404f73
+6 -1
View File
@@ -303,7 +303,12 @@ iface_inAdd(struct iface *iface, struct in_addr ifa, struct in_addr mask,
* the IP number as a destination.
*/
if (chg == slot && iface->in_addr[chg].mask.s_addr == mask.s_addr) {
nochange = 1;
if (brd.s_addr == iface->in_addr[slot].brd.s_addr)
nochange = 1;
/*
* If only the destination address has changed, the SIOCAIFADDR
* we do after the current loop will change it.
*/
continue;
}
if (s == -1 && (s = ID0socket(AF_INET, SOCK_DGRAM, 0)) == -1) {