Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F142882303
D54845.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D54845.diff
View Options
diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c
--- a/sys/netpfil/pf/pf.c
+++ b/sys/netpfil/pf/pf.c
@@ -11961,11 +11961,11 @@
pf_is_loopback(af, pd.dst))
pd.m->m_flags |= M_SKIP_FIREWALL;
- if (af == AF_INET && __predict_false(ip_divert_ptr != NULL) &&
- action == PF_PASS && r->divert.port && !PACKET_LOOPED(&pd)) {
+ if (af == AF_INET && action == PF_PASS && r->divert.port &&
+ !PACKET_LOOPED(&pd)) {
mtag = m_tag_alloc(MTAG_PF_DIVERT, 0,
sizeof(struct pf_divert_mtag), M_NOWAIT | M_ZERO);
- if (mtag != NULL) {
+ if (__predict_true(mtag != NULL && ip_divert_ptr != NULL)) {
((struct pf_divert_mtag *)(mtag+1))->port =
ntohs(r->divert.port);
((struct pf_divert_mtag *)(mtag+1))->idir =
@@ -11994,15 +11994,20 @@
}
ip_divert_ptr(*m0, dir == PF_IN);
*m0 = NULL;
-
return (action);
- } else {
+ } else if (mtag == NULL) {
/* XXX: ipfw has the same behaviour! */
action = PF_DROP;
REASON_SET(&reason, PFRES_MEMORY);
pd.act.log = PF_LOG_FORCE;
DPFPRINTF(PF_DEBUG_MISC,
"pf: failed to allocate divert tag");
+ } else {
+ action = PF_DROP;
+ REASON_SET(&reason, PFRES_MATCH);
+ pd.act.log = PF_LOG_FORCE;
+ DPFPRINTF(PF_DEBUG_MISC,
+ "pf: divert(4) is not loaded");
}
}
/* XXX: Anybody working on it?! */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Jan 25, 11:07 AM (8 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27909788
Default Alt Text
D54845.diff (1 KB)
Attached To
Mode
D54845: pf: Rationalize the ip_divert_ptr test
Attached
Detach File
Event Timeline
Log In to Comment