]> Git Repo - linux.git/blobdiff - drivers/net/geneve.c
dt-bindings: net: dsa: make phylink bindings required for CPU/DSA ports
[linux.git] / drivers / net / geneve.c
index 018d365f9debfde80e1827551228512c7ccf72f4..7962c37b3f14bc244db5725a0578132601d892aa 100644 (file)
@@ -797,7 +797,8 @@ static struct rtable *geneve_get_v4_rt(struct sk_buff *skb,
                                       struct geneve_sock *gs4,
                                       struct flowi4 *fl4,
                                       const struct ip_tunnel_info *info,
-                                      __be16 dport, __be16 sport)
+                                      __be16 dport, __be16 sport,
+                                      __u8 *full_tos)
 {
        bool use_cache = ip_tunnel_dst_cache_usable(skb, info);
        struct geneve_dev *geneve = netdev_priv(dev);
@@ -823,6 +824,8 @@ static struct rtable *geneve_get_v4_rt(struct sk_buff *skb,
                use_cache = false;
        }
        fl4->flowi4_tos = RT_TOS(tos);
+       if (full_tos)
+               *full_tos = tos;
 
        dst_cache = (struct dst_cache *)&info->dst_cache;
        if (use_cache) {
@@ -876,8 +879,7 @@ static struct dst_entry *geneve_get_v6_dst(struct sk_buff *skb,
                use_cache = false;
        }
 
-       fl6->flowlabel = ip6_make_flowinfo(RT_TOS(prio),
-                                          info->key.label);
+       fl6->flowlabel = ip6_make_flowinfo(prio, info->key.label);
        dst_cache = (struct dst_cache *)&info->dst_cache;
        if (use_cache) {
                dst = dst_cache_get_ip6(dst_cache, &fl6->saddr);
@@ -911,6 +913,7 @@ static int geneve_xmit_skb(struct sk_buff *skb, struct net_device *dev,
        const struct ip_tunnel_key *key = &info->key;
        struct rtable *rt;
        struct flowi4 fl4;
+       __u8 full_tos;
        __u8 tos, ttl;
        __be16 df = 0;
        __be16 sport;
@@ -921,7 +924,7 @@ static int geneve_xmit_skb(struct sk_buff *skb, struct net_device *dev,
 
        sport = udp_flow_src_port(geneve->net, skb, 1, USHRT_MAX, true);
        rt = geneve_get_v4_rt(skb, dev, gs4, &fl4, info,
-                             geneve->cfg.info.key.tp_dst, sport);
+                             geneve->cfg.info.key.tp_dst, sport, &full_tos);
        if (IS_ERR(rt))
                return PTR_ERR(rt);
 
@@ -965,7 +968,7 @@ static int geneve_xmit_skb(struct sk_buff *skb, struct net_device *dev,
 
                df = key->tun_flags & TUNNEL_DONT_FRAGMENT ? htons(IP_DF) : 0;
        } else {
-               tos = ip_tunnel_ecn_encap(fl4.flowi4_tos, ip_hdr(skb), skb);
+               tos = ip_tunnel_ecn_encap(full_tos, ip_hdr(skb), skb);
                if (geneve->cfg.ttl_inherit)
                        ttl = ip_tunnel_get_ttl(ip_hdr(skb), skb);
                else
@@ -1149,7 +1152,7 @@ static int geneve_fill_metadata_dst(struct net_device *dev, struct sk_buff *skb)
                                          1, USHRT_MAX, true);
 
                rt = geneve_get_v4_rt(skb, dev, gs4, &fl4, info,
-                                     geneve->cfg.info.key.tp_dst, sport);
+                                     geneve->cfg.info.key.tp_dst, sport, NULL);
                if (IS_ERR(rt))
                        return PTR_ERR(rt);
 
This page took 0.028583 seconds and 4 git commands to generate.