Skip to contentSkip to conversation

ipv4: correct dropwatch false positive in ip_local_deliver_finish

PATCH In review Neil Horman 2 participants 4 messages Mar 1, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ipv4: correct dropwatch false positive in ip_local_deliver_finish

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

---
 net/ipv4/ip_input.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
net/ipv4/ip_input.c +4 -2
index 87abd3e..2bdf802 100644
@@ -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:
Signature · 1 line
1.7.11.7
Acked-by on v1 1/1
#1 lore raw
Quoted 26 lines · Neil Horman

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

---
 net/ipv4/ip_input.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
net/ipv4/ip_input.c +0 -0
index 87abd3e..2bdf802 100644
@@ -228,9 +228,11 @@ static int ip_local_deliver_finish(struct sk_buff *skb)
 					icmp_send(skb, ICMP_DEST_UNREACH,
 						  ICMP_PROT_UNREACH, 0);
 				}

net/ipv4/ip_input.c static int ip_local_deliver_finish(struct sk_buff *skb) · line 238

Quoted 10 lines
net/ipv4/ip_input.c +4 -2
-			} else
+				kfree_skb(skb);
+			} else {
 				IP_INC_STATS_BH(net, IPSTATS_MIB_INDELIVERS);
-			kfree_skb(skb);
+				consume_skb(skb);
+			}
 		}
 	}
  out:
#2 lore raw
In reply to Neil Horman
Quoted 9 lines · Neil Horman

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

Quoted 8 lines
---
 net/ipv4/ip_input.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Hmm, could you perhaps do the similar fix for IPv6 in the same patch ?

Thanks !

#3 lore raw
Quoted 19 lines · Eric Dumazet
Quoted 9 lines · Neil Horman

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

Quoted 8 lines
---
 net/ipv4/ip_input.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
Quoted 4 lines

Hmm, could you perhaps do the similar fix for IPv6 in the same patch ?

Thanks !

Sure, give me a moment, and I'll respin it.
Neil

Quoted 6 lines

--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html