]> git.proxmox.com Git - mirror_ovs.git/commitdiff
datapath-windows: Move OVS_IPHELPER_INSTANCE to IpHelper.h
authorSairam Venugopal <vsairam@vmware.com>
Wed, 26 Sep 2018 20:34:24 +0000 (13:34 -0700)
committerAlin Gabriel Serdean <aserdean@ovn.org>
Tue, 2 Oct 2018 14:45:51 +0000 (17:45 +0300)
Move the IPHelper Instance to the main header file and update the usage to
explicitly point to POVS_IPHELPER_INSTANCE instead of PVOID. Also rename
the ipn->context to ipn->instance to make it more readable.

Found by inspection.

Signed-off-by: Sairam Venugopal <vsairam@vmware.com>
Acked-by: Alin Gabriel Serdean <aserdean@ovn.org>
Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
datapath-windows/ovsext/IpHelper.c
datapath-windows/ovsext/IpHelper.h

index c734b0ecc2e2577404dd3c2331ad8dfd9c57f652..876da9225476fd9cc5a61a867c32e752fc4d43f2 100644 (file)
@@ -39,34 +39,6 @@ static LIST_ENTRY          ovsInstanceList;
 /* Passive-level lock used to protect the internal adapter object list. */
 static ERESOURCE           ovsInstanceListLock;
 
-/*
- * This structure is used to define each adapter instance.
- *
- * Note:
- * Only when the internal IP is configured and virtual
- * internal port is connected, the IP helper request can be
- * queued.
- *
- * We only keep internal IP for reference, it will not be used for determining
- * SRC IP of the Tunnel.
- *
- * The lock must not raise the IRQL higher than PASSIVE_LEVEL in order for the
- * route manipulation functions, i.e. GetBestRoute, to work.
- */
-typedef struct _OVS_IPHELPER_INSTANCE
-{
-    LIST_ENTRY          link;
-
-    BOOLEAN             isIpConfigured;
-    UINT32              portNo;
-    GUID                netCfgId;
-    MIB_IF_ROW2         internalRow;
-    MIB_IPINTERFACE_ROW internalIPRow;
-    UINT32              ipAddress;
-
-    ERESOURCE           lock;
-} OVS_IPHELPER_INSTANCE, *POVS_IPHELPER_INSTANCE;
-
 /*
  * FWD_ENTRY -------->  IPFORWARD_ENTRY
  *      |
@@ -1070,7 +1042,7 @@ OvsCreateIPNeighEntry(PMIB_IPNET_ROW2 ipNeigh,
     RtlCopyMemory(entry->macAddr, ipNeigh->PhysicalAddress,
                   ETH_ADDR_LEN);
     InitializeListHead(&entry->fwdList);
-    entry->context = (PVOID)instance;
+    entry->instance = instance;
 
     return entry;
 }
@@ -1934,7 +1906,7 @@ OvsStartIpHelper(PVOID data)
             ipAddr = ipn->ipAddr;
             MIB_IPNET_ROW2 ipNeigh;
             NTSTATUS status;
-            POVS_IPHELPER_INSTANCE instance = (POVS_IPHELPER_INSTANCE)ipn->context;
+            POVS_IPHELPER_INSTANCE instance = ipn->instance;
             NdisReleaseSpinLock(&ovsIpHelperLock);
             ExAcquireResourceExclusiveLite(&ovsInstanceListLock, TRUE);
 
index 0556965cca5abe487db0dc450f2101e6e830b876..25adf6ea2036617e33c28837990d62ac5e51bf99 100644 (file)
 
 #define OVS_IPNEIGH_TIMEOUT 100000000   // 10 s
 
+ /*
+ * This structure is used to define each adapter instance.
+ *
+ * Note:
+ * Only when the internal IP is configured and virtual
+ * internal port is connected, the IP helper request can be
+ * queued.
+ *
+ * We only keep internal IP for reference, it will not be used for determining
+ * SRC IP of the Tunnel.
+ *
+ * The lock must not raise the IRQL higher than PASSIVE_LEVEL in order for the
+ * route manipulation functions, i.e. GetBestRoute, to work.
+ */
+typedef struct _OVS_IPHELPER_INSTANCE
+{
+    LIST_ENTRY          link;
+
+    BOOLEAN             isIpConfigured;
+    UINT32              portNo;
+    GUID                netCfgId;
+    MIB_IF_ROW2         internalRow;
+    MIB_IPINTERFACE_ROW internalIPRow;
+    UINT32              ipAddress;
+
+    ERESOURCE           lock;
+} OVS_IPHELPER_INSTANCE, *POVS_IPHELPER_INSTANCE;
 
 typedef struct _OVS_IPNEIGH_ENTRY {
-    UINT8             macAddr[ETH_ADDR_LEN];
-    UINT16            refCount;
-    UINT32            ipAddr;
-    UINT32            pad;
-    UINT64            timeout;
-    LIST_ENTRY        link;
-    LIST_ENTRY        slink;
-    LIST_ENTRY        fwdList;
-    PVOID             context;
+    UINT8                       macAddr[ETH_ADDR_LEN];
+    UINT16                      refCount;
+    UINT32                      ipAddr;
+    UINT32                      pad;
+    UINT64                      timeout;
+    LIST_ENTRY                  link;
+    LIST_ENTRY                  slink;
+    LIST_ENTRY                  fwdList;
+    POVS_IPHELPER_INSTANCE      instance;
 } OVS_IPNEIGH_ENTRY, *POVS_IPNEIGH_ENTRY;
 
 typedef struct _OVS_IPFORWARD_ENTRY {