aboutsummaryrefslogtreecommitdiff
path: root/lib/stream-tcp.c
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2012-12-12 15:26:21 -0800
committerBen Pfaff <blp@nicira.com>2012-12-12 15:26:21 -0800
commited36537ebf48108accf21a8aa073279eceeafa98 (patch)
treee5e11cd63c50f7fe16437609d72914502ee29aad /lib/stream-tcp.c
parent401d5a6d16438ceb2e09c19677b97504593b4b51 (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/stream-tcp.c')
-rw-r--r--lib/stream-tcp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/stream-tcp.c b/lib/stream-tcp.c
index 05601e19..0384c42f 100644
--- a/lib/stream-tcp.c
+++ b/lib/stream-tcp.c
@@ -116,7 +116,7 @@ ptcp_open(const char *name OVS_UNUSED, char *suffix, struct pstream **pstreamp,
}
sprintf(bound_name, "ptcp:%"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));
return new_fd_pstream(bound_name, fd, ptcp_accept, set_dscp, NULL,
pstreamp);
}
@@ -129,7 +129,7 @@ ptcp_accept(int fd, const struct sockaddr *sa, size_t sa_len,
char name[128];
if (sa_len == sizeof(struct sockaddr_in) && sin->sin_family == AF_INET) {
- sprintf(name, "tcp:"IP_FMT, IP_ARGS(&sin->sin_addr));
+ sprintf(name, "tcp:"IP_FMT, IP_ARGS(sin->sin_addr.s_addr));
sprintf(strchr(name, '\0'), ":%"PRIu16, ntohs(sin->sin_port));
} else {
strcpy(name, "tcp");