aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/route.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-07-12 00:30:08 -0400
committerDavid S. Miller <davem@davemloft.net>2012-07-12 00:30:08 -0400
commit1f42539d257af671d56d4bdbcf13aef31abff6ef (patch)
treee48de1974ba75f1b31d90f8348ba6a5514dba526 /net/ipv4/route.c
parent55be7a9c6074f749d617a7fc1914c9a23505438c (diff)
ipv4: Kill ip_rt_redirect().
No longer needed, as the protocol handlers now all properly propagate the redirect back into the routing code. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/route.c')
-rw-r--r--net/ipv4/route.c44
1 files changed, 0 insertions, 44 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index aabece6b729a..e98207dcd088 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1345,50 +1345,6 @@ reject_redirect:
1345 ; 1345 ;
1346} 1346}
1347 1347
1348/* called in rcu_read_lock() section */
1349void ip_rt_redirect(struct sk_buff *skb, __be32 new_gw)
1350{
1351 const struct iphdr *iph = (const struct iphdr *) skb->data;
1352 __be32 daddr = iph->daddr;
1353 __be32 saddr = iph->saddr;
1354 struct net_device *dev = skb->dev;
1355 int ikeys[2] = { dev->ifindex, 0 };
1356 __be32 skeys[2] = { saddr, 0 };
1357 struct net *net;
1358 int s, i;
1359
1360 net = dev_net(dev);
1361 for (s = 0; s < 2; s++) {
1362 for (i = 0; i < 2; i++) {
1363 unsigned int hash;
1364 struct rtable __rcu **rthp;
1365 struct rtable *rt;
1366
1367 hash = rt_hash(daddr, skeys[s], ikeys[i], rt_genid(net));
1368
1369 rthp = &rt_hash_table[hash].chain;
1370
1371 while ((rt = rcu_dereference(*rthp)) != NULL) {
1372 rthp = &rt->dst.rt_next;
1373
1374 if (rt->rt_key_dst != daddr ||
1375 rt->rt_key_src != skeys[s] ||
1376 rt->rt_oif != ikeys[i] ||
1377 rt_is_input_route(rt) ||
1378 rt_is_expired(rt) ||
1379 !net_eq(dev_net(rt->dst.dev), net) ||
1380 rt->dst.error ||
1381 rt->dst.dev != dev)
1382 continue;
1383
1384 ip_do_redirect(&rt->dst, skb);
1385 }
1386 }
1387 }
1388 return;
1389
1390}
1391
1392static struct dst_entry *ipv4_negative_advice(struct dst_entry *dst) 1348static struct dst_entry *ipv4_negative_advice(struct dst_entry *dst)
1393{ 1349{
1394 struct rtable *rt = (struct rtable *)dst; 1350 struct rtable *rt = (struct rtable *)dst;