aboutsummaryrefslogtreecommitdiff
path: root/net/ipv4/route.c
diff options
context:
space:
mode:
authorGravatar David S. Miller <davem@davemloft.net> 2019-04-17 11:26:25 -0700
committerGravatar David S. Miller <davem@davemloft.net> 2019-04-17 11:26:25 -0700
commit6b0a7f84ea1fe248df96ccc4dd86e817e32ef65b (patch)
tree0a7976054052e793da782c2b7ec34eccfbf66449 /net/ipv4/route.c
parentMerge branch 's390-next' (diff)
parentMerge tag 'for-linus-5.1-2' of git://github.com/cminyard/linux-ipmi (diff)
downloadlinux-6b0a7f84ea1fe248df96ccc4dd86e817e32ef65b.tar.gz
linux-6b0a7f84ea1fe248df96ccc4dd86e817e32ef65b.tar.bz2
linux-6b0a7f84ea1fe248df96ccc4dd86e817e32ef65b.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflict resolution of af_smc.c from Stephen Rothwell. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/route.c')
-rw-r--r--net/ipv4/route.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index efa6a36cbfff..d9b5aa2290d6 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1200,9 +1200,23 @@ static struct dst_entry *ipv4_dst_check(struct dst_entry *dst, u32 cookie)
static void ipv4_link_failure(struct sk_buff *skb)
{
+ struct ip_options opt;
struct rtable *rt;
+ int res;
- icmp_send(skb, ICMP_DEST_UNREACH, ICMP_HOST_UNREACH, 0);
+ /* Recompile ip options since IPCB may not be valid anymore.
+ */
+ memset(&opt, 0, sizeof(opt));
+ opt.optlen = ip_hdr(skb)->ihl*4 - sizeof(struct iphdr);
+
+ rcu_read_lock();
+ res = __ip_options_compile(dev_net(skb->dev), &opt, skb, NULL);
+ rcu_read_unlock();
+
+ if (res)
+ return;
+
+ __icmp_send(skb, ICMP_DEST_UNREACH, ICMP_HOST_UNREACH, 0, &opt);
rt = skb_rtable(skb);
if (rt)