]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
Merge r281164
authorkp <kp@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Thu, 18 Jun 2015 20:43:16 +0000 (20:43 +0000)
committerkp <kp@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Thu, 18 Jun 2015 20:43:16 +0000 (20:43 +0000)
commit9c1ea3eaac0c31b7d18f61632d9167477a3efa88
tree792224e8b98462475ac702904f00176d91ab994a
parent1f0aaa2c0b1618972194b09346a3d7f33feaf8a7
Merge r281164

pf: Skip firewall for refragmented ip6 packets

In cases where we scrub (fragment reassemble) on both input and output
we risk ending up in infinite loops when forwarding packets.

Fragmented packets come in and get collected until we can defragment. At
that point the defragmented packet is handed back to the ip stack (at
the pfil point in ip6_input(). Normal processing continues.

Eventually we figure out that the packet has to be forwarded and we end
up at the pfil hook in ip6_forward(). After doing the inspection on the
defragmented packet we see that the packet has been defragmented and
because we're forwarding we have to refragment it.

In pf_refragment6() we split the packet up again and then ip6_forward()
the individual fragments.  Those fragments hit the pfil hook on the way
out, so they're collected until we can reconstruct the full packet, at
which point we're right back where we left off and things continue until
we run out of stack.

Break that loop by marking the fragments generated by pf_refragment6()
as M_SKIP_FIREWALL. There's no point in processing those packets in the
firewall anyway. We've already filtered on the full packet.

Differential Revision: https://reviews.freebsd.org/D2819
Reviewed by: gnn

git-svn-id: svn://svn.freebsd.org/base/stable/10@284574 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/netpfil/pf/pf_norm.c