summaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2014-04-21 18:52:26 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2014-04-21 18:52:26 +0000
commit08d03a7c72c532bcd4f51e5694073244c263b4f6 (patch)
treec372cbc09850812987d2bd780b5c837dcf3c11c0 /sys/net
parent00b098b6718f55a653c2423efe22c8cf5ee74350 (diff)
g/c hdrcmplt var, we can just set the esrc ptr earlier and re-set it in
the pseudo_AF_HDRCMPLT case, ok claudio reyk
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/if_ethersubr.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c
index 54214460890..09fb772a4fa 100644
--- a/sys/net/if_ethersubr.c
+++ b/sys/net/if_ethersubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ethersubr.c,v 1.169 2014/04/21 18:38:36 henning Exp $ */
+/* $OpenBSD: if_ethersubr.c,v 1.170 2014/04/21 18:52:25 henning Exp $ */
/* $NetBSD: if_ethersubr.c,v 1.19 1996/05/07 02:40:30 thorpej Exp $ */
/*
@@ -217,7 +217,7 @@ ether_output(struct ifnet *ifp0, struct mbuf *m0, struct sockaddr *dst,
struct rtentry *rt0)
{
u_int16_t etype;
- int s, len, error = 0, hdrcmplt = 0;
+ int s, len, error = 0;
u_char edst[ETHER_ADDR_LEN];
u_char *esrc;
struct mbuf *m = m0;
@@ -284,6 +284,7 @@ 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
@@ -337,7 +338,6 @@ ether_output(struct ifnet *ifp0, struct mbuf *m0, struct sockaddr *dst,
break;
#endif /* MPLS */
case pseudo_AF_HDRCMPLT:
- hdrcmplt = 1;
eh = (struct ether_header *)dst->sa_data;
esrc = eh->ether_shost;
/* FALLTHROUGH */
@@ -359,8 +359,6 @@ ether_output(struct ifnet *ifp0, struct mbuf *m0, struct sockaddr *dst,
if (mcopy)
(void) looutput(ifp, mcopy, dst, rt);
- if (!hdrcmplt)
- esrc = ac->ac_enaddr;
#if NCARP > 0
if (ifp0 != ifp && ifp0->if_type == IFT_CARP)
esrc = carp_get_srclladdr(ifp0, esrc);