Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F109288961
D43617.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D43617.diff
View Options
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c
--- a/sys/net/if_ethersubr.c
+++ b/sys/net/if_ethersubr.c
@@ -878,7 +878,7 @@
/* Do not grab PROMISC frames in case we are re-entered. */
if (PFIL_HOOKED_IN(V_link_pfil_head) && !(m->m_flags & M_PROMISC)) {
i = pfil_mbuf_in(V_link_pfil_head, &m, ifp, NULL);
- if (i != 0 || m == NULL)
+ if (i != PFIL_PASS)
return;
}
diff --git a/sys/net/pfil.c b/sys/net/pfil.c
--- a/sys/net/pfil.c
+++ b/sys/net/pfil.c
@@ -211,9 +211,14 @@
CK_STAILQ_FOREACH(link, pch, link_chain) {
rv = link->link_mbuf_chk(m, ifp, flags, link->link_ruleset,
inp);
- if (rv == PFIL_DROPPED || rv == PFIL_CONSUMED)
+ if (rv == PFIL_DROPPED || rv == PFIL_CONSUMED) {
+ MPASS(*m == NULL);
break;
+ } else {
+ MPASS(*m != NULL);
+ }
}
+
return (rv);
}
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c
--- a/sys/netinet/ip_input.c
+++ b/sys/netinet/ip_input.c
@@ -621,8 +621,6 @@
if (pfil_mbuf_in(V_inet_pfil_head, &m, ifp, NULL) !=
PFIL_PASS)
return;
- if (m == NULL) /* consumed by filter */
- return;
ip = mtod(m, struct ip *);
dchg = (odst.s_addr != ip->ip_dst.s_addr);
@@ -827,8 +825,6 @@
if (pfil_mbuf_out(V_inet_local_pfil_head, &m, V_loif, NULL) !=
PFIL_PASS)
return;
- if (m == NULL) /* consumed by filter */
- return;
ip = mtod(m, struct ip *);
}
diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c
--- a/sys/netinet6/ip6_input.c
+++ b/sys/netinet6/ip6_input.c
@@ -894,8 +894,6 @@
if (pfil_mbuf_out(V_inet6_local_pfil_head, &m, V_loif, NULL) !=
PFIL_PASS)
return;
- if (m == NULL) /* consumed by filter */
- return;
ip6 = mtod(m, struct ip6_hdr *);
}
diff --git a/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c b/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c
--- a/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c
+++ b/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c
@@ -133,6 +133,8 @@
rv = ipf_check(&V_ipfmain, ip, ip->ip_hl << 2, ifp,
!!(flags & PFIL_OUT), mp);
CURVNET_RESTORE();
+ if (rv == 0 && *mp == NULL)
+ return (PFIL_CONSUMED);
return (rv == 0 ? PFIL_PASS : PFIL_DROPPED);
}
@@ -147,6 +149,8 @@
rv = ipf_check(&V_ipfmain, mtod(*mp, struct ip *),
sizeof(struct ip6_hdr), ifp, !!(flags & PFIL_OUT), mp);
CURVNET_RESTORE();
+ if (rv == 0 && *mp == NULL)
+ return (PFIL_CONSUMED);
return (rv == 0 ? PFIL_PASS : PFIL_DROPPED);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Feb 4, 2:57 AM (21 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16446912
Default Alt Text
D43617.diff (2 KB)
Attached To
Mode
D43617: pfil: PFIL_PASS never frees the mbuf
Attached
Detach File
Event Timeline
Log In to Comment