From 0272404f7345c579c99a98840de05cbbb439d2ab Mon Sep 17 00:00:00 2001 From: Brian Somers Date: Wed, 2 May 2001 16:35:24 +0000 Subject: [PATCH] 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.... --- usr.sbin/ppp/iface.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/usr.sbin/ppp/iface.c b/usr.sbin/ppp/iface.c index a58fdac064b..5384340e812 100644 --- a/usr.sbin/ppp/iface.c +++ b/usr.sbin/ppp/iface.c @@ -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) {