summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authormpi <mpi@openbsd.org>2015-07-17 18:35:25 +0000
committermpi <mpi@openbsd.org>2015-07-17 18:35:25 +0000
commitb386d12a695f46fc1ba65e556c6087e819797304 (patch)
treea1b0ceaf267ac3794d907e240b027bc34ff7e254 /sys
parentmanage spd entries by using the radix api directly instead of (diff)
downloadwireguard-openbsd-b386d12a695f46fc1ba65e556c6087e819797304.tar.xz
wireguard-openbsd-b386d12a695f46fc1ba65e556c6087e819797304.zip
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@
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet/if_ether.c15
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;
}