Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151821745
D49550.id152904.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
948 B
Referenced Files
None
Subscribers
None
D49550.id152904.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
@@ -1523,15 +1523,28 @@
printf("\n");
}
s->timeout = PFTM_UNLINKED;
+ if (idx == PF_SK_STACK)
+ /*
+ * Remove the wire key from
+ * the hash. Other threads
+ * can't be referencing it
+ * because we still hold the
+ * hash lock.
+ */
+ pf_state_key_detach(s,
+ PF_SK_WIRE);
PF_HASHROW_UNLOCK(ih);
KEYS_UNLOCK();
- if (idx == PF_SK_WIRE) {
+ if (idx == PF_SK_WIRE)
+ /*
+ * We've not inserted either key.
+ * Free both.
+ */
uma_zfree(V_pf_state_key_z, skw);
- if (skw != sks)
- uma_zfree(V_pf_state_key_z, sks);
- } else {
- pf_detach_state(s);
- }
+ if (skw != sks)
+ uma_zfree(
+ V_pf_state_key_z,
+ sks);
return (EEXIST); /* collision! */
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Apr 11, 9:45 PM (6 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31310061
Default Alt Text
D49550.id152904.diff (948 B)
Attached To
Mode
D49550: pf: improve pf_state_key_attach() error handling
Attached
Detach File
Event Timeline
Log In to Comment