net/sched: act_tunnel_key: add support for "don't fragment"
[sfrench/cifs-2.6.git] / net / sched / act_tunnel_key.c
index 2d12d2626415333fe223e50128dab637b9a678ce..0c8aa7e686eab0cb3f9d8d27faf5996e80ec293f 100644 (file)
@@ -420,6 +420,9 @@ static int tunnel_key_init(struct net *net, struct nlattr *nla,
                    nla_get_u8(tb[TCA_TUNNEL_KEY_NO_CSUM]))
                        flags &= ~TUNNEL_CSUM;
 
+               if (nla_get_flag(tb[TCA_TUNNEL_KEY_NO_FRAG]))
+                       flags |= TUNNEL_DONT_FRAGMENT;
+
                if (tb[TCA_TUNNEL_KEY_ENC_DST_PORT])
                        dst_port = nla_get_be16(tb[TCA_TUNNEL_KEY_ENC_DST_PORT]);
 
@@ -747,6 +750,8 @@ static int tunnel_key_dump(struct sk_buff *skb, struct tc_action *a,
                                   key->tp_dst)) ||
                    nla_put_u8(skb, TCA_TUNNEL_KEY_NO_CSUM,
                               !(key->tun_flags & TUNNEL_CSUM)) ||
+                   ((key->tun_flags & TUNNEL_DONT_FRAGMENT) &&
+                    nla_put_flag(skb, TCA_TUNNEL_KEY_NO_FRAG)) ||
                    tunnel_key_opts_dump(skb, info))
                        goto nla_put_failure;