Merge setsockopt error messages

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2015-08-24 19:08:14 +02:00
parent 729b70646c
commit 2db782bc7b
3 changed files with 6 additions and 6 deletions

View File

@ -358,7 +358,7 @@ int arping_main(int argc UNUSED_PARAM, char **argv)
saddr.sin_addr = dst; saddr.sin_addr = dst;
if (setsockopt(probe_fd, SOL_SOCKET, SO_DONTROUTE, &const_int_1, sizeof(const_int_1)) == -1) if (setsockopt(probe_fd, SOL_SOCKET, SO_DONTROUTE, &const_int_1, sizeof(const_int_1)) == -1)
bb_perror_msg("setsockopt(SO_DONTROUTE)"); bb_perror_msg("setsockopt(%s)", "SO_DONTROUTE");
xconnect(probe_fd, (struct sockaddr *) &saddr, sizeof(saddr)); xconnect(probe_fd, (struct sockaddr *) &saddr, sizeof(saddr));
getsockname(probe_fd, (struct sockaddr *) &saddr, &alen); getsockname(probe_fd, (struct sockaddr *) &saddr, &alen);
//never happens: //never happens:

View File

@ -756,7 +756,7 @@ static void ping6(len_and_sockaddr *lsa)
} }
if (setsockopt(pingsock, IPPROTO_ICMPV6, ICMP6_FILTER, &filt, if (setsockopt(pingsock, IPPROTO_ICMPV6, ICMP6_FILTER, &filt,
sizeof(filt)) < 0) sizeof(filt)) < 0)
bb_error_msg_and_die("setsockopt(ICMP6_FILTER)"); bb_error_msg_and_die("setsockopt(%s)", "ICMP6_FILTER");
} }
#endif /*ICMP6_FILTER*/ #endif /*ICMP6_FILTER*/

View File

@ -475,7 +475,7 @@ send_probe(int seq, int ttl)
if (dest_lsa->u.sa.sa_family == AF_INET6) { if (dest_lsa->u.sa.sa_family == AF_INET6) {
res = setsockopt(sndsock, SOL_IPV6, IPV6_UNICAST_HOPS, &ttl, sizeof(ttl)); res = setsockopt(sndsock, SOL_IPV6, IPV6_UNICAST_HOPS, &ttl, sizeof(ttl));
if (res < 0) if (res < 0)
bb_perror_msg_and_die("setsockopt UNICAST_HOPS %d", ttl); bb_perror_msg_and_die("setsockopt(%s) %d", "UNICAST_HOPS", ttl);
out = outip; out = outip;
len = packlen; len = packlen;
} else } else
@ -484,7 +484,7 @@ send_probe(int seq, int ttl)
#if defined IP_TTL #if defined IP_TTL
res = setsockopt(sndsock, IPPROTO_IP, IP_TTL, &ttl, sizeof(ttl)); res = setsockopt(sndsock, IPPROTO_IP, IP_TTL, &ttl, sizeof(ttl));
if (res < 0) if (res < 0)
bb_perror_msg_and_die("setsockopt ttl %d", ttl); bb_perror_msg_and_die("setsockopt(%s) %d", "TTL", ttl);
#endif #endif
out = outicmp; out = outicmp;
len = packlen - sizeof(*outip); len = packlen - sizeof(*outip);
@ -929,7 +929,7 @@ common_traceroute_main(int op, char **argv)
if (af == AF_INET6) { if (af == AF_INET6) {
static const int two = 2; static const int two = 2;
if (setsockopt(rcvsock, SOL_RAW, IPV6_CHECKSUM, &two, sizeof(two)) < 0) if (setsockopt(rcvsock, SOL_RAW, IPV6_CHECKSUM, &two, sizeof(two)) < 0)
bb_perror_msg_and_die("setsockopt RAW_CHECKSUM"); bb_perror_msg_and_die("setsockopt(%s)", "IPV6_CHECKSUM");
xmove_fd(xsocket(af, SOCK_DGRAM, 0), sndsock); xmove_fd(xsocket(af, SOCK_DGRAM, 0), sndsock);
} else } else
#endif #endif
@ -972,7 +972,7 @@ common_traceroute_main(int op, char **argv)
#endif #endif
#ifdef IP_TOS #ifdef IP_TOS
if ((op & OPT_TOS) && setsockopt(sndsock, IPPROTO_IP, IP_TOS, &tos, sizeof(tos)) < 0) { if ((op & OPT_TOS) && setsockopt(sndsock, IPPROTO_IP, IP_TOS, &tos, sizeof(tos)) < 0) {
bb_perror_msg_and_die("setsockopt tos %d", tos); bb_perror_msg_and_die("setsockopt(%s) %d", "TOS", tos);
} }
#endif #endif
#ifdef IP_DONTFRAG #ifdef IP_DONTFRAG