Page MenuHomeFreeBSD

[pfil loop prevention experiment 4/5] pfil: Provide looping prevention mechanism
Needs ReviewPublic

Authored by vegeta_tuxpowered.net on Thu, Aug 7, 4:56 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Aug 19, 2:23 PM
Unknown Object (File)
Mon, Aug 18, 9:45 PM
Unknown Object (File)
Mon, Aug 18, 9:05 PM
Unknown Object (File)
Mon, Aug 18, 5:10 PM
Unknown Object (File)
Thu, Aug 14, 6:14 AM
Unknown Object (File)
Sun, Aug 10, 7:17 AM

Details

Reviewers
glebius
kp
Summary

Packets might be consumed by dummynet and reinjected later. In such case they pass through the network stack again and are send to the same pfil hooks (i.e. pf or ipfw) which must deal with loop protection (unconditionally passing the packets) on their own. Move the loop protection to pfil itself by using a custom mtag. Store pointer to the last hook in the mtag, when going over hooks skip the hooks which have been already ran.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

sys/net/pfil.c
231

Alternatively we could not always allocate the mtag in pfil.c but only check it here, but allocate it in the pfil hook when it is expected that looping would happen. kp@ has reported this causing a degradation in pps performance.