Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6a74fcf4 authored by Tom Herbert's avatar Tom Herbert Committed by David S. Miller
Browse files

flow_dissector: add support for dst, hop-by-hop and routing ext hdrs



If dst, hop-by-hop or routing extension headers are present determine
length of the options and skip over them in flow dissection.

Signed-off-by: default avatarTom Herbert <tom@herbertland.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 611d23c5
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -327,6 +327,7 @@ bool __skb_flow_dissect(const struct sk_buff *skb,
		return false;
	}

ip_proto_again:
	switch (ip_proto) {
	case IPPROTO_GRE: {
		struct gre_hdr {
@@ -383,6 +384,22 @@ bool __skb_flow_dissect(const struct sk_buff *skb,
		}
		goto again;
	}
	case NEXTHDR_HOP:
	case NEXTHDR_ROUTING:
	case NEXTHDR_DEST: {
		u8 _opthdr[2], *opthdr;

		if (proto != htons(ETH_P_IPV6))
			break;

		opthdr = __skb_header_pointer(skb, nhoff, sizeof(_opthdr),
					      data, hlen, &_opthdr);

		ip_proto = _opthdr[0];
		nhoff += (_opthdr[1] + 1) << 3;

		goto ip_proto_again;
	}
	case IPPROTO_IPIP:
		proto = htons(ETH_P_IP);
		goto ip;