Revision: 418
          http://vde.svn.sourceforge.net/vde/?rev=418&view=rev
Author:   rd235
Date:     2010-06-02 16:34:13 +0000 (Wed, 02 Jun 2010)

Log Message:
-----------
intrface grab disabled if bridge is loaded

Modified Paths:
--------------
    trunk/ipn/ipn_netdev.c

Modified: trunk/ipn/ipn_netdev.c
===================================================================
--- trunk/ipn/ipn_netdev.c      2010-06-02 15:48:21 UTC (rev 417)
+++ trunk/ipn/ipn_netdev.c      2010-06-02 16:34:13 UTC (rev 418)
@@ -161,6 +161,13 @@
                        random_ether_addr(dev->dev_addr);
                        break;
                case IPN_NODEFLAG_GRAB:
+#ifdef IPN_STEALING
+                       /* only if bridge is not working */
+                       if (ipn_handle_frame_hook != (void *) ipn_handle_hook) {
+                               printk (KERN_WARNING "IPN interface GRAB 
disabled (stealing mode) if bridge is loaded\n");
+                               return NULL;
+                       }
+#endif
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24)
                        dev=dev_get_by_name(name);
 #else
@@ -306,16 +313,25 @@
 
 int ipn_netdev_init(void)
 {
-       ipn_handle_frame_hook=
 #ifdef IPN_STEALING
-               (void *)
+       if (ipn_handle_frame_hook != NULL) 
+               printk (KERN_WARNING "IPN interface GRAB disabled (stealing 
mode) if bridge is loaded\n");
+       else
 #endif
-               ipn_handle_hook;
+               ipn_handle_frame_hook=
+#ifdef IPN_STEALING
+                       (void *)
+#endif
+                       ipn_handle_hook;
 
        return 0;
 }
 
 void ipn_netdev_fini(void)
 {
-       ipn_handle_frame_hook=NULL;
+#ifdef IPN_STEALING
+       /* only if bridge is not working */
+       if (ipn_handle_frame_hook == (void *) ipn_handle_hook)
+#endif
+               ipn_handle_frame_hook=NULL;
 }


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------

_______________________________________________
vde-users mailing list
vde-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vde-users

Reply via email to