summaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2014-11-06 14:28:48 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2014-11-06 14:28:48 +0000
commit9e718c1edad1d11d195c363385d5e91c27c7199c (patch)
treeec05e5569bcd8c0cabeb83349b497c41008fedcc /sys/net
parentc1b86de53cd1091d9e9e6f489f01d9c1d0eef190 (diff)
fix mac address selection with unnumbered carpdevs
IP-traffic over a carp interface with the underlaying carpdev being unnumbered (in the numbered case usually the ifp is the carpdev to begin with) went out with the carpdev's mac address istead of the carp interface's one due to a carp hack in ether_output exchanging the carp ifp for its carpdev ones one. move the source mac selection to before that. fixes unnumbered carp use in environments with strict mac address regimes like some exchange points. issue found by your's truly the hard way. ok mpi dlg
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/if_ethersubr.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c
index c596ee8f053..e2ccedd606c 100644
--- a/sys/net/if_ethersubr.c
+++ b/sys/net/if_ethersubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ethersubr.c,v 1.176 2014/11/01 21:40:38 mpi Exp $ */
+/* $OpenBSD: if_ethersubr.c,v 1.177 2014/11/06 14:28:47 henning Exp $ */
/* $NetBSD: if_ethersubr.c,v 1.19 1996/05/07 02:40:30 thorpej Exp $ */
/*
@@ -270,6 +270,8 @@ ether_output(struct ifnet *ifp0, struct mbuf *m0, struct sockaddr *dst,
senderr(EBUSY);
#endif
+ esrc = ac->ac_enaddr;
+
#if NCARP > 0
if (ifp->if_type == IFT_CARP) {
ifp = ifp->if_carpdev;
@@ -310,7 +312,6 @@ ether_output(struct ifnet *ifp0, struct mbuf *m0, struct sockaddr *dst,
time_second < rt->rt_rmx.rmx_expire)
senderr(rt == rt0 ? EHOSTDOWN : EHOSTUNREACH);
}
- esrc = ac->ac_enaddr;
switch (dst->sa_family) {
#ifdef INET