[PATCH] skb_flow_dissector: Add support for 6in4 de-encapsulation

Dave Täht dave.taht at bufferbloat.net
Tue Jun 11 11:09:34 EDT 2013


The existing dissector handled gre and ipip encapsulated packets.
This adds support for ipv6 (proto 41) encapsulated packets to the
dissector, making possible a better fq_codel hash on 6in4, 6to4 tunnels.
---
 net/core/flow_dissector.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c
index 00ee068..a14bd91 100644
--- a/net/core/flow_dissector.c
+++ b/net/core/flow_dissector.c
@@ -54,6 +54,8 @@ ip:
 	case __constant_htons(ETH_P_IPV6): {
 		const struct ipv6hdr *iph;
 		struct ipv6hdr _iph;
+		__be16 frag = 0;
+		int nhoff6; 
 ipv6:
 		iph = skb_header_pointer(skb, nhoff, sizeof(_iph), &_iph);
 		if (!iph)
@@ -63,6 +65,9 @@ ipv6:
 		flow->src = (__force __be32)ipv6_addr_hash(&iph->saddr);
 		flow->dst = (__force __be32)ipv6_addr_hash(&iph->daddr);
 		nhoff += sizeof(struct ipv6hdr);
+		if((nhoff6 = ipv6_skip_exthdr(skb,nhoff,&ip_proto,&frag)) > -1)
+			nhoff += nhoff6;
+		if(frag != 0) ip_proto = 0;
 		break;
 	}
 	case __constant_htons(ETH_P_8021Q): {
@@ -138,6 +143,8 @@ ipv6:
 		}
 		break;
 	}
+	case IPPROTO_IPV6:
+	        proto = __constant_htons(ETH_P_IPV6);
 	case IPPROTO_IPIP:
 		goto again;
 	default:
-- 
1.8.1.2




More information about the Bloat-devel mailing list