route.c (277a163c83d7ba93fba1e8980d29a9f8bfcfba6c) route.c (aad88724c9d54acb1a9737cb6069d8470fa85f74)
1/*
2 * INET An implementation of the TCP/IP protocol suite for the LINUX
3 * operating system. INET is implemented using the BSD Socket
4 * interface as the means of communication with the user level.
5 *
6 * ROUTE - implementation of the IP router.
7 *
8 * Authors: Ross Biro

--- 1115 unchanged lines hidden (view full) ---

1124
1125 icmp_send(skb, ICMP_DEST_UNREACH, ICMP_HOST_UNREACH, 0);
1126
1127 rt = skb_rtable(skb);
1128 if (rt)
1129 dst_set_expires(&rt->dst, 0);
1130}
1131
1/*
2 * INET An implementation of the TCP/IP protocol suite for the LINUX
3 * operating system. INET is implemented using the BSD Socket
4 * interface as the means of communication with the user level.
5 *
6 * ROUTE - implementation of the IP router.
7 *
8 * Authors: Ross Biro

--- 1115 unchanged lines hidden (view full) ---

1124
1125 icmp_send(skb, ICMP_DEST_UNREACH, ICMP_HOST_UNREACH, 0);
1126
1127 rt = skb_rtable(skb);
1128 if (rt)
1129 dst_set_expires(&rt->dst, 0);
1130}
1131
1132static int ip_rt_bug(struct sk_buff *skb)
1132static int ip_rt_bug(struct sock *sk, struct sk_buff *skb)
1133{
1134 pr_debug("%s: %pI4 -> %pI4, %s\n",
1135 __func__, &ip_hdr(skb)->saddr, &ip_hdr(skb)->daddr,
1136 skb->dev ? skb->dev->name : "?");
1137 kfree_skb(skb);
1138 WARN_ON(1);
1139 return 0;
1140}

--- 1072 unchanged lines hidden (view full) ---

2213 struct rtable *rt;
2214
2215 rt = dst_alloc(&ipv4_dst_blackhole_ops, NULL, 1, DST_OBSOLETE_NONE, 0);
2216 if (rt) {
2217 struct dst_entry *new = &rt->dst;
2218
2219 new->__use = 1;
2220 new->input = dst_discard;
1133{
1134 pr_debug("%s: %pI4 -> %pI4, %s\n",
1135 __func__, &ip_hdr(skb)->saddr, &ip_hdr(skb)->daddr,
1136 skb->dev ? skb->dev->name : "?");
1137 kfree_skb(skb);
1138 WARN_ON(1);
1139 return 0;
1140}

--- 1072 unchanged lines hidden (view full) ---

2213 struct rtable *rt;
2214
2215 rt = dst_alloc(&ipv4_dst_blackhole_ops, NULL, 1, DST_OBSOLETE_NONE, 0);
2216 if (rt) {
2217 struct dst_entry *new = &rt->dst;
2218
2219 new->__use = 1;
2220 new->input = dst_discard;
2221 new->output = dst_discard;
2221 new->output = dst_discard_sk;
2222
2223 new->dev = ort->dst.dev;
2224 if (new->dev)
2225 dev_hold(new->dev);
2226
2227 rt->rt_is_input = ort->rt_is_input;
2228 rt->rt_iif = ort->rt_iif;
2229 rt->rt_pmtu = ort->rt_pmtu;

--- 122 unchanged lines hidden (view full) ---

2352 } else {
2353 if (err == -EMSGSIZE)
2354 goto nla_put_failure;
2355 error = err;
2356 }
2357 }
2358 } else
2359#endif
2222
2223 new->dev = ort->dst.dev;
2224 if (new->dev)
2225 dev_hold(new->dev);
2226
2227 rt->rt_is_input = ort->rt_is_input;
2228 rt->rt_iif = ort->rt_iif;
2229 rt->rt_pmtu = ort->rt_pmtu;

--- 122 unchanged lines hidden (view full) ---

2352 } else {
2353 if (err == -EMSGSIZE)
2354 goto nla_put_failure;
2355 error = err;
2356 }
2357 }
2358 } else
2359#endif
2360 if (nla_put_u32(skb, RTA_IIF, rt->rt_iif))
2360 if (nla_put_u32(skb, RTA_IIF, skb->dev->ifindex))
2361 goto nla_put_failure;
2362 }
2363
2364 if (rtnl_put_cacheinfo(skb, &rt->dst, 0, expires, error) < 0)
2365 goto nla_put_failure;
2366
2367 return nlmsg_end(skb, nlh);
2368

--- 389 unchanged lines hidden ---
2361 goto nla_put_failure;
2362 }
2363
2364 if (rtnl_put_cacheinfo(skb, &rt->dst, 0, expires, error) < 0)
2365 goto nla_put_failure;
2366
2367 return nlmsg_end(skb, nlh);
2368

--- 389 unchanged lines hidden ---