Skip to content

Commit 2346829

Browse files
Dmitry Popovdavem330
authored andcommitted
ipip, sit: fix ipv4_{update_pmtu,redirect} calls
ipv4_{update_pmtu,redirect} were called with tunnel's ifindex (t->dev is a tunnel netdevice). It caused wrong route lookup and failure of pmtu update or redirect. We should use the same ifindex that we use in ip_route_output_* in *tunnel_xmit code. It is t->parms.link . Signed-off-by: Dmitry Popov <ixaphire@qrator.net> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 87757a9 commit 2346829

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

net/ipv4/ipip.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,13 @@ static int ipip_err(struct sk_buff *skb, u32 info)
149149

150150
if (type == ICMP_DEST_UNREACH && code == ICMP_FRAG_NEEDED) {
151151
ipv4_update_pmtu(skb, dev_net(skb->dev), info,
152-
t->dev->ifindex, 0, IPPROTO_IPIP, 0);
152+
t->parms.link, 0, IPPROTO_IPIP, 0);
153153
err = 0;
154154
goto out;
155155
}
156156

157157
if (type == ICMP_REDIRECT) {
158-
ipv4_redirect(skb, dev_net(skb->dev), t->dev->ifindex, 0,
158+
ipv4_redirect(skb, dev_net(skb->dev), t->parms.link, 0,
159159
IPPROTO_IPIP, 0);
160160
err = 0;
161161
goto out;

net/ipv6/sit.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -560,12 +560,12 @@ static int ipip6_err(struct sk_buff *skb, u32 info)
560560

561561
if (type == ICMP_DEST_UNREACH && code == ICMP_FRAG_NEEDED) {
562562
ipv4_update_pmtu(skb, dev_net(skb->dev), info,
563-
t->dev->ifindex, 0, IPPROTO_IPV6, 0);
563+
t->parms.link, 0, IPPROTO_IPV6, 0);
564564
err = 0;
565565
goto out;
566566
}
567567
if (type == ICMP_REDIRECT) {
568-
ipv4_redirect(skb, dev_net(skb->dev), t->dev->ifindex, 0,
568+
ipv4_redirect(skb, dev_net(skb->dev), t->parms.link, 0,
569569
IPPROTO_IPV6, 0);
570570
err = 0;
571571
goto out;

0 commit comments

Comments
 (0)