- merge revision 1.8
authorMark Huang <mlhuang@cs.princeton.edu>
Fri, 4 Mar 2005 14:07:20 +0000 (14:07 +0000)
committerMark Huang <mlhuang@cs.princeton.edu>
Fri, 4 Mar 2005 14:07:20 +0000 (14:07 +0000)
date: 2005/02/01 03:27:07;  author: mlhuang;  state: Exp;  lines: +11 -3
- bound vnet mods by #ifdef
- bound runtime vnet code by if (vnet_active)
- vnet needs packet_ops and packet_family_ops, export them if configured

net/packet/af_packet.c

index 844a087..a285c01 100644 (file)
@@ -5,7 +5,7 @@
  *
  *             PACKET - implements raw packet sockets.
  *
- * Version:    $Id: af_packet.c,v 1.61 2002/02/08 03:57:19 davem Exp $
+ * Version:    $Id$
  *
  * Authors:    Ross Biro, <bir7@leland.Stanford.Edu>
  *             Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
@@ -451,8 +451,11 @@ static int packet_rcv(struct sk_buff *skb, struct net_device *dev,  struct packe
        sk = pt->af_packet_priv;
        po = pkt_sk(sk);
 
-       if ((int) sk->sk_xid > 0 && sk->sk_xid != skb->xid)
+#if defined(CONFIG_VNET) || defined(CONFIG_VNET_MODULE)
+       if (vnet_active &&
+           (int) sk->sk_xid > 0 && sk->sk_xid != skb->xid)
                goto drop;
+#endif
 
        skb->dev = dev;
 
@@ -1792,14 +1795,19 @@ struct proto_ops packet_ops = {
        .mmap =         packet_mmap,
        .sendpage =     sock_no_sendpage,
 };
-EXPORT_SYMBOL(packet_ops);
 
+#if defined(CONFIG_VNET) || defined(CONFIG_VNET_MODULE)
+EXPORT_SYMBOL(packet_ops);
+struct net_proto_family packet_family_ops;
+EXPORT_SYMBOL(packet_family_ops);
+#else
+static
+#endif
 struct net_proto_family packet_family_ops = {
        .family =       PF_PACKET,
        .create =       packet_create,
        .owner  =       THIS_MODULE,
 };
-EXPORT_SYMBOL(packet_family_ops);
 
 static struct notifier_block packet_netdev_notifier = {
        .notifier_call =packet_notifier,