diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2015-07-17 18:35:26 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2015-07-17 18:35:26 +0000 |
commit | a4c68ed85a3809fd5fe36af954702bf1a5d4a273 (patch) | |
tree | 873be25f6da4f17e5b2f0a0db04ee35e447ed82c | |
parent | 534b943081957c2ee1e52295eb7e53d493df375d (diff) |
Announce an IP address after inserting its corresponding RTF_LOCAL
route and not during the SIOCSIFADDR ioctl. This way addresses are
not announced when an error occurs.
ok chris@, claudio@
-rw-r--r-- | sys/netinet/if_ether.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index 76884bb8f14..8fbf0bdc77a 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ether.c,v 1.157 2015/07/07 14:22:25 mpi Exp $ */ +/* $OpenBSD: if_ether.c,v 1.158 2015/07/17 18:35:25 mpi Exp $ */ /* $NetBSD: if_ether.c,v 1.31 1996/05/11 12:59:58 mycroft Exp $ */ /* @@ -196,8 +196,11 @@ arp_rtrequest(int req, struct rtentry *rt) if ((rt->rt_flags & RTF_CLONING) != 0) break; } - /* Announce a new entry if requested. */ - if (rt->rt_flags & RTF_ANNOUNCE) + /* + * Announce a new entry if requested or warn the user + * if another station has this IP address. + */ + if (rt->rt_flags & (RTF_ANNOUNCE|RTF_LOCAL)) arprequest(ifp, &satosin(rt_key(rt))->sin_addr.s_addr, &satosin(rt_key(rt))->sin_addr.s_addr, @@ -850,12 +853,6 @@ arpproxy(struct in_addr in, u_int rdomain) void arp_ifinit(struct arpcom *ac, struct ifaddr *ifa) { - - /* Warn the user if another station has this IP address. */ - arprequest(&ac->ac_if, - &satosin(ifa->ifa_addr)->sin_addr.s_addr, - &satosin(ifa->ifa_addr)->sin_addr.s_addr, - ac->ac_enaddr); ifa->ifa_rtrequest = arp_rtrequest; } |