Thread (21 messages) flat view 21 messages, 4 authors, 2018-02-26

Re: [PATCH net-next 5/5] ipv6: route: dissect flow in input path if fib rules need it

From: Roopa Prabhu <hidden>
Date: 2018-02-26 03:40:35

On Sun, Feb 25, 2018 at 7:19 PM, David Ahern [off-list ref] wrote:
On 2/24/18 10:44 PM, Roopa Prabhu wrote:
quoted
@@ -1847,12 +1858,27 @@ void ip6_route_input(struct sk_buff *skb)
              .flowi6_mark = skb->mark,
              .flowi6_proto = iph->nexthdr,
      };
+     struct flow_keys *flkeys = NULL, _flkeys;

      tun_info = skb_tunnel_info(skb);
      if (tun_info && !(tun_info->mode & IP_TUNNEL_INFO_TX))
              fl6.flowi6_tun_key.tun_id = tun_info->key.tun_id;
+
+#ifdef CONFIG_IPV6_MULTIPLE_TABLES
+     if (net->ipv6.fib6_rules_require_fldissect) {
+             unsigned int flag = FLOW_DISSECTOR_F_STOP_AT_ENCAP;
+
+             memset(&_flkeys, 0, sizeof(_flkeys));
+             skb_flow_dissect_flow_keys(skb, &_flkeys, flag);
+             fl6.fl6_sport = _flkeys.ports.src;
+             fl6.fl6_dport = _flkeys.ports.dst;
+             fl6.flowi6_proto = _flkeys.basic.ip_proto;
+             flkeys = &_flkeys;
+     }
+#endif
same here - helper versus inline.
ack
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help