From: William Dauchy <will...@gandi.net>

Signed-off-by: Ahmed Amamou <ah...@gandi.net>
Signed-off-by: William Dauchy <will...@gandi.net>
---
 net/core/flow_dissector.c | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c
index 2a834c6..95c2794 100644
--- a/net/core/flow_dissector.c
+++ b/net/core/flow_dissector.c
@@ -18,6 +18,9 @@
 #include <linux/mpls.h>
 #include <net/flow_dissector.h>
 #include <scsi/fc/fc_fcoe.h>
+#ifdef CONFIG_TRILL
+#include <net/if_trill.h>
+#endif
 
 static bool skb_flow_dissector_uses_key(struct flow_dissector *flow_dissector,
                                        enum flow_dissector_key_id key_id)
@@ -165,6 +168,34 @@ bool __skb_flow_dissect(const struct sk_buff *skb,
 
 again:
        switch (proto) {
+#ifdef CONFIG_TRILL
+       case htons(ETH_P_TRILL): {
+               const struct trill_hdr *trillh;
+               struct trill_hdr _trillh;
+               const struct ethhdr *eth;
+               struct ethhdr _eth;
+               u8 trill_op_len;
+
+               trillh = __skb_header_pointer(skb, nhoff, sizeof(_trillh),
+                                             data, hlen, &_trillh);
+               if (!trillh)
+                       return false;
+               nhoff += sizeof(*trillh);
+               trill_op_len = trill_get_optslen(ntohs(trillh->th_flags));
+               if (trill_op_len)
+                       nhoff += trill_op_len;
+
+               eth = __skb_header_pointer(skb, nhoff, sizeof(_eth), data,
+                                          hlen, &_eth);
+               if (!eth)
+                       return false;
+               proto = eth->h_proto;
+               nhoff += sizeof(*eth);
+
+               /* handle any vlan tag if present */
+               goto again;
+       }
+#endif
        case htons(ETH_P_IP): {
                const struct iphdr *iph;
                struct iphdr _iph;
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to