aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/route.h1
-rw-r--r--net/ipv4/icmp.c1
-rw-r--r--net/ipv4/route.c44
3 files changed, 0 insertions, 46 deletions
diff --git a/include/net/route.h b/include/net/route.h
index 6ab93eeb8660..ace3cb442519 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -108,7 +108,6 @@ extern struct ip_rt_acct __percpu *ip_rt_acct;
108 108
109struct in_device; 109struct in_device;
110extern int ip_rt_init(void); 110extern int ip_rt_init(void);
111extern void ip_rt_redirect(struct sk_buff *skb, __be32 new_gw);
112extern void rt_cache_flush(struct net *net, int how); 111extern void rt_cache_flush(struct net *net, int how);
113extern void rt_cache_flush_batch(struct net *net); 112extern void rt_cache_flush_batch(struct net *net);
114extern struct rtable *__ip_route_output_key(struct net *, struct flowi4 *flp); 113extern struct rtable *__ip_route_output_key(struct net *, struct flowi4 *flp);
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index 70a793559bb5..d01aeb4d492e 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -763,7 +763,6 @@ static void icmp_redirect(struct sk_buff *skb)
763 if (!pskb_may_pull(skb, sizeof(struct iphdr))) 763 if (!pskb_may_pull(skb, sizeof(struct iphdr)))
764 return; 764 return;
765 765
766 ip_rt_redirect(skb, icmp_hdr(skb)->un.gateway);
767 icmp_socket_deliver(skb, icmp_hdr(skb)->un.gateway); 766 icmp_socket_deliver(skb, icmp_hdr(skb)->un.gateway);
768} 767}
769 768
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;