Skip to content

Commit 1b9388d

Browse files
committed
blackhole_netdev: use blackhole_netdev to invalidate dst entries
jira LE-3201 Rebuild_History Non-Buildable kernel-rt-4.18.0-553.27.1.rt7.368.el8_10 commit-author Mahesh Bandewar <maheshb@google.com> commit 8d7017f Use blackhole_netdev instead of 'lo' device with lower MTU when marking dst "dead". Signed-off-by: Mahesh Bandewar <maheshb@google.com> Tested-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net> (cherry picked from commit 8d7017f) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent b338524 commit 1b9388d

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

net/core/dst.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ void dst_dev_put(struct dst_entry *dst)
170170
dst->ops->ifdown(dst, dev, true);
171171
dst->input = dst_discard;
172172
dst->output = dst_discard_out;
173-
dst->dev = dev_net(dst->dev)->loopback_dev;
173+
dst->dev = blackhole_netdev;
174174
dev_hold(dst->dev);
175175
dev_put(dev);
176176
}

net/ipv4/route.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1570,7 +1570,6 @@ static void ipv4_dst_destroy(struct dst_entry *dst)
15701570

15711571
void rt_flush_dev(struct net_device *dev)
15721572
{
1573-
struct net *net = dev_net(dev);
15741573
struct rtable *rt;
15751574
int cpu;
15761575

@@ -1581,7 +1580,7 @@ void rt_flush_dev(struct net_device *dev)
15811580
list_for_each_entry(rt, &ul->head, rt_uncached) {
15821581
if (rt->dst.dev != dev)
15831582
continue;
1584-
rt->dst.dev = net->loopback_dev;
1583+
rt->dst.dev = blackhole_netdev;
15851584
dev_hold(rt->dst.dev);
15861585
dev_put(dev);
15871586
}

net/ipv6/route.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ static void rt6_uncached_list_flush_dev(struct net *net, struct net_device *dev)
183183
}
184184

185185
if (rt_dev == dev) {
186-
rt->dst.dev = loopback_dev;
186+
rt->dst.dev = blackhole_netdev;
187187
dev_hold(rt->dst.dev);
188188
dev_put(rt_dev);
189189
}

0 commit comments

Comments
 (0)