Skip to content

Commit 475949d

Browse files
committed
ipv4: Renamt struct rtable's rt_tos to rt_key_tos.
To more accurately reflect that it is purely a routing cache lookup key and is used in no other context. Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 417da66 commit 475949d

3 files changed

Lines changed: 14 additions & 14 deletions

File tree

‎include/net/route.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ struct rtable {
5252
int rt_genid;
5353
unsigned rt_flags;
5454
__u16 rt_type;
55-
__u8 rt_tos;
55+
__u8 rt_key_tos;
5656

5757
__be32 rt_dst; /* Path destination */
5858
__be32 rt_src; /* Path source */

‎net/ipv4/route.c‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ static int rt_cache_seq_show(struct seq_file *seq, void *v)
424424
dst_metric(&r->dst, RTAX_WINDOW),
425425
(int)((dst_metric(&r->dst, RTAX_RTT) >> 3) +
426426
dst_metric(&r->dst, RTAX_RTTVAR)),
427-
r->rt_tos,
427+
r->rt_key_tos,
428428
r->dst.hh ? atomic_read(&r->dst.hh->hh_refcnt) : -1,
429429
r->dst.hh ? (r->dst.hh->hh_output ==
430430
dev_queue_xmit) : 0,
@@ -724,7 +724,7 @@ static inline int compare_keys(struct rtable *rt1, struct rtable *rt2)
724724
return (((__force u32)rt1->rt_key_dst ^ (__force u32)rt2->rt_key_dst) |
725725
((__force u32)rt1->rt_key_src ^ (__force u32)rt2->rt_key_src) |
726726
(rt1->rt_mark ^ rt2->rt_mark) |
727-
(rt1->rt_tos ^ rt2->rt_tos) |
727+
(rt1->rt_key_tos ^ rt2->rt_key_tos) |
728728
(rt1->rt_oif ^ rt2->rt_oif) |
729729
(rt1->rt_iif ^ rt2->rt_iif)) == 0;
730730
}
@@ -1349,7 +1349,7 @@ static struct dst_entry *ipv4_negative_advice(struct dst_entry *dst)
13491349
rt_genid(dev_net(dst->dev)));
13501350
#if RT_CACHE_DEBUG >= 1
13511351
printk(KERN_DEBUG "ipv4_negative_advice: redirect to %pI4/%02x dropped\n",
1352-
&rt->rt_dst, rt->rt_tos);
1352+
&rt->rt_dst, rt->rt_key_tos);
13531353
#endif
13541354
rt_del(hash, rt);
13551355
ret = NULL;
@@ -1710,7 +1710,7 @@ void ip_rt_get_source(u8 *addr, struct rtable *rt)
17101710
struct flowi4 fl4 = {
17111711
.daddr = rt->rt_key_dst,
17121712
.saddr = rt->rt_key_src,
1713-
.flowi4_tos = rt->rt_tos,
1713+
.flowi4_tos = rt->rt_key_tos,
17141714
.flowi4_oif = rt->rt_oif,
17151715
.flowi4_iif = rt->rt_iif,
17161716
.flowi4_mark = rt->rt_mark,
@@ -1886,7 +1886,7 @@ static int ip_route_input_mc(struct sk_buff *skb, __be32 daddr, __be32 saddr,
18861886
rth->rt_genid = rt_genid(dev_net(dev));
18871887
rth->rt_flags = RTCF_MULTICAST;
18881888
rth->rt_type = RTN_MULTICAST;
1889-
rth->rt_tos = tos;
1889+
rth->rt_key_tos = tos;
18901890
rth->rt_dst = daddr;
18911891
rth->rt_src = saddr;
18921892
rth->rt_route_iif = dev->ifindex;
@@ -2023,7 +2023,7 @@ static int __mkroute_input(struct sk_buff *skb,
20232023
rth->rt_genid = rt_genid(dev_net(rth->dst.dev));
20242024
rth->rt_flags = flags;
20252025
rth->rt_type = res->type;
2026-
rth->rt_tos = tos;
2026+
rth->rt_key_tos = tos;
20272027
rth->rt_dst = daddr;
20282028
rth->rt_src = saddr;
20292029
rth->rt_route_iif = in_dev->dev->ifindex;
@@ -2203,7 +2203,7 @@ out: return err;
22032203
rth->rt_genid = rt_genid(net);
22042204
rth->rt_flags = flags|RTCF_LOCAL;
22052205
rth->rt_type = res.type;
2206-
rth->rt_tos = tos;
2206+
rth->rt_key_tos = tos;
22072207
rth->rt_dst = daddr;
22082208
rth->rt_src = saddr;
22092209
#ifdef CONFIG_IP_ROUTE_CLASSID
@@ -2293,7 +2293,7 @@ int ip_route_input_common(struct sk_buff *skb, __be32 daddr, __be32 saddr,
22932293
((__force u32)rth->rt_key_src ^ (__force u32)saddr) |
22942294
(rth->rt_iif ^ iif) |
22952295
rth->rt_oif |
2296-
(rth->rt_tos ^ tos)) == 0 &&
2296+
(rth->rt_key_tos ^ tos)) == 0 &&
22972297
rth->rt_mark == skb->mark &&
22982298
net_eq(dev_net(rth->dst.dev), net) &&
22992299
!rt_is_expired(rth)) {
@@ -2410,7 +2410,7 @@ static struct rtable *__mkroute_output(const struct fib_result *res,
24102410
rth->rt_genid = rt_genid(dev_net(dev_out));
24112411
rth->rt_flags = flags;
24122412
rth->rt_type = type;
2413-
rth->rt_tos = tos;
2413+
rth->rt_key_tos = tos;
24142414
rth->rt_dst = fl4->daddr;
24152415
rth->rt_src = fl4->saddr;
24162416
rth->rt_route_iif = 0;
@@ -2668,7 +2668,7 @@ struct rtable *__ip_route_output_key(struct net *net, struct flowi4 *flp4)
26682668
rt_is_output_route(rth) &&
26692669
rth->rt_oif == flp4->flowi4_oif &&
26702670
rth->rt_mark == flp4->flowi4_mark &&
2671-
!((rth->rt_tos ^ flp4->flowi4_tos) &
2671+
!((rth->rt_key_tos ^ flp4->flowi4_tos) &
26722672
(IPTOS_RT_MASK | RTO_ONLINK)) &&
26732673
net_eq(dev_net(rth->dst.dev), net) &&
26742674
!rt_is_expired(rth)) {
@@ -2740,7 +2740,7 @@ struct dst_entry *ipv4_blackhole_route(struct net *net, struct dst_entry *dst_or
27402740

27412741
rt->rt_key_dst = ort->rt_key_dst;
27422742
rt->rt_key_src = ort->rt_key_src;
2743-
rt->rt_tos = ort->rt_tos;
2743+
rt->rt_key_tos = ort->rt_key_tos;
27442744
rt->rt_route_iif = ort->rt_route_iif;
27452745
rt->rt_iif = ort->rt_iif;
27462746
rt->rt_oif = ort->rt_oif;
@@ -2803,7 +2803,7 @@ static int rt_fill_info(struct net *net,
28032803
r->rtm_family = AF_INET;
28042804
r->rtm_dst_len = 32;
28052805
r->rtm_src_len = 0;
2806-
r->rtm_tos = rt->rt_tos;
2806+
r->rtm_tos = rt->rt_key_tos;
28072807
r->rtm_table = RT_TABLE_MAIN;
28082808
NLA_PUT_U32(skb, RTA_TABLE, RT_TABLE_MAIN);
28092809
r->rtm_type = rt->rt_type;

‎net/ipv4/xfrm4_policy.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ static int xfrm4_fill_dst(struct xfrm_dst *xdst, struct net_device *dev,
7373

7474
rt->rt_key_dst = fl4->daddr;
7575
rt->rt_key_src = fl4->saddr;
76-
rt->rt_tos = fl4->flowi4_tos;
76+
rt->rt_key_tos = fl4->flowi4_tos;
7777
rt->rt_route_iif = fl4->flowi4_iif;
7878
rt->rt_iif = fl4->flowi4_iif;
7979
rt->rt_oif = fl4->flowi4_oif;

0 commit comments

Comments
 (0)