From c54c76cc2f34d6ef65c86cb810b95213613b3655 Mon Sep 17 00:00:00 2001 From: Oleg Bulyzhin Date: Thu, 22 Dec 2005 12:16:20 +0000 Subject: [PATCH] 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 --- sys/net/if_ethersubr.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index 2d89cee7772d..d96b48bfa431 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) {