Commit 6892986c authored by Eric Dumazet's avatar Eric Dumazet Committed by Ben Hutchings

ipv4: keep skb->dst around in presence of IP options

Upstream commit 34b2cef2
("ipv4: keep skb->dst around in presence of IP options") incorrectly
root caused commit d826eb14 ("ipv4: PKTINFO doesnt need dst
reference") as bug origin.

This patch should fix the issue for 3.2.xx stable kernels, since IPv4
options seem to get more traction these days, after years of oblivion ;)

Fixes: f84af32c ("net: ip_queue_rcv_skb() helper"))
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Reported-by: default avatarAnarcheuz Fritz <anarcheuz@gmail.com>
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent a5d34b6e
......@@ -1009,7 +1009,8 @@ static int do_ip_setsockopt(struct sock *sk, int level,
*/
int ip_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
{
if (!(inet_sk(sk)->cmsg_flags & IP_CMSG_PKTINFO))
if (!(inet_sk(sk)->cmsg_flags & IP_CMSG_PKTINFO) &&
!IPCB(skb)->opt.optlen)
skb_dst_drop(skb);
return sock_queue_rcv_skb(sk, skb);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment