summaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2014-04-20 14:54:40 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2014-04-20 14:54:40 +0000
commitbde886799ac760913314c3eb32114d9d348ca77d (patch)
tree008fdc093401301db32039b15da57928040db9cf /sys/net
parentddf69dcda2eb3f36bc7b83ebfa121c426d3e1f6b (diff)
ether_output: instead of assembling the ethernet header and then calling
carp_rewrite_lladdr to overwrite the src lladdr, get the intended src lladdr before assembling the ethernet header. carp_rewrite_lladdr -> carp_get_srclladdr ok reyk claudio
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/if_ethersubr.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c
index 0ccb5c5cd2f..cf0de756f43 100644
--- a/sys/net/if_ethersubr.c
+++ b/sys/net/if_ethersubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ethersubr.c,v 1.166 2014/04/20 14:51:50 henning Exp $ */
+/* $OpenBSD: if_ethersubr.c,v 1.167 2014/04/20 14:54:39 henning Exp $ */
/* $NetBSD: if_ethersubr.c,v 1.19 1996/05/07 02:40:30 thorpej Exp $ */
/*
@@ -343,6 +343,10 @@ ether_output(struct ifnet *ifp0, struct mbuf *m0, struct sockaddr *dst,
if (!hdrcmplt)
esrc = ac->ac_enaddr;
+#if NCARP > 0
+ if (ifp0 != ifp && ifp0->if_type == IFT_CARP)
+ esrc = carp_get_srclladdr(ifp0, esrc);
+#endif
/*
* Add local net header. If no space in first mbuf,
@@ -356,11 +360,6 @@ ether_output(struct ifnet *ifp0, struct mbuf *m0, struct sockaddr *dst,
memcpy(eh->ether_dhost, edst, sizeof(eh->ether_dhost));
memcpy(eh->ether_shost, esrc, sizeof(eh->ether_shost));
-#if NCARP > 0
- if (ifp0 != ifp && ifp0->if_type == IFT_CARP)
- carp_rewrite_lladdr(ifp0, eh->ether_shost);
-#endif
-
#if NBRIDGE > 0
/*
* Interfaces that are bridgeports need special handling for output.