From 82163f01d700937179c7786bbd912cf7be4e07aa Mon Sep 17 00:00:00 2001 From: Mark Huang Date: Fri, 4 Mar 2005 13:59:59 +0000 Subject: [PATCH] - merge revision 1.12 date: 2005/02/01 03:19:52; author: mlhuang; state: Exp; lines: +9 -4 - bound vnet mods by #ifdef - bound runtime vnet code by if (vnet_active) --- net/ipv4/udp.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 41b0117be..6dbb6be8e 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -1164,11 +1164,16 @@ int udp_rcv(struct sk_buff *skb) if (udp_checksum_complete(skb)) goto csum_error; - /* 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); +#if defined(CONFIG_VNET) || defined(CONFIG_VNET_MODULE) + if (vnet_active && skb->sk) { + /* VNET: Suppress ICMP Unreachable if the port was bound to a (presumably raw) socket */ + kfree_skb(skb); + return 0; } +#endif + + 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