mark arp broadcasts in the mbuf

2011-06-26 Thread Camiel Dobbelaar
Mark ARP request broadcasts as such in the mbuf flags.  FreeBSD and NetBSD 
both have this.

Without this, bridge_output() drops ARP request broadcasts on interfaces 
without the discover flag:

if ((p-bif_flags  IFBIF_DISCOVER) == 0 
(m-m_flags  (M_BCAST | M_MCAST)) == 0)
continue;


Index: if_ether.c
===
RCS file: /cvs/src/sys/netinet/if_ether.c,v
retrieving revision 1.88
diff -u -r1.88 if_ether.c
--- if_ether.c  22 Jul 2010 00:41:55 -  1.88
+++ if_ether.c  26 Jun 2011 17:30:29 -
@@ -359,6 +359,7 @@
bcopy((caddr_t)tip, (caddr_t)ea-arp_tpa, sizeof(ea-arp_tpa));
sa.sa_family = pseudo_AF_HDRCMPLT;
sa.sa_len = sizeof(sa);
+   m-m_flags |= M_BCAST;
(*ifp-if_output)(ifp, m, sa, (struct rtentry *)0);
 }
 
@@ -994,6 +995,7 @@
   sizeof(ea-arp_tha));
sa.sa_family = pseudo_AF_HDRCMPLT;
sa.sa_len = sizeof(sa);
+   m-m_flags |= M_BCAST;
ifp-if_output(ifp, m, sa, (struct rtentry *)0);
 }



Re: mark arp broadcasts in the mbuf

2011-06-26 Thread Claudio Jeker
On Sun, Jun 26, 2011 at 07:52:18PM +0200, Camiel Dobbelaar wrote:
 Mark ARP request broadcasts as such in the mbuf flags.  FreeBSD and NetBSD 
 both have this.
 
 Without this, bridge_output() drops ARP request broadcasts on interfaces 
 without the discover flag:
 
 if ((p-bif_flags  IFBIF_DISCOVER) == 0 
 (m-m_flags  (M_BCAST | M_MCAST)) == 0)
 continue;

OK claudio@
 
 
 Index: if_ether.c
 ===
 RCS file: /cvs/src/sys/netinet/if_ether.c,v
 retrieving revision 1.88
 diff -u -r1.88 if_ether.c
 --- if_ether.c22 Jul 2010 00:41:55 -  1.88
 +++ if_ether.c26 Jun 2011 17:30:29 -
 @@ -359,6 +359,7 @@
   bcopy((caddr_t)tip, (caddr_t)ea-arp_tpa, sizeof(ea-arp_tpa));
   sa.sa_family = pseudo_AF_HDRCMPLT;
   sa.sa_len = sizeof(sa);
 + m-m_flags |= M_BCAST;
   (*ifp-if_output)(ifp, m, sa, (struct rtentry *)0);
  }
  
 @@ -994,6 +995,7 @@
  sizeof(ea-arp_tha));
   sa.sa_family = pseudo_AF_HDRCMPLT;
   sa.sa_len = sizeof(sa);
 + m-m_flags |= M_BCAST;
   ifp-if_output(ifp, m, sa, (struct rtentry *)0);
  }
 

-- 
:wq Claudio