In current code, the odp_execute_actions() function does not check
the value of "userspace" function pointer before invoking it.  This
patch adds a check for it.

Signed-off-by: Alex Wang <[email protected]>
---
 lib/odp-execute.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/odp-execute.c b/lib/odp-execute.c
index 185cf31..19fcc1c 100644
--- a/lib/odp-execute.c
+++ b/lib/odp-execute.c
@@ -200,7 +200,9 @@ odp_execute_actions(void *dp, struct ofpbuf *packet, struct 
flow *key,
             break;
 
         case OVS_ACTION_ATTR_USERSPACE: {
-            userspace(dp, packet, key, a);
+            if (userspace) {
+                userspace(dp, packet, key, a);
+            }
             break;
         }
 
-- 
1.7.9.5

_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev

Reply via email to