summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarrell Ball <dlu998@gmail.com>2017-03-19 10:11:09 -0700
committerBen Pfaff <blp@ovn.org>2017-04-14 21:16:27 -0700
commit6b6b508b8354a7b599c983ec61651c2f1ee0a269 (patch)
tree24af9c8bfed9ba334b3638a134db0cb447741a68
parent88cbc2dde9859ca4ae1594c4aee2d53b548edbe1 (diff)
downloadopenvswitch-6b6b508b8354a7b599c983ec61651c2f1ee0a269.tar.gz
ovs build: Fix memset with zero size warning.
In file included from /usr/include/string.h:640:0, from ./lib/string.h:20, from /usr/include/netinet/icmp6.h:22, from ../lib/flow.h:21, from ../lib/flow.c:18: In function 'memset', inlined from 'flow_push_vlan_uninit' at ../lib/flow.c:2188:19: /usr/include/x86_64-linux-gnu/bits/string3.h:81:30: error: call to '__warn_memset_zero_len' declared with attribute warning: memset used with constant zero length parameter; this could be due to transposed parameters [-Werror] __warn_memset_zero_len (); ^ cc1: all warnings being treated as errors make[2]: *** [lib/flow.lo] Error 1 Fixes: f0fb825a3785 ("Add support for 802.1ad (QinQ tunneling)") Signed-off-by: Darrell Ball <dlu998@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
-rw-r--r--lib/flow.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/flow.c b/lib/flow.c
index 9b84b19f5..2b1ec4fed 100644
--- a/lib/flow.c
+++ b/lib/flow.c
@@ -2222,7 +2222,9 @@ flow_push_vlan_uninit(struct flow *flow, struct flow_wildcards *wc)
{
if (wc) {
int n = flow_count_vlan_headers(flow);
- memset(wc->masks.vlans, 0xff, sizeof(union flow_vlan_hdr) * n);
+ if (n) {
+ memset(wc->masks.vlans, 0xff, sizeof(union flow_vlan_hdr) * n);
+ }
}
memmove(&flow->vlans[1], &flow->vlans[0],
sizeof(union flow_vlan_hdr) * (FLOW_MAX_VLAN_HEADERS - 1));