2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 14:25:26 +00:00

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>
This commit is contained in:
Ben Pfaff
2012-12-12 15:26:21 -08:00
parent 401d5a6d16
commit ed36537ebf
13 changed files with 30 additions and 34 deletions

View File

@@ -805,7 +805,7 @@ pssl_open(const char *name OVS_UNUSED, char *suffix, struct pstream **pstreamp,
return -fd;
}
sprintf(bound_name, "pssl:%"PRIu16":"IP_FMT,
ntohs(sin.sin_port), IP_ARGS(&sin.sin_addr.s_addr));
ntohs(sin.sin_port), IP_ARGS(sin.sin_addr.s_addr));
pssl = xmalloc(sizeof *pssl);
pstream_init(&pssl->pstream, &pssl_pstream_class, bound_name);
@@ -847,7 +847,7 @@ pssl_accept(struct pstream *pstream, struct stream **new_streamp)
return error;
}
sprintf(name, "ssl:"IP_FMT, IP_ARGS(&sin.sin_addr));
sprintf(name, "ssl:"IP_FMT, IP_ARGS(sin.sin_addr.s_addr));
if (sin.sin_port != htons(OFP_SSL_PORT)) {
sprintf(strchr(name, '\0'), ":%"PRIu16, ntohs(sin.sin_port));
}