MFC 1.211:
1) remove useless check of loop_copy 2) convert loop_copy to "non-negative" flag
This commit is contained in:
parent
06cfdf6652
commit
a8c9b6ffde
@ -152,7 +152,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
|
||||
@ -182,7 +182,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:
|
||||
@ -263,7 +263,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;
|
||||
@ -309,7 +309,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;
|
||||
|
||||
@ -318,7 +318,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) {
|
||||
|
Loading…
Reference in New Issue
Block a user