For SNAT, don't store the pre-fragment L2 header before actions are applied.
[sliver-openvswitch.git] / lib / dpif.c
index b04439f..6407490 100644 (file)
@@ -44,8 +44,8 @@
 #include "netlink.h"
 #include "netlink-protocol.h"
 #include "ofpbuf.h"
-#include "openflow-netlink.h"
-#include "openflow.h"
+#include "openflow/openflow-netlink.h"
+#include "openflow/openflow.h"
 #include "packets.h"
 #include "util.h"
 #include "xtoxll.h"
@@ -103,14 +103,16 @@ dpif_open(int dp_idx, bool subscribe, struct dpif *dp)
 void
 dpif_close(struct dpif *dp) 
 {
-    nl_sock_destroy(dp->sock);
+    if (dp) {
+        nl_sock_destroy(dp->sock);
+    }
 }
 
 static const struct nl_policy openflow_policy[] = {
     [DP_GENL_A_DP_IDX] = { .type = NL_A_U32 },
     [DP_GENL_A_OPENFLOW] = { .type = NL_A_UNSPEC,
                               .min_len = sizeof(struct ofp_header),
-                              .max_len = OFP_MAXLEN },
+                              .max_len = 65535 },
 };
 
 /* Tries to receive an openflow message from the kernel on 'sock'.  If