Skip to content

Commit 32f1bc0

Browse files
committed
Revert "ipv4: restore rt->fi for reference counting"
This reverts commit 82486aa. As implemented, this causes dangling netdevice refs. Reported-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 922c60e commit 32f1bc0

File tree

2 files changed

+1
-18
lines changed

2 files changed

+1
-18
lines changed

include/net/route.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ struct rtable {
6969

7070
struct list_head rt_uncached;
7171
struct uncached_list *rt_uncached_list;
72-
struct fib_info *fi; /* for refcnt to shared metrics */
7372
};
7473

7574
static inline bool rt_is_input_route(const struct rtable *rt)

net/ipv4/route.c

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1387,11 +1387,6 @@ static void ipv4_dst_destroy(struct dst_entry *dst)
13871387
{
13881388
struct rtable *rt = (struct rtable *) dst;
13891389

1390-
if (rt->fi) {
1391-
fib_info_put(rt->fi);
1392-
rt->fi = NULL;
1393-
}
1394-
13951390
if (!list_empty(&rt->rt_uncached)) {
13961391
struct uncached_list *ul = rt->rt_uncached_list;
13971392

@@ -1429,16 +1424,6 @@ static bool rt_cache_valid(const struct rtable *rt)
14291424
!rt_is_expired(rt);
14301425
}
14311426

1432-
static void rt_init_metrics(struct rtable *rt, struct fib_info *fi)
1433-
{
1434-
if (fi->fib_metrics != (u32 *)dst_default_metrics) {
1435-
fib_info_hold(fi);
1436-
rt->fi = fi;
1437-
}
1438-
1439-
dst_init_metrics(&rt->dst, fi->fib_metrics, true);
1440-
}
1441-
14421427
static void rt_set_nexthop(struct rtable *rt, __be32 daddr,
14431428
const struct fib_result *res,
14441429
struct fib_nh_exception *fnhe,
@@ -1453,7 +1438,7 @@ static void rt_set_nexthop(struct rtable *rt, __be32 daddr,
14531438
rt->rt_gateway = nh->nh_gw;
14541439
rt->rt_uses_gateway = 1;
14551440
}
1456-
rt_init_metrics(rt, fi);
1441+
dst_init_metrics(&rt->dst, fi->fib_metrics, true);
14571442
#ifdef CONFIG_IP_ROUTE_CLASSID
14581443
rt->dst.tclassid = nh->nh_tclassid;
14591444
#endif
@@ -1505,7 +1490,6 @@ struct rtable *rt_dst_alloc(struct net_device *dev,
15051490
rt->rt_gateway = 0;
15061491
rt->rt_uses_gateway = 0;
15071492
rt->rt_table_id = 0;
1508-
rt->fi = NULL;
15091493
INIT_LIST_HEAD(&rt->rt_uncached);
15101494

15111495
rt->dst.output = ip_output;

0 commit comments

Comments
 (0)