diff options
author | Ankur Sharma <ankursharma@vmware.com> | 2014-09-26 17:32:49 -0700 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2014-09-29 09:03:42 -0700 |
commit | 5b2249547f91337ca1e5150ed9dbd2d9af58165b (patch) | |
tree | f4b255d2823f419282be4f9a0cc0df9932e43e42 /datapath-windows/ovsext/Datapath.c | |
parent | 91b95f8b930f34d344a60396e59f7e96e04c2888 (diff) | |
download | openvswitch-5b2249547f91337ca1e5150ed9dbd2d9af58165b.tar.gz |
datapath-windows/Netlink: Fixed NlAttrParseNested
NlAttrParseNested was using the whole netlink payload for iteration.
This is not correct, as it would lead to exceeding the
nested attribute boundries. Fixed the same in this patch.
Signed-off-by: Ankur Sharma <ankursharma@vmware.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Eitan Eliahu <eliahue@vmware.com>
Acked-by: Nithin Raju <nithin@vmware.com>
Acked-by: Samuel Ghinet <sghinet@cloudbasesolutions.com>
Tested-by: Ankur Sharma <ankursharma@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'datapath-windows/ovsext/Datapath.c')
-rw-r--r-- | datapath-windows/ovsext/Datapath.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/datapath-windows/ovsext/Datapath.c b/datapath-windows/ovsext/Datapath.c index 3be383564..6319542b6 100644 --- a/datapath-windows/ovsext/Datapath.c +++ b/datapath-windows/ovsext/Datapath.c @@ -990,7 +990,8 @@ OvsSubscribeEventCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx, (POVS_OPEN_INSTANCE)usrParamsCtx->ovsInstance; POVS_MESSAGE msgIn = (POVS_MESSAGE)usrParamsCtx->inputBuffer; - rc = NlAttrParse(&msgIn->nlMsg, sizeof (*msgIn),policy, attrs, 2); + rc = NlAttrParse(&msgIn->nlMsg, sizeof (*msgIn), + NlMsgAttrsLen((PNL_MSG_HDR)msgIn), policy, attrs, 2); if (!rc) { status = STATUS_INVALID_PARAMETER; goto done; @@ -1148,6 +1149,7 @@ HandleDpTransaction(POVS_USER_PARAMS_CONTEXT usrParamsCtx, if (usrParamsCtx->ovsMsg->genlMsg.cmd == OVS_DP_CMD_SET) { if (!NlAttrParse((PNL_MSG_HDR)msgIn, NLMSG_HDRLEN + GENL_HDRLEN + OVS_HDRLEN, + NlMsgAttrsLen((PNL_MSG_HDR)msgIn), ovsDatapathSetPolicy, dpAttrs, ARRAY_SIZE(dpAttrs))) { return STATUS_INVALID_PARAMETER; } |