diff options
author | Jan Synacek <jsynacek@redhat.com> | 2017-02-22 10:29:33 +0100 |
---|---|---|
committer | Pavel Šimerda <pavlix@pavlix.net> | 2017-03-01 11:10:19 +0100 |
commit | 0f19d38958603f396d1248e097d9866a7a692aec (patch) | |
tree | 306e840f915d6106af0f8024b81714cd4e2b55e3 | |
parent | 6ec6b9bf0a46de04fca431e956cb0e4625bc1733 (diff) | |
download | iputils-0f19d38958603f396d1248e097d9866a7a692aec.tar.gz |
fix multicast setsockopt calls on big endian
Originally reported at https://bugzilla.redhat.com/show_bug.cgi?id=1373333.
-rw-r--r-- | ping.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -850,14 +850,14 @@ int ping4_run(int argc, char **argv, struct addrinfo *ai, socket_st *sock) if (options & F_NOLOOP) { int loop = 0; - if (setsockopt(sock->fd, IPPROTO_IP, IP_MULTICAST_LOOP, &loop, 1) == -1) { + if (setsockopt(sock->fd, IPPROTO_IP, IP_MULTICAST_LOOP, &loop, sizeof loop) == -1) { perror ("ping: can't disable multicast loopback"); exit(2); } } if (options & F_TTL) { int ittl = ttl; - if (setsockopt(sock->fd, IPPROTO_IP, IP_MULTICAST_TTL, &ttl, 1) == -1) { + if (setsockopt(sock->fd, IPPROTO_IP, IP_MULTICAST_TTL, &ttl, sizeof ttl) == -1) { perror ("ping: can't set multicast time-to-live"); exit(2); } |