It can happen that ovs key attributes are not in keyAttrs of port.
In this case the call of NlAttrGetU32 will cause a BSOD in Release builds.

Signed-off-by: Frank Wagner <[email protected]>

---
 datapath-windows/ovsext/User.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/datapath-windows/ovsext/User.c b/datapath-windows/ovsext/User.c
index c4563b28b..b52124abf 100644
--- a/datapath-windows/ovsext/User.c
+++ b/datapath-windows/ovsext/User.c
@@ -407,7 +407,9 @@ _MapNlAttrToOvsPktExec(PNL_MSG_HDR nlMsgHdr, PNL_ATTR 
*nlAttrs,
     execute->actionsLen = NlAttrGetSize(nlAttrs[OVS_PACKET_ATTR_ACTIONS]);
 
     ASSERT(keyAttrs[OVS_KEY_ATTR_IN_PORT]);
-    execute->inPort = NlAttrGetU32(keyAttrs[OVS_KEY_ATTR_IN_PORT]);
+    if (keyAttrs[OVS_KEY_ATTR_IN_PORT]) {
+        execute->inPort = NlAttrGetU32(keyAttrs[OVS_KEY_ATTR_IN_PORT]);
+    }
     execute->keyAttrs = keyAttrs;
 
     if (nlAttrs[OVS_PACKET_ATTR_MRU]) {
-- 
2.48.1

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to