diff options
Diffstat (limited to 'net/ipv4/route.c')
-rw-r--r-- | net/ipv4/route.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index a5da63e5faa2..88ce038dd495 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
@@ -1185,9 +1185,23 @@ static struct dst_entry *ipv4_dst_check(struct dst_entry *dst, u32 cookie) | |||
1185 | 1185 | ||
1186 | static void ipv4_link_failure(struct sk_buff *skb) | 1186 | static void ipv4_link_failure(struct sk_buff *skb) |
1187 | { | 1187 | { |
1188 | struct ip_options opt; | ||
1188 | struct rtable *rt; | 1189 | struct rtable *rt; |
1190 | int res; | ||
1189 | 1191 | ||
1190 | icmp_send(skb, ICMP_DEST_UNREACH, ICMP_HOST_UNREACH, 0); | 1192 | /* Recompile ip options since IPCB may not be valid anymore. |
1193 | */ | ||
1194 | memset(&opt, 0, sizeof(opt)); | ||
1195 | opt.optlen = ip_hdr(skb)->ihl*4 - sizeof(struct iphdr); | ||
1196 | |||
1197 | rcu_read_lock(); | ||
1198 | res = __ip_options_compile(dev_net(skb->dev), &opt, skb, NULL); | ||
1199 | rcu_read_unlock(); | ||
1200 | |||
1201 | if (res) | ||
1202 | return; | ||
1203 | |||
1204 | __icmp_send(skb, ICMP_DEST_UNREACH, ICMP_HOST_UNREACH, 0, &opt); | ||
1191 | 1205 | ||
1192 | rt = skb_rtable(skb); | 1206 | rt = skb_rtable(skb); |
1193 | if (rt) | 1207 | if (rt) |