diff options
author | oleg <oleg@FreeBSD.org> | 2005-12-22 12:16:20 +0000 |
---|---|---|
committer | oleg <oleg@FreeBSD.org> | 2005-12-22 12:16:20 +0000 |
commit | 83213cd3112dc72d29aa896cdf8c76f682de29ac (patch) | |
tree | 19493f0215198916d1cafa28a4ea4cdaacf37148 /sys/net/if_ethersubr.c | |
parent | dc32464eaf2fce04577dc66236b9fc741db085a2 (diff) | |
download | FreeBSD-src-83213cd3112dc72d29aa896cdf8c76f682de29ac.zip FreeBSD-src-83213cd3112dc72d29aa896cdf8c76f682de29ac.tar.gz |
1) remove useless check of loop_copy - corresponding code was removed in
rev. 1.70 five years ago.
2) convert loop_copy to "non-negative" flag
Approved by: glebius (mentor)
MFC after: 2 weeks
Diffstat (limited to 'sys/net/if_ethersubr.c')
-rw-r--r-- | sys/net/if_ethersubr.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index 2d89cee..d96b48bf 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -144,7 +144,7 @@ ether_output(struct ifnet *ifp, struct mbuf *m, int error, hdrcmplt = 0; u_char esrc[ETHER_ADDR_LEN], edst[ETHER_ADDR_LEN]; struct ether_header *eh; - int loop_copy = 0; + int loop_copy = 1; int hlen; /* link layer header length */ #ifdef MAC @@ -174,7 +174,7 @@ ether_output(struct ifnet *ifp, struct mbuf *m, ah = mtod(m, struct arphdr *); ah->ar_hrd = htons(ARPHRD_ETHER); - loop_copy = -1; /* if this is for us, don't do it */ + loop_copy = 0; /* if this is for us, don't do it */ switch(ntohs(ah->ar_op)) { case ARPOP_REVREQUEST: @@ -255,7 +255,7 @@ ether_output(struct ifnet *ifp, struct mbuf *m, /* FALLTHROUGH */ case AF_UNSPEC: - loop_copy = -1; /* if this is for us, don't do it */ + loop_copy = 0; /* if this is for us, don't do it */ eh = (struct ether_header *)dst->sa_data; (void)memcpy(edst, eh->ether_dhost, sizeof (edst)); type = eh->ether_type; @@ -301,7 +301,7 @@ ether_output(struct ifnet *ifp, struct mbuf *m, * on the wire). However, we don't do that here for security * reasons and compatibility with the original behavior. */ - if ((ifp->if_flags & IFF_SIMPLEX) && (loop_copy != -1) && + if ((ifp->if_flags & IFF_SIMPLEX) && loop_copy && m_tag_find(m, PACKET_TAG_PF_ROUTED, NULL) == NULL) { int csum_flags = 0; @@ -310,7 +310,7 @@ ether_output(struct ifnet *ifp, struct mbuf *m, if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA) csum_flags |= (CSUM_DATA_VALID|CSUM_PSEUDO_HDR); - if ((m->m_flags & M_BCAST) || (loop_copy > 0)) { + if (m->m_flags & M_BCAST) { struct mbuf *n; if ((n = m_copy(m, 0, (int)M_COPYALL)) != NULL) { |