Hi Nithin,
Is there any place where we check  nla->nlaLen that is larger  NLA_HDRLEN? We 
need to add this to the NL attr validation.
I'm not sure what happens if NlAttrGetSize retirns with 0 or -1 :-)
Perhaps we want to add minimal for OVS_VPORT_ATTR_NAME so NlAttrValidate will 
catch it.
Thanks,
Eitan

-----Original Message-----
From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Nithin Raju
Sent: Thursday, September 25, 2014 6:06 PM
To: dev@openvswitch.org; sghi...@cloudbasesolutions.com
Subject: [ovs-dev] [PATCH] datapath-windows: NUL character should be left out 
during VPORT hash lookup

While calculating the hash on a VPORT name, we don't include the NUL character.
We should be doing the same while doing lookup as well.

Signed-off-by: Nithin Raju <nit...@vmware.com>
---
 datapath-windows/ovsext/Datapath.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/datapath-windows/ovsext/Datapath.c 
b/datapath-windows/ovsext/Datapath.c
index 495219e..65b4b81 100644
--- a/datapath-windows/ovsext/Datapath.c
+++ b/datapath-windows/ovsext/Datapath.c
@@ -1468,7 +1468,7 @@ OvsGetVport(POVS_USER_PARAMS_CONTEXT usrParamsCtx,
     if (vportAttrs[OVS_VPORT_ATTR_NAME] != NULL) {
         vport = OvsFindVportByOvsName(gOvsSwitchContext,
             NlAttrGet(vportAttrs[OVS_VPORT_ATTR_NAME]),
-            NlAttrGetSize(vportAttrs[OVS_VPORT_ATTR_NAME]));
+            NlAttrGetSize(vportAttrs[OVS_VPORT_ATTR_NAME]) - 1);
     } else if (vportAttrs[OVS_VPORT_ATTR_PORT_NO] != NULL) {
         vport = OvsFindVportByPortNo(gOvsSwitchContext,
             NlAttrGetU32(vportAttrs[OVS_VPORT_ATTR_PORT_NO]));
-- 
1.7.4.1

_______________________________________________
dev mailing list
dev@openvswitch.org
https://urldefense.proofpoint.com/v1/url?u=http://openvswitch.org/mailman/listinfo/dev&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=yTvML8OxA42Jb6ViHe7fUXbvPVOYDPVq87w43doxtlY%3D%0A&m=%2BkJD%2FEWLzKFo4R4q7%2FPtH3NX5UGaAORGKdEZv5dFv7o%3D%0A&s=7119548f78f6e8cd37698cce4496d975955f2e1d36bdca8549dfb0d72154da68
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to