PERFORCE change 145386 for review
Gleb Kurtsou
gk at FreeBSD.org
Thu Jul 17 19:54:17 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=145386
Change 145386 by gk at gk_h1 on 2008/07/17 19:53:19
Use mtag_ether_header in pf. support inet4 only for now
Affected files ...
.. //depot/projects/soc2008/gk_l2filter/sys-pf/net/pf_ioctl.c#2 edit
Differences ...
==== //depot/projects/soc2008/gk_l2filter/sys-pf/net/pf_ioctl.c#2 (text+ko) ====
@@ -111,6 +111,7 @@
#ifdef __FreeBSD__
#include <sys/md5.h>
+#include <net/ethernet.h>
#else
#include <dev/rndvar.h>
#include <crypto/md5.h>
@@ -3636,6 +3637,7 @@
* byte order.
*/
struct ip *h = NULL;
+ struct m_tag *tag_ether_hdr;
int chk;
if ((*m)->m_pkthdr.len >= (int)sizeof(struct ip)) {
@@ -3644,7 +3646,10 @@
HTONS(h->ip_len);
HTONS(h->ip_off);
}
- chk = pf_test(PF_IN, ifp, m, NULL, inp);
+ tag_ether_hdr = m_tag_locate(*m, MTAG_ETHER, MTAG_ETHER_HEADER, NULL);
+ chk = pf_test(PF_IN, ifp, m,
+ tag_ether_hdr ? (struct ether_header *)(tag_ether_hdr + 1) : NULL,
+ inp);
if (chk && *m) {
m_freem(*m);
*m = NULL;
@@ -3671,6 +3676,7 @@
* byte order.
*/
struct ip *h = NULL;
+ struct m_tag *tag_ether_hdr;
int chk;
/* We need a proper CSUM befor we start (s. OpenBSD ip_output) */
@@ -3684,7 +3690,10 @@
HTONS(h->ip_len);
HTONS(h->ip_off);
}
- chk = pf_test(PF_OUT, ifp, m, NULL, inp);
+ tag_ether_hdr = m_tag_locate(*m, MTAG_ETHER, MTAG_ETHER_HEADER, NULL);
+ chk = pf_test(PF_OUT, ifp, m,
+ tag_ether_hdr ? (struct ether_header *)(tag_ether_hdr + 1) : NULL,
+ inp);
if (chk && *m) {
m_freem(*m);
*m = NULL;
More information about the p4-projects
mailing list