aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/flow_dissector.h8
-rw-r--r--net/core/flow_dissector.c14
2 files changed, 12 insertions, 10 deletions
diff --git a/include/net/flow_dissector.h b/include/net/flow_dissector.h
index bddd1089dbce..8c8548cf5888 100644
--- a/include/net/flow_dissector.h
+++ b/include/net/flow_dissector.h
@@ -12,11 +12,13 @@
12struct flow_dissector_key_control { 12struct flow_dissector_key_control {
13 u16 thoff; 13 u16 thoff;
14 u16 addr_type; 14 u16 addr_type;
15 u32 is_fragment:1; 15 u32 flags;
16 u32 first_frag:1;
17 u32 encapsulation:1;
18}; 16};
19 17
18#define FLOW_DIS_IS_FRAGMENT BIT(0)
19#define FLOW_DIS_FIRST_FRAG BIT(1)
20#define FLOW_DIS_ENCAPSULATION BIT(2)
21
20/** 22/**
21 * struct flow_dissector_key_basic: 23 * struct flow_dissector_key_basic:
22 * @thoff: Transport header offset 24 * @thoff: Transport header offset
diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c
index b563339436d0..8d32020303c6 100644
--- a/net/core/flow_dissector.c
+++ b/net/core/flow_dissector.c
@@ -189,12 +189,12 @@ ip:
189 key_control->addr_type = FLOW_DISSECTOR_KEY_IPV4_ADDRS; 189 key_control->addr_type = FLOW_DISSECTOR_KEY_IPV4_ADDRS;
190 190
191 if (ip_is_fragment(iph)) { 191 if (ip_is_fragment(iph)) {
192 key_control->is_fragment = 1; 192 key_control->flags |= FLOW_DIS_IS_FRAGMENT;
193 193
194 if (iph->frag_off & htons(IP_OFFSET)) { 194 if (iph->frag_off & htons(IP_OFFSET)) {
195 goto out_good; 195 goto out_good;
196 } else { 196 } else {
197 key_control->first_frag = 1; 197 key_control->flags |= FLOW_DIS_FIRST_FRAG;
198 if (!(flags & FLOW_DISSECTOR_F_PARSE_1ST_FRAG)) 198 if (!(flags & FLOW_DISSECTOR_F_PARSE_1ST_FRAG))
199 goto out_good; 199 goto out_good;
200 } 200 }
@@ -398,7 +398,7 @@ ip_proto_again:
398 nhoff += sizeof(*eth); 398 nhoff += sizeof(*eth);
399 } 399 }
400 400
401 key_control->encapsulation = 1; 401 key_control->flags |= FLOW_DIS_ENCAPSULATION;
402 if (flags & FLOW_DISSECTOR_F_STOP_AT_ENCAP) 402 if (flags & FLOW_DISSECTOR_F_STOP_AT_ENCAP)
403 goto out_good; 403 goto out_good;
404 404
@@ -434,12 +434,12 @@ ip_proto_again:
434 if (!fh) 434 if (!fh)
435 goto out_bad; 435 goto out_bad;
436 436
437 key_control->is_fragment = 1; 437 key_control->flags |= FLOW_DIS_IS_FRAGMENT;
438 438
439 nhoff += sizeof(_fh); 439 nhoff += sizeof(_fh);
440 440
441 if (!(fh->frag_off & htons(IP6_OFFSET))) { 441 if (!(fh->frag_off & htons(IP6_OFFSET))) {
442 key_control->first_frag = 1; 442 key_control->flags |= FLOW_DIS_FIRST_FRAG;
443 if (flags & FLOW_DISSECTOR_F_PARSE_1ST_FRAG) { 443 if (flags & FLOW_DISSECTOR_F_PARSE_1ST_FRAG) {
444 ip_proto = fh->nexthdr; 444 ip_proto = fh->nexthdr;
445 goto ip_proto_again; 445 goto ip_proto_again;
@@ -450,7 +450,7 @@ ip_proto_again:
450 case IPPROTO_IPIP: 450 case IPPROTO_IPIP:
451 proto = htons(ETH_P_IP); 451 proto = htons(ETH_P_IP);
452 452
453 key_control->encapsulation = 1; 453 key_control->flags |= FLOW_DIS_ENCAPSULATION;
454 if (flags & FLOW_DISSECTOR_F_STOP_AT_ENCAP) 454 if (flags & FLOW_DISSECTOR_F_STOP_AT_ENCAP)
455 goto out_good; 455 goto out_good;
456 456
@@ -458,7 +458,7 @@ ip_proto_again:
458 case IPPROTO_IPV6: 458 case IPPROTO_IPV6:
459 proto = htons(ETH_P_IPV6); 459 proto = htons(ETH_P_IPV6);
460 460
461 key_control->encapsulation = 1; 461 key_control->flags |= FLOW_DIS_ENCAPSULATION;
462 if (flags & FLOW_DISSECTOR_F_STOP_AT_ENCAP) 462 if (flags & FLOW_DISSECTOR_F_STOP_AT_ENCAP)
463 goto out_good; 463 goto out_good;
464 464