- merge revision 1.10
authorMark Huang <mlhuang@cs.princeton.edu>
Fri, 4 Mar 2005 13:57:24 +0000 (13:57 +0000)
committerMark Huang <mlhuang@cs.princeton.edu>
Fri, 4 Mar 2005 13:57:24 +0000 (13:57 +0000)
date: 2005/02/10 19:39:16;  author: mlhuang;  state: Exp;  lines: +1 -1
- check vnet_active before executing runtime vnet code

net/ipv4/icmp.c

index e75fde6..78754b6 100644 (file)
@@ -3,7 +3,7 @@
  *
  *             Alan Cox, <alan@redhat.com>
  *
- *     Version: $Id: icmp.c,v 1.85 2002/02/01 22:01:03 davem Exp $
+ *     Version: $Id$
  *
  *     This program is free software; you can redistribute it and/or
  *     modify it under the terms of the GNU General Public License
@@ -1035,8 +1035,9 @@ int icmp_rcv(struct sk_buff *skb)
                }
        }
 
+#if defined(CONFIG_VNET) || defined(CONFIG_VNET_MODULE)
        /* VNET: Bypass stack if the echo ID was bound to a (presumably raw) socket */
-       if (skb->sk) {
+       if (vnet_active && skb->sk) {
                switch (icmph->type) {
                case ICMP_ECHOREPLY:
                case ICMP_ECHO:
@@ -1049,6 +1050,7 @@ int icmp_rcv(struct sk_buff *skb)
                        goto drop;
                }
        }
+#endif
 
        ICMP_INC_STATS_BH(icmp_pointers[icmph->type].input_entry);
        icmp_pointers[icmph->type].handler(skb);