net: Use helper macro RT_TOS() in __icmp_send()
authorMiaohe Lin <linmiaohe@huawei.com>
Mon, 24 Aug 2020 11:44:37 +0000 (07:44 -0400)
committerDavid S. Miller <davem@davemloft.net>
Tue, 25 Aug 2020 01:12:36 +0000 (18:12 -0700)
Use helper macro RT_TOS() to get tos in __icmp_send().

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/icmp.c

index cf36f95..3b387dc 100644 (file)
@@ -690,9 +690,9 @@ void __icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info,
                rcu_read_unlock();
        }
 
-       tos = icmp_pointers[type].error ? ((iph->tos & IPTOS_TOS_MASK) |
+       tos = icmp_pointers[type].error ? (RT_TOS(iph->tos) |
                                           IPTOS_PREC_INTERNETCONTROL) :
-                                         iph->tos;
+                                          iph->tos;
        mark = IP4_REPLY_MARK(net, skb_in->mark);
 
        if (__ip_options_echo(net, &icmp_param.replyopts.opt.opt, skb_in, opt))