diff options
author | Ben Pfaff <blp@nicira.com> | 2012-12-12 15:26:21 -0800 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2012-12-12 15:26:21 -0800 |
commit | ed36537ebf48108accf21a8aa073279eceeafa98 (patch) | |
tree | e5e11cd63c50f7fe16437609d72914502ee29aad /lib/packets.c | |
parent | 401d5a6d16438ceb2e09c19677b97504593b4b51 (diff) |
packets: Change IP_ARGS interface to take an ovs_be32 instead of a pointer.
An ovs_be32 is a more obvious way to represent an IP address than a
pointer to one. It is also more type-safe, especially since "sparse" is
able to check that the argument is in network byte order.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
Diffstat (limited to 'lib/packets.c')
-rw-r--r-- | lib/packets.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/packets.c b/lib/packets.c index fa73b50a..812d1af9 100644 --- a/lib/packets.c +++ b/lib/packets.c @@ -273,12 +273,12 @@ ip_count_cidr_bits(ovs_be32 netmask) void ip_format_masked(ovs_be32 ip, ovs_be32 mask, struct ds *s) { - ds_put_format(s, IP_FMT, IP_ARGS(&ip)); + ds_put_format(s, IP_FMT, IP_ARGS(ip)); if (mask != htonl(UINT32_MAX)) { if (ip_is_cidr(mask)) { ds_put_format(s, "/%d", ip_count_cidr_bits(mask)); } else { - ds_put_format(s, "/"IP_FMT, IP_ARGS(&mask)); + ds_put_format(s, "/"IP_FMT, IP_ARGS(mask)); } } } |