@@ -186,7 +186,7 @@ static void rt6_uncached_list_flush_dev(struct net *net, struct net_device *dev)
186
186
187
187
static u32 * rt6_pcpu_cow_metrics (struct rt6_info * rt )
188
188
{
189
- return dst_metrics_write_ptr (rt -> dst . from );
189
+ return dst_metrics_write_ptr (& rt -> from -> dst );
190
190
}
191
191
192
192
static u32 * ipv6_cow_metrics (struct dst_entry * dst , unsigned long old )
@@ -391,7 +391,7 @@ static void ip6_dst_destroy(struct dst_entry *dst)
391
391
{
392
392
struct rt6_info * rt = (struct rt6_info * )dst ;
393
393
struct rt6_exception_bucket * bucket ;
394
- struct dst_entry * from = dst -> from ;
394
+ struct rt6_info * from = rt -> from ;
395
395
struct inet6_dev * idev ;
396
396
397
397
dst_destroy_metrics_generic (dst );
@@ -409,8 +409,8 @@ static void ip6_dst_destroy(struct dst_entry *dst)
409
409
kfree (bucket );
410
410
}
411
411
412
- dst -> from = NULL ;
413
- dst_release (from );
412
+ rt -> from = NULL ;
413
+ dst_release (& from -> dst );
414
414
}
415
415
416
416
static void ip6_dst_ifdown (struct dst_entry * dst , struct net_device * dev ,
@@ -443,9 +443,9 @@ static bool rt6_check_expired(const struct rt6_info *rt)
443
443
if (rt -> rt6i_flags & RTF_EXPIRES ) {
444
444
if (time_after (jiffies , rt -> dst .expires ))
445
445
return true;
446
- } else if (rt -> dst . from ) {
446
+ } else if (rt -> from ) {
447
447
return rt -> dst .obsolete != DST_OBSOLETE_FORCE_CHK ||
448
- rt6_check_expired (( struct rt6_info * ) rt -> dst . from );
448
+ rt6_check_expired (rt -> from );
449
449
}
450
450
return false;
451
451
}
@@ -1054,7 +1054,7 @@ static struct rt6_info *ip6_rt_cache_alloc(struct rt6_info *ort,
1054
1054
*/
1055
1055
1056
1056
if (ort -> rt6i_flags & (RTF_CACHE | RTF_PCPU ))
1057
- ort = ( struct rt6_info * ) ort -> dst . from ;
1057
+ ort = ort -> from ;
1058
1058
1059
1059
rcu_read_lock ();
1060
1060
dev = ip6_rt_get_dev_rcu (ort );
@@ -1274,7 +1274,7 @@ static int rt6_insert_exception(struct rt6_info *nrt,
1274
1274
1275
1275
/* ort can't be a cache or pcpu route */
1276
1276
if (ort -> rt6i_flags & (RTF_CACHE | RTF_PCPU ))
1277
- ort = ( struct rt6_info * ) ort -> dst . from ;
1277
+ ort = ort -> from ;
1278
1278
WARN_ON_ONCE (ort -> rt6i_flags & (RTF_CACHE | RTF_PCPU ));
1279
1279
1280
1280
spin_lock_bh (& rt6_exception_lock );
@@ -1415,8 +1415,8 @@ static struct rt6_info *rt6_find_cached_rt(struct rt6_info *rt,
1415
1415
/* Remove the passed in cached rt from the hash table that contains it */
1416
1416
int rt6_remove_exception_rt (struct rt6_info * rt )
1417
1417
{
1418
- struct rt6_info * from = (struct rt6_info * )rt -> dst .from ;
1419
1418
struct rt6_exception_bucket * bucket ;
1419
+ struct rt6_info * from = rt -> from ;
1420
1420
struct in6_addr * src_key = NULL ;
1421
1421
struct rt6_exception * rt6_ex ;
1422
1422
int err ;
@@ -1460,8 +1460,8 @@ int rt6_remove_exception_rt(struct rt6_info *rt)
1460
1460
*/
1461
1461
static void rt6_update_exception_stamp_rt (struct rt6_info * rt )
1462
1462
{
1463
- struct rt6_info * from = (struct rt6_info * )rt -> dst .from ;
1464
1463
struct rt6_exception_bucket * bucket ;
1464
+ struct rt6_info * from = rt -> from ;
1465
1465
struct in6_addr * src_key = NULL ;
1466
1466
struct rt6_exception * rt6_ex ;
1467
1467
@@ -1929,9 +1929,9 @@ struct dst_entry *ip6_blackhole_route(struct net *net, struct dst_entry *dst_ori
1929
1929
1930
1930
static void rt6_dst_from_metrics_check (struct rt6_info * rt )
1931
1931
{
1932
- if (rt -> dst . from &&
1933
- dst_metrics_ptr (& rt -> dst ) != dst_metrics_ptr (rt -> dst . from ))
1934
- dst_init_metrics (& rt -> dst , dst_metrics_ptr (rt -> dst . from ), true);
1932
+ if (rt -> from &&
1933
+ dst_metrics_ptr (& rt -> dst ) != dst_metrics_ptr (& rt -> from -> dst ))
1934
+ dst_init_metrics (& rt -> dst , dst_metrics_ptr (& rt -> from -> dst ), true);
1935
1935
}
1936
1936
1937
1937
static struct dst_entry * rt6_check (struct rt6_info * rt , u32 cookie )
@@ -1951,7 +1951,7 @@ static struct dst_entry *rt6_dst_from_check(struct rt6_info *rt, u32 cookie)
1951
1951
{
1952
1952
if (!__rt6_check_expired (rt ) &&
1953
1953
rt -> dst .obsolete == DST_OBSOLETE_FORCE_CHK &&
1954
- rt6_check (( struct rt6_info * )( rt -> dst . from ) , cookie ))
1954
+ rt6_check (rt -> from , cookie ))
1955
1955
return & rt -> dst ;
1956
1956
else
1957
1957
return NULL ;
@@ -1971,7 +1971,7 @@ static struct dst_entry *ip6_dst_check(struct dst_entry *dst, u32 cookie)
1971
1971
rt6_dst_from_metrics_check (rt );
1972
1972
1973
1973
if (rt -> rt6i_flags & RTF_PCPU ||
1974
- (unlikely (!list_empty (& rt -> rt6i_uncached )) && rt -> dst . from ))
1974
+ (unlikely (!list_empty (& rt -> rt6i_uncached )) && rt -> from ))
1975
1975
return rt6_dst_from_check (rt , cookie );
1976
1976
else
1977
1977
return rt6_check (rt , cookie );
@@ -3055,11 +3055,11 @@ static void rt6_do_redirect(struct dst_entry *dst, struct sock *sk, struct sk_bu
3055
3055
3056
3056
static void rt6_set_from (struct rt6_info * rt , struct rt6_info * from )
3057
3057
{
3058
- BUG_ON (from -> dst . from );
3058
+ BUG_ON (from -> from );
3059
3059
3060
3060
rt -> rt6i_flags &= ~RTF_EXPIRES ;
3061
3061
dst_hold (& from -> dst );
3062
- rt -> dst . from = & from -> dst ;
3062
+ rt -> from = from ;
3063
3063
dst_init_metrics (& rt -> dst , dst_metrics_ptr (& from -> dst ), true);
3064
3064
}
3065
3065
0 commit comments