From: Ben Pfaff Date: Fri, 9 Jan 2009 00:35:47 +0000 (-0800) Subject: Use a uint16_t variable to store a 16-bit value, not an int. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9566d4d89487ab0e0ab6791035fa25c11a3cb9db;p=openvswitch Use a uint16_t variable to store a 16-bit value, not an int. This is a style issue, not a bug, because the int only ever held values in the range 0...UINT16_MAX. Found by Chris Eagle via Fortify. --- diff --git a/datapath/dp_act.c b/datapath/dp_act.c index 3b5086f6..56104506 100644 --- a/datapath/dp_act.c +++ b/datapath/dp_act.c @@ -311,7 +311,7 @@ static uint16_t validate_ofpat(struct datapath *dp, const struct sw_flow_key *key, const struct ofp_action_header *ah, uint16_t type, uint16_t len) { - int ret = ACT_VALIDATION_OK; + uint16_t ret = ACT_VALIDATION_OK; const struct openflow_action *act = &of_actions[type]; if ((len < act->min_size) || (len > act->max_size)) diff --git a/udatapath/dp_act.c b/udatapath/dp_act.c index fc800f00..8579b10a 100644 --- a/udatapath/dp_act.c +++ b/udatapath/dp_act.c @@ -300,7 +300,7 @@ static uint16_t validate_ofpat(struct datapath *dp, const struct sw_flow_key *key, const struct ofp_action_header *ah, uint16_t type, uint16_t len) { - int ret = ACT_VALIDATION_OK; + uint16_t ret = ACT_VALIDATION_OK; const struct openflow_action *act = &of_actions[type]; if ((len < act->min_size) || (len > act->max_size)) {