From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yi-Hung Wei Subject: [PATCH net-next] openvswitch: Derive IP protocol number for IPv6 later frags Date: Fri, 10 Aug 2018 10:19:41 -0700 Message-ID: <1533921581-22806-1-git-send-email-yihung.wei@gmail.com> Cc: Yi-Hung Wei To: netdev@vger.kernel.org, u9012063@gmail.com Return-path: Received: from mail-pf1-f195.google.com ([209.85.210.195]:34613 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727404AbeHJTyb (ORCPT ); Fri, 10 Aug 2018 15:54:31 -0400 Received: by mail-pf1-f195.google.com with SMTP id k19-v6so4845855pfi.1 for ; Fri, 10 Aug 2018 10:23:46 -0700 (PDT) Sender: netdev-owner@vger.kernel.org List-ID: Currently, OVS only parses the IP protocol number for the first IPv6 fragment, but sets the IP protocol number for the later fragments to be NEXTHDF_FRAGMENT. This patch tries to derive the IP protocol number for the IPV6 later frags so that we can match that. Signed-off-by: Yi-Hung Wei --- net/openvswitch/flow.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/net/openvswitch/flow.c b/net/openvswitch/flow.c index 56b8e7167790..3d654c4f71be 100644 --- a/net/openvswitch/flow.c +++ b/net/openvswitch/flow.c @@ -297,7 +297,13 @@ static int parse_ipv6hdr(struct sk_buff *skb, struct sw_flow_key *key) nh_len = payload_ofs - nh_ofs; skb_set_transport_header(skb, nh_ofs + nh_len); - key->ip.proto = nexthdr; + if (key->ip.frag == OVS_FRAG_TYPE_LATER) { + unsigned int offset = 0; + + key->ip.proto = ipv6_find_hdr(skb, &offset, -1, NULL, NULL); + } else { + key->ip.proto = nexthdr; + } return nh_len; } -- 2.7.4