Skip to content

Commit

Permalink
ipv[4|6]: correct dropwatch false positive in local_deliver_finish
Browse files Browse the repository at this point in the history
I had a report recently of a user trying to use dropwatch to localise some frame
loss, and they were getting false positives.  Turned out they were using a user
space SCTP stack that used raw sockets to grab frames.  When we don't have a
registered protocol for a given packet, we record it as a drop, even if a raw
socket receieves the frame.  We should only record the drop in the event a raw
socket doesnt exist to receive the frames

Tested by the reported successfully

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Reported-by: William Reich <reich@ulticom.com>
Tested-by: William Reich <reich@ulticom.com>
CC: "David S. Miller" <davem@davemloft.net>
CC: William Reich <reich@ulticom.com>
CC: eric.dumazet@gmail.com
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Neil Horman authored and David S. Miller committed Mar 1, 2013
1 parent 9e0aab8 commit d8c6f4b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions net/ipv4/ip_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,11 @@ static int ip_local_deliver_finish(struct sk_buff *skb)
icmp_send(skb, ICMP_DEST_UNREACH,
ICMP_PROT_UNREACH, 0);
}
} else
kfree_skb(skb);
} else {
IP_INC_STATS_BH(net, IPSTATS_MIB_INDELIVERS);
kfree_skb(skb);
consume_skb(skb);
}
}
}
out:
Expand Down
6 changes: 4 additions & 2 deletions net/ipv6/ip6_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,11 @@ static int ip6_input_finish(struct sk_buff *skb)
icmpv6_send(skb, ICMPV6_PARAMPROB,
ICMPV6_UNK_NEXTHDR, nhoff);
}
} else
kfree_skb(skb);
} else {
IP6_INC_STATS_BH(net, idev, IPSTATS_MIB_INDELIVERS);
kfree_skb(skb);
consume_skb(skb);
}
}
rcu_read_unlock();
return 0;
Expand Down

0 comments on commit d8c6f4b

Please sign in to comment.