diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2015-06-08 13:40:49 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2015-06-08 13:40:49 +0000 |
commit | 1312915bfb7e97794655d1302d1dba05889baec2 (patch) | |
tree | ff1f8d3a7923b1f3fdbc75e477726955e0ac3b41 /sys/net/if_ethersubr.c | |
parent | 6626a0b150b52b43b53843dade2d3c814990fab1 (diff) |
Move carp-related logic from ether_output() into carp_start().
ok sthen@, phessler@
Diffstat (limited to 'sys/net/if_ethersubr.c')
-rw-r--r-- | sys/net/if_ethersubr.c | 37 |
1 files changed, 5 insertions, 32 deletions
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index 468a287cff6..842dbe0c882 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ethersubr.c,v 1.202 2015/06/02 09:38:24 mpi Exp $ */ +/* $OpenBSD: if_ethersubr.c,v 1.203 2015/06/08 13:40:48 mpi Exp $ */ /* $NetBSD: if_ethersubr.c,v 1.19 1996/05/07 02:40:30 thorpej Exp $ */ /* @@ -113,11 +113,6 @@ didn't get a copy, you may request one from <license@ipv6.nrl.navy.mil>. #include <net/if_vlan_var.h> #endif /* NVLAN > 0 */ -#include "carp.h" -#if NCARP > 0 -#include <netinet/ip_carp.h> -#endif - #include "pppoe.h" #if NPPPOE > 0 #include <net/if_pppoe.h> @@ -243,18 +238,17 @@ ether_addheader(struct mbuf **m, struct ifnet *ifp, u_int16_t etype, * Assumes that ifp is actually pointer to arpcom structure. */ int -ether_output(struct ifnet *ifp0, struct mbuf *m0, struct sockaddr *dst, +ether_output(struct ifnet *ifp, struct mbuf *m0, struct sockaddr *dst, struct rtentry *rt) { u_int16_t etype; - int len, error = 0; u_char edst[ETHER_ADDR_LEN]; u_char *esrc; struct mbuf *m = m0; struct mbuf *mcopy = NULL; struct ether_header *eh; - struct arpcom *ac = (struct arpcom *)ifp0; - struct ifnet *ifp = ifp0; + struct arpcom *ac = (struct arpcom *)ifp; + int error = 0; #ifdef DIAGNOSTIC if (ifp->if_rdomain != rtable_l2(m->m_pkthdr.ph_rtableid)) { @@ -267,20 +261,6 @@ ether_output(struct ifnet *ifp0, struct mbuf *m0, struct sockaddr *dst, esrc = ac->ac_enaddr; -#if NCARP > 0 - if (ifp->if_type == IFT_CARP) { - ifp = ifp->if_carpdev; - ac = (struct arpcom *)ifp; - - if ((ifp0->if_flags & (IFF_UP|IFF_RUNNING)) != - (IFF_UP|IFF_RUNNING)) - senderr(ENETDOWN); - } - - if (ifp0 != ifp && ifp0->if_type == IFT_CARP) - esrc = carp_get_srclladdr(ifp0, esrc); -#endif /* NCARP > 0 */ - if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING)) senderr(ENETDOWN); @@ -402,14 +382,7 @@ ether_output(struct ifnet *ifp0, struct mbuf *m0, struct sockaddr *dst, } #endif - len = m->m_pkthdr.len; - - error = if_output(ifp, m); -#if NCARP > 0 - if (!error && ifp != ifp0) - ifp0->if_obytes += len; -#endif /* NCARP > 0 */ - return (error); + return (if_output(ifp, m)); bad: if (m) m_freem(m); |