diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2023-12-08 01:31:34 +1100 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2023-12-27 19:29:45 +0100 |
commit | 546332786cee921213fc59db6207be23c2d70208 (patch) | |
tree | 40631707f45da1f97d524fdd845f9c29f3477f9a /tcp_splice.c | |
parent | 1f2aab8aaaa5f3a5d1bd712173187c92986f753b (diff) | |
download | passt-546332786cee921213fc59db6207be23c2d70208.tar passt-546332786cee921213fc59db6207be23c2d70208.tar.gz passt-546332786cee921213fc59db6207be23c2d70208.tar.bz2 passt-546332786cee921213fc59db6207be23c2d70208.tar.lz passt-546332786cee921213fc59db6207be23c2d70208.tar.xz passt-546332786cee921213fc59db6207be23c2d70208.tar.zst passt-546332786cee921213fc59db6207be23c2d70208.zip |
treewide: Use IN4ADDR_LOOPBACK_INIT more widely
We already define IN4ADDR_LOOPBACK_INIT to initialise a struct in_addr to
the loopback address without delving into its internals. However there are
some places we don't use it, and explicitly look at the internal structure
of struct in_addr, which we generally want to avoid. Use the define more
widely to avoid that.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'tcp_splice.c')
-rw-r--r-- | tcp_splice.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tcp_splice.c b/tcp_splice.c index 69ea79d..1655f8e 100644 --- a/tcp_splice.c +++ b/tcp_splice.c @@ -347,7 +347,7 @@ static int tcp_splice_connect(const struct ctx *c, struct tcp_splice_conn *conn, struct sockaddr_in addr4 = { .sin_family = AF_INET, .sin_port = htons(port), - .sin_addr = { .s_addr = htonl(INADDR_LOOPBACK) }, + .sin_addr = IN4ADDR_LOOPBACK_INIT, }; const struct sockaddr *sa; socklen_t sl; |