Avoid the following warning caused by the combination
of NetBSD's htons implementation and gcc bug.
Now --enable-Werror build succeeds on NetBSD-6.
lib/ofp-util.c: In function 'ofputil_match_from_ofp10_match':
lib/ofp-util.c:174:15: error: integer overflow in expression
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
match->wc.masks.vlan_tci = htons(0xffff);
} else {
ovs_be16 vid, pcp, tci;
+ uint16_t hpcp;
vid = ofmatch->dl_vlan & htons(VLAN_VID_MASK);
- pcp = htons((ofmatch->dl_vlan_pcp << VLAN_PCP_SHIFT) & VLAN_PCP_MASK);
+ hpcp = (ofmatch->dl_vlan_pcp << VLAN_PCP_SHIFT) & VLAN_PCP_MASK;
+ pcp = htons(hpcp);
tci = vid | pcp | htons(VLAN_CFI);
match->flow.vlan_tci = tci & match->wc.masks.vlan_tci;
}