Revision: 416
http://vde.svn.sourceforge.net/vde/?rev=416&view=rev
Author: rd235
Date: 2010-06-02 15:16:14 +0000 (Wed, 02 Jun 2010)
Log Message:
-----------
arp return msg management. netif_rx_ni to solve (I hope) a race cond.
Modified Paths:
--------------
trunk/ipn/af_ipn.c
trunk/ipn/ipn_netdev.c
Modified: trunk/ipn/af_ipn.c
===================================================================
--- trunk/ipn/af_ipn.c 2010-06-01 11:17:44 UTC (rev 415)
+++ trunk/ipn/af_ipn.c 2010-06-02 15:16:14 UTC (rev 416)
@@ -1314,12 +1314,19 @@
{
struct ipn_network *ipnn=from->ipn;
int err=0;
- if (down_interruptible(&ipnn->ipnn_mutex))
+ static int recinject=0;
+ //printk("INJECTMSG IN\n");
+ if (recinject)
+ ipn_protocol_table[ipnn->protocol]->ipn_p_handlemsg(from, msg);
+ else if (down_interruptible(&ipnn->ipnn_mutex))
err=-ERESTARTSYS;
else {
+ recinject=1;
ipn_protocol_table[ipnn->protocol]->ipn_p_handlemsg(from, msg);
+ recinject=0;
up(&ipnn->ipnn_mutex);
}
+ //printk("INJECTMSG OUT %d\n",err);
return err;
}
Modified: trunk/ipn/ipn_netdev.c
===================================================================
--- trunk/ipn/ipn_netdev.c 2010-06-01 11:17:44 UTC (rev 415)
+++ trunk/ipn/ipn_netdev.c 2010-06-02 15:16:14 UTC (rev 416)
@@ -36,8 +36,8 @@
#define DRV_NAME "ipn"
#define DRV_VERSION "0.3.1"
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
-#define IPN_PRE2630
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)
+#define IPN_PRE2629
#endif
static const struct ethtool_ops ipn_ethtool_ops;
@@ -115,9 +115,18 @@
return (skb);
}
+#ifndef IPN_PRE2629
+static struct net_device_ops ipntap_netdev_ops = {
+ .ndo_open = ipntap_net_open,
+ .ndo_start_xmit = ipn_net_xmit,
+ .ndo_stop = ipntap_net_close,
+ .ndo_get_stats = ipntap_net_stats
+};
+#endif
+
static void ipntap_setup(struct net_device *dev)
{
-#ifdef IPN_PRE2630
+#ifdef IPN_PRE2629
dev->open = ipntap_net_open;
dev->hard_start_xmit = ipn_net_xmit;
dev->stop = ipntap_net_close;
@@ -126,15 +135,6 @@
dev->ethtool_ops = &ipn_ethtool_ops;
}
-#ifndef IPN_PRE2630
-static struct net_device_ops ipntap_netdev_ops = {
- .ndo_open = ipntap_net_open,
- .ndo_start_xmit = ipn_net_xmit,
- .ndo_stop = ipntap_net_close,
- .ndo_get_stats = ipntap_net_stats
-};
-#endif
-
struct net_device *ipn_netdev_alloc(struct net *net,int type, char *name, int
*err)
{
struct net_device *dev=NULL;
@@ -146,7 +146,7 @@
dev=alloc_netdev(sizeof(struct ipntap), name,
ipntap_setup);
if (!dev)
*err= -ENOMEM;
-#ifndef IPN_PRE2630
+#ifndef IPN_PRE2629
dev_net_set(dev, net);
dev->netdev_ops = &ipntap_netdev_ops;
#endif
@@ -258,7 +258,7 @@
switch (to->flags & IPN_NODEFLAG_DEVMASK) {
case IPN_NODEFLAG_TAP:
skb->protocol = eth_type_trans(skb, dev);
- netif_rx(skb);
+ netif_rx_ni(skb);
ipntap->stats.rx_packets++;
ipntap->stats.rx_bytes += msg->len;
break;
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
_______________________________________________
vde-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/vde-users