diff options
author | Nithin Raju <nithin@vmware.com> | 2014-09-19 14:30:52 -0700 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2014-09-19 14:36:51 -0700 |
commit | db8823415f79d09297843558d4a3f962d1937b3c (patch) | |
tree | ce03b1c0d0166e3e4907e982a85cf5ca508175e0 /datapath-windows/ovsext/Netlink | |
parent | 95c9bfd45cbcbfbba8c004a3227656e46fe3d872 (diff) | |
download | openvswitch-db8823415f79d09297843558d4a3f962d1937b3c.tar.gz |
datapath-windows: return TRUE on success in NlAttrValidate
Signed-off-by: Nithin Raju <nithin@vmware.com>
Acked-by: Samuel Ghinet <sghinet@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'datapath-windows/ovsext/Netlink')
-rw-r--r-- | datapath-windows/ovsext/Netlink/Netlink.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/datapath-windows/ovsext/Netlink/Netlink.c b/datapath-windows/ovsext/Netlink/Netlink.c index 1ceb5e3ca..c286c2fb3 100644 --- a/datapath-windows/ovsext/Netlink/Netlink.c +++ b/datapath-windows/ovsext/Netlink/Netlink.c @@ -806,12 +806,12 @@ NlAttrValidate(const PNL_ATTR nla, const PNL_POLICY policy) UINT32 minLen; UINT32 maxLen; UINT32 len; - BOOLEAN ret = FALSE; + BOOLEAN ret = TRUE; if ((policy->type == NL_A_NO_ATTR) || (policy->type == NL_A_VAR_LEN)) { /* Do not validate anything for attributes of type var length */ - ret = TRUE; + ret = FALSE; goto done; } @@ -830,6 +830,7 @@ NlAttrValidate(const PNL_ATTR nla, const PNL_POLICY policy) if (len < minLen || len > maxLen) { OVS_LOG_WARN("Attribute: %p, len: %d, not in valid range, " "min: %d, max: %d", nla, len, minLen, maxLen); + ret = FALSE; goto done; } @@ -837,11 +838,13 @@ NlAttrValidate(const PNL_ATTR nla, const PNL_POLICY policy) if (policy->type == NL_A_STRING) { if (((PCHAR) nla)[nla->nlaLen - 1]) { OVS_LOG_WARN("Attributes %p lacks null at the end", nla); + ret = FALSE; goto done; } if (memchr(nla + 1, '\0', len - 1) != NULL) { OVS_LOG_WARN("Attributes %p has bad length", nla); + ret = FALSE; goto done; } } |