]> git.baikalelectronics.ru Git - kernel.git/commit
ipv6: Change "final" protocol processing for encapsulation
authorTom Herbert <tom@herbertland.com>
Wed, 18 May 2016 16:06:12 +0000 (09:06 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 20 May 2016 22:03:16 +0000 (18:03 -0400)
commit9bc22848b642ebf880d031740e09364d2f76d331
treea32de09a6508b90b1f7daeb78410e9f3dce8c1df
parentbb4d6c662bc7921413ac1c504246d2f0d89e8523
ipv6: Change "final" protocol processing for encapsulation

When performing foo-over-UDP, UDP packets are processed by the
encapsulation handler which returns another protocol to process.
This may result in processing two (or more) protocols in the
loop that are marked as INET6_PROTO_FINAL. The actions taken
for hitting a final protocol, in particular the skb_postpull_rcsum
can only be performed once.

This patch set adds a check of a final protocol has been seen. The
rules are:
  - If the final protocol has not been seen any protocol is processed
    (final and non-final). In the case of a final protocol, the final
    actions are taken (like the skb_postpull_rcsum)
  - If a final protocol has been seen (e.g. an encapsulating UDP
    header) then no further non-final protocols are allowed
    (e.g. extension headers). For more final protocols the
    final actions are not taken (e.g. skb_postpull_rcsum).

Signed-off-by: Tom Herbert <tom@herbertland.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/ip6_input.c