network/ping: remove workarounds for connect()
Change-Id: I42829566a0f449f1a46f029aaff577efb30ef79b Reviewed-on: https://review.haiku-os.org/c/haiku/+/7477 Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This commit is contained in:
parent
e4efd92e78
commit
b3a7feb168
@ -633,11 +633,8 @@ ping(int argc, char *const *argv)
|
||||
err(1, "unable to limit access to system.dns service");
|
||||
}
|
||||
#endif
|
||||
#ifndef __HAIKU__
|
||||
// unsupported on Haiku
|
||||
if (connect(ssend, (struct sockaddr *)&whereto, sizeof(whereto)) != 0)
|
||||
err(1, "connect");
|
||||
#endif
|
||||
|
||||
if (options & F_FLOOD && options & F_INTERVAL)
|
||||
errx(EX_USAGE, "-f and -i: incompatible options");
|
||||
@ -1102,12 +1099,7 @@ pinger(void)
|
||||
sizeof(ip.ip_sum));
|
||||
packet = outpackhdr;
|
||||
}
|
||||
#ifndef __HAIKU__
|
||||
i = send(ssend, (char *)packet, cc, 0);
|
||||
#else
|
||||
i = sendto(ssend, (char *)packet, cc, 0, &whereto,
|
||||
sizeof(struct sockaddr));
|
||||
#endif
|
||||
if (i < 0 || i != cc) {
|
||||
if (i < 0) {
|
||||
if (options & F_FLOOD && errno == ENOBUFS) {
|
||||
|
@ -1059,11 +1059,8 @@ ping6(int argc, char *argv[])
|
||||
if (usepktinfo)
|
||||
memcpy(cmsg_pktinfo, &pktinfo, sizeof(pktinfo));
|
||||
|
||||
#ifndef __HAIKU__
|
||||
// unsupported on Haiku
|
||||
if (connect(ssend, (struct sockaddr *)&dst, sizeof(dst)) != 0)
|
||||
err(1, "connect() ssend");
|
||||
#endif
|
||||
|
||||
#ifndef __HAIKU__
|
||||
caph_cache_catpages();
|
||||
@ -1436,10 +1433,6 @@ pinger(void)
|
||||
errx(1, "internal error; length mismatch");
|
||||
#endif
|
||||
|
||||
#ifdef __HAIKU__
|
||||
smsghdr.msg_name = (caddr_t)&dst;
|
||||
smsghdr.msg_namelen = sizeof(dst);
|
||||
#endif
|
||||
memset(&iov, 0, sizeof(iov));
|
||||
iov[0].iov_base = (caddr_t)outpack;
|
||||
iov[0].iov_len = cc;
|
||||
|
Loading…
x
Reference in New Issue
Block a user