Commit 41e4e2cd authored by Yi-Hung Wei's avatar Yi-Hung Wei Committed by David S. Miller

openvswitch: Fix IPv6 later frags parsing

The previous commit fa642f08
("openvswitch: Derive IP protocol number for IPv6 later frags")
introduces IP protocol number parsing for IPv6 later frags that can mess
up the network header length calculation logic, i.e. nh_len < 0.
However, the network header length calculation is mainly for deriving
the transport layer header in the key extraction process which the later
fragment does not apply.

Therefore, this commit skips the network header length calculation to
fix the issue.
Reported-by: default avatarChris Mi <chrism@mellanox.com>
Reported-by: default avatarGreg Rose <gvrose8192@gmail.com>
Fixes: fa642f08 ("openvswitch: Derive IP protocol number for IPv6 later frags")
Signed-off-by: default avatarYi-Hung Wei <yihung.wei@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ba3e1847
...@@ -276,10 +276,12 @@ static int parse_ipv6hdr(struct sk_buff *skb, struct sw_flow_key *key) ...@@ -276,10 +276,12 @@ static int parse_ipv6hdr(struct sk_buff *skb, struct sw_flow_key *key)
nexthdr = ipv6_find_hdr(skb, &payload_ofs, -1, &frag_off, &flags); nexthdr = ipv6_find_hdr(skb, &payload_ofs, -1, &frag_off, &flags);
if (flags & IP6_FH_F_FRAG) { if (flags & IP6_FH_F_FRAG) {
if (frag_off) if (frag_off) {
key->ip.frag = OVS_FRAG_TYPE_LATER; key->ip.frag = OVS_FRAG_TYPE_LATER;
else key->ip.proto = nexthdr;
key->ip.frag = OVS_FRAG_TYPE_FIRST; return 0;
}
key->ip.frag = OVS_FRAG_TYPE_FIRST;
} else { } else {
key->ip.frag = OVS_FRAG_TYPE_NONE; key->ip.frag = OVS_FRAG_TYPE_NONE;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment