From: Jesse Gross Date: Sun, 12 Dec 2010 06:51:31 +0000 (-0800) Subject: vswitchd: Consistently use size_t for action lengths. X-Git-Tag: v1.1.0~643 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=cf22f8cba328c0fb47a7e6811563f773fc232904;p=sliver-openvswitch.git vswitchd: Consistently use size_t for action lengths. Currently the type of the datapath action length is mixture of size_t and unsigned int. However, size_t is really defined as an unsigned long, which causes the build to fail on 64-bit platforms. This consistently uses size_t. --- diff --git a/lib/dpif-linux.c b/lib/dpif-linux.c index 6aa333557..870e03e21 100644 --- a/lib/dpif-linux.c +++ b/lib/dpif-linux.c @@ -392,7 +392,7 @@ dpif_linux_flow_list(const struct dpif *dpif_, struct odp_flow flows[], int n) static int dpif_linux_execute(struct dpif *dpif_, - const struct nlattr *actions, unsigned int actions_len, + const struct nlattr *actions, size_t actions_len, const struct ofpbuf *buf) { struct odp_execute execute; diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index 29f3cc98c..74cd0cac1 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -109,7 +109,7 @@ struct dp_netdev_flow { /* Actions. */ struct nlattr *actions; - unsigned int actions_len; + size_t actions_len; }; /* Interface to netdev-based datapath. */ @@ -142,7 +142,7 @@ static int dp_netdev_output_control(struct dp_netdev *, const struct ofpbuf *, static int dp_netdev_execute_actions(struct dp_netdev *, struct ofpbuf *, struct flow *, const struct nlattr *actions, - unsigned int actions_len); + size_t actions_len); static struct dpif_class dpif_dummy_class; @@ -621,7 +621,7 @@ dpif_netdev_flow_get(const struct dpif *dpif, struct odp_flow flows[], int n) static int dpif_netdev_validate_actions(const struct nlattr *actions, - unsigned int actions_len, bool *mutates) + size_t actions_len, bool *mutates) { const struct nlattr *a; unsigned int left; @@ -801,7 +801,7 @@ dpif_netdev_flow_list(const struct dpif *dpif, struct odp_flow flows[], int n) static int dpif_netdev_execute(struct dpif *dpif, - const struct nlattr *actions, unsigned int actions_len, + const struct nlattr *actions, size_t actions_len, const struct ofpbuf *packet) { struct dp_netdev *dp = get_dp_netdev(dpif); @@ -1197,7 +1197,7 @@ static int dp_netdev_execute_actions(struct dp_netdev *dp, struct ofpbuf *packet, struct flow *key, const struct nlattr *actions, - unsigned int actions_len) + size_t actions_len) { const struct nlattr *a; unsigned int left; diff --git a/lib/dpif.c b/lib/dpif.c index d4d9b3401..a0f638af7 100644 --- a/lib/dpif.c +++ b/lib/dpif.c @@ -1132,7 +1132,7 @@ static void log_flow_message(const struct dpif *dpif, int error, const char *operation, const struct odp_flow_key *flow, const struct odp_flow_stats *stats, - const struct nlattr *actions, unsigned int actions_len) + const struct nlattr *actions, size_t actions_len) { struct ds ds = DS_EMPTY_INITIALIZER; ds_put_format(&ds, "%s: ", dpif_name(dpif)); diff --git a/lib/odp-util.c b/lib/odp-util.c index dd6b6295b..91320c458 100644 --- a/lib/odp-util.c +++ b/lib/odp-util.c @@ -171,7 +171,7 @@ format_odp_action(struct ds *ds, const struct nlattr *a) void format_odp_actions(struct ds *ds, const struct nlattr *actions, - unsigned int actions_len) + size_t actions_len) { if (actions_len) { const struct nlattr *a; diff --git a/ofproto/in-band.c b/ofproto/in-band.c index 9655f105c..6623aca0b 100644 --- a/ofproto/in-band.c +++ b/ofproto/in-band.c @@ -429,7 +429,7 @@ in_band_msg_in_hook(struct in_band *in_band, const struct flow *flow, * allowed to be set up in the datapath. */ bool in_band_rule_check(struct in_band *in_band, const struct flow *flow, - const struct nlattr *actions, unsigned int actions_len) + const struct nlattr *actions, size_t actions_len) { if (!in_band) { return true; diff --git a/ofproto/in-band.h b/ofproto/in-band.h index 972acaa8f..d90dc8576 100644 --- a/ofproto/in-band.h +++ b/ofproto/in-band.h @@ -41,7 +41,7 @@ bool in_band_msg_in_hook(struct in_band *, const struct flow *, const struct ofpbuf *packet); bool in_band_rule_check(struct in_band *, const struct flow *, const struct nlattr *odp_actions, - unsigned int actions_len); + size_t actions_len); void in_band_flushed(struct in_band *); #endif /* in-band.h */ diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index 255df6534..c7f211ae3 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -225,7 +225,7 @@ struct facet { bool installed; /* Installed in datapath? */ bool may_install; /* True ordinarily; false if actions must * be reassessed for every packet. */ - unsigned int actions_len; /* Number of bytes in actions[]. */ + size_t actions_len; /* Number of bytes in actions[]. */ struct nlattr *actions; /* Datapath actions. */ tag_type tags; /* Tags (set only by hooks). */ struct netflow_flow nf_flow; /* Per-flow NetFlow tracking data. */ @@ -2050,7 +2050,7 @@ rule_has_out_port(const struct rule *rule, ovs_be16 out_port) * Takes ownership of 'packet'. */ static bool execute_odp_actions(struct ofproto *ofproto, uint16_t in_port, - const struct nlattr *odp_actions, unsigned int actions_len, + const struct nlattr *odp_actions, size_t actions_len, struct ofpbuf *packet) { if (actions_len == NLA_ALIGN(NLA_HDRLEN + sizeof(uint64_t)) diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index 8ade873fa..6691746f1 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -2719,7 +2719,7 @@ bridge_normal_ofhook_cb(const struct flow *flow, const struct ofpbuf *packet, static void bridge_account_flow_ofhook_cb(const struct flow *flow, tag_type tags, const struct nlattr *actions, - unsigned int actions_len, + size_t actions_len, unsigned long long int n_bytes, void *br_) { struct bridge *br = br_;