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