From 7100de193a1848d14a1221b9e83d6c2f2ad93f5a Mon Sep 17 00:00:00 2001 From: Mark Huang Date: Mon, 17 Jan 2005 20:01:59 +0000 Subject: [PATCH] - PL3791 fix: Suppress ICMP Unreachable if the port was bound to a (presumably raw) socket --- net/ipv4/udp.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index ad097f510..d95648244 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -1237,8 +1237,11 @@ int udp_rcv(struct sk_buff *skb) if (udp_checksum_complete(skb)) goto csum_error; - UDP_INC_STATS_BH(UDP_MIB_NOPORTS); - icmp_send(skb, ICMP_DEST_UNREACH, ICMP_PORT_UNREACH, 0); + /* VNET: Suppress ICMP Unreachable if the port was bound to a (presumably raw) socket */ + if (!skb->sk) { + UDP_INC_STATS_BH(UDP_MIB_NOPORTS); + icmp_send(skb, ICMP_DEST_UNREACH, ICMP_PORT_UNREACH, 0); + } /* * Hmm. We got an UDP packet to a port to which we -- 2.47.0