From 69e524a3764326d5253c03ad3499e9678f3868c0 Mon Sep 17 00:00:00 2001 From: Mark Huang Date: Fri, 4 Mar 2005 14:07:20 +0000 Subject: [PATCH] - merge revision 1.8 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 | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index 844a087b0..a285c0112 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c @@ -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, * Fred N. van Kempen, @@ -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, -- 2.47.0