From nobody Wed Jan 03 18:32:54 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T4yyH0gthz56R72; Wed, 3 Jan 2024 18:32:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4T4yyH03QBz423S; Wed, 3 Jan 2024 18:32:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704306775; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tR1F3cS7QqbJDa+o7P/Ppxie6OxzkYdl7k9Jet6wLHc=; b=cA1nqLL7F90ra8uA6gY67/DchAwKBhHwv5sdwhy3w3zbYI3tIaBM0Pqk+p5plh8hEtzJo2 +YSwamQtbEiNbb6hLiqootqCOsVHsyS2elj8LW1eSVbMT1xcXxWTQYo+09syVXnRsQ85eq mNbpgPY5azK2SQYeZWbIWxTTWHfOSRS52xrSKbnwisrmttZZjZnKYkfjL8npvmg8/WotjO Yo6h1DtJRFaBMZbzUkCN1s2ickYQQHDVItelU86H/S+MDFEKm0D2FmT4yi1LHbjnUPSiwC NWDtb4LG3Ptd1YGVpi5Tt8i0BEvfw/oqLIqeCf0xopai04eposvML4tvLsOsqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704306775; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tR1F3cS7QqbJDa+o7P/Ppxie6OxzkYdl7k9Jet6wLHc=; b=mhLdcZzfE/saTRJRQvaJqxTWAVTuuWVS1MEXX4lZhluuf6fLylJrC6xWcbG1eOV7SsAol3 IHPbmkRZ/AP8QF2a472KFfHKB9ZWinfO+t0AP9tsHIH1KU6mm+WmUHExGbZPTOdURF4nOA xyQQBHBRCswb8gIFavYtFAiMCxFVun3fWuo1HI84nJq61Nque+u9DQ9/6EWsPp5jf6n4n3 ZC5tVnYYCgoamdggymYnvW7S7ltzxHDS6DIScxKC5MfiGoWo5BzCFhfnyE0O+W/68CbF1J gCK3wPmobJfSCQwGNzN9rd12Uy/Dj9GUML84EMvE3GVxv1q6aeCi8zb/9MiHQA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704306775; a=rsa-sha256; cv=none; b=AZH0YObeUUduBIxJjTh/XgR1L06szJYFuC1HIPHM1xh3SdRUFZ+V9WKT+B8vs1BQzyPrQp /hxLTc100AUdfOZOFtrje2EjUU2me1wwGdjisbwQpxYmTTWknxTVegLLDoXJpFCYkzl1wN 9ReU4o8e6RsGsg0jXnmslAxNfLHxNMs+R5z8BJ/Os29e6PmFxANTJPN6V0UfgTtvm8+eUl yZRer9mC3SPqQkpNtM3M9U3Oo7AdiRjfCoYA6egazHFySVIlzDHWyOTvI5baNKzVqpMnxL GiBifVOxTDkXrOGS2fegsNBNy4W/+3YPk7tqijl19JvEKn7DEH/oqnh1sRPCAg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4T4yyG6Gm6zwhG; Wed, 3 Jan 2024 18:32:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 403IWsDJ018827; Wed, 3 Jan 2024 18:32:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 403IWsuZ018824; Wed, 3 Jan 2024 18:32:54 GMT (envelope-from git) Date: Wed, 3 Jan 2024 18:32:54 GMT Message-Id: <202401031832.403IWsuZ018824@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 777e494a7634 - main - traceroute6: style(9) fixes List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 777e494a7634bbdd8ab0cf403ae22a464669d804 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=777e494a7634bbdd8ab0cf403ae22a464669d804 commit 777e494a7634bbdd8ab0cf403ae22a464669d804 Author: Jose Luis Duran AuthorDate: 2023-10-27 23:53:44 +0000 Commit: Mark Johnston CommitDate: 2024-01-03 17:54:53 +0000 traceroute6: style(9) fixes No functional change intended. Reviewed by: imp, markj MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/879 --- usr.sbin/traceroute6/traceroute6.c | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/usr.sbin/traceroute6/traceroute6.c b/usr.sbin/traceroute6/traceroute6.c index c6f7279691de..925020546f27 100644 --- a/usr.sbin/traceroute6/traceroute6.c +++ b/usr.sbin/traceroute6/traceroute6.c @@ -330,7 +330,7 @@ static u_long nprobes = 3; static u_long first_hop = 1; static u_long max_hops = 30; static u_int16_t srcport; -static u_int16_t port = 32768+666; /* start udp dest port # for probe packets */ +static u_int16_t port = 32768 + 666; /* start udp dest port # for probe packets */ static u_int16_t ident; static int tclass = -1; static int options; /* socket options */ @@ -373,7 +373,7 @@ main(int argc, char *argv[]) } size = sizeof(i); - (void) sysctl(mib, sizeof(mib)/sizeof(mib[0]), &i, &size, NULL, 0); + (void) sysctl(mib, sizeof(mib) / sizeof(mib[0]), &i, &size, NULL, 0); max_hops = i; /* specify to tell receiving interface */ @@ -681,7 +681,7 @@ main(int argc, char *argv[]) exit(1); } if ((useproto == IPPROTO_SCTP) && (datalen & 3)) { - fprintf(stderr, + fprintf(stderr, "traceroute6: packet size must be a multiple of 4.\n"); exit(1); } @@ -1042,7 +1042,7 @@ wait_for_reply(int sock, struct msghdr *mhdr) FD_SET(sock, fdsp); wait.tv_sec = waittime; wait.tv_usec = 0; - if (select(sock+1, fdsp, (fd_set *)0, (fd_set *)0, &wait) > 0) + if (select(sock + 1, fdsp, (fd_set *)0, (fd_set *)0, &wait) > 0) cc = recvmsg(rcvsock, mhdr, 0); free(fdsp); @@ -1059,14 +1059,14 @@ setpolicy(int so, char *policy) buf = ipsec_set_policy(policy, strlen(policy)); if (buf == NULL) { warnx("%s", ipsec_strerror()); - return -1; + return (-1); } (void)setsockopt(so, IPPROTO_IPV6, IPV6_IPSEC_POLICY, buf, ipsec_get_policylen(buf)); free(buf); - return 0; + return (0); } #endif @@ -1103,7 +1103,7 @@ send_probe(int seq, u_long hops) case IPPROTO_UDP: outudp = (struct udphdr *) outpacket; outudp->uh_sport = htons(ident); - outudp->uh_dport = htons(port+seq); + outudp->uh_dport = htons(port + seq); outudp->uh_ulen = htons(datalen); outudp->uh_sum = 0; outudp->uh_sum = udp_cksum(&Src, &Dst, outpacket, datalen); @@ -1193,7 +1193,7 @@ send_probe(int seq, u_long hops) fprintf(stderr, "Unknown probe protocol %d.\n", useproto); exit(1); } - + i = send(sndsock, (char *)outpacket, datalen, 0); if (i < 0 || (u_long)i != datalen) { if (i < 0) @@ -1286,7 +1286,7 @@ pr_type(int t0) cp = "Unknown"; break; } - return cp; + return (cp); } int @@ -1354,8 +1354,7 @@ packet_ok(struct msghdr *mhdr, int cc, int seq, u_char *type, u_char *code) #else rcvhlim = 0; /*XXX*/ #endif - } - else + } else rcvhlim = *hlimp; *type = icp->icmp6_type; @@ -1440,7 +1439,7 @@ packet_ok(struct msghdr *mhdr, int cc, int seq, u_char *type, u_char *code) return (1); } if (verbose) { - char sbuf[NI_MAXHOST+1], dbuf[INET6_ADDRSTRLEN]; + char sbuf[NI_MAXHOST + 1], dbuf[INET6_ADDRSTRLEN]; u_int8_t *p; int i; @@ -1602,19 +1601,19 @@ inetname(struct sockaddr *sa) } } if (cp) - return cp; + return (cp); if (cap_getnameinfo(capdns, sa, sa->sa_len, line, sizeof(line), NULL, 0, NI_NUMERICHOST) != 0) strlcpy(line, "invalid", sizeof(line)); - return line; + return (line); } /* * CRC32C routine for the Stream Control Transmission Protocol */ -#define CRC32C(c, d) (c = (c>>8) ^ crc_c[(c^(d))&0xFF]) +#define CRC32C(c, d) (c = (c >> 8) ^ crc_c[(c ^ (d)) & 0xFF]) static u_int32_t crc_c[256] = { 0x00000000, 0xF26B8303, 0xE13B70F7, 0x1350F3F4, @@ -1695,11 +1694,11 @@ sctp_crc32c(void *pack, u_int32_t len) CRC32C(crc32c, buf[i]); crc32c = ~crc32c; byte0 = crc32c & 0xff; - byte1 = (crc32c>>8) & 0xff; - byte2 = (crc32c>>16) & 0xff; - byte3 = (crc32c>>24) & 0xff; + byte1 = (crc32c >> 8) & 0xff; + byte2 = (crc32c >> 16) & 0xff; + byte3 = (crc32c >> 24) & 0xff; crc32c = ((byte0 << 24) | (byte1 << 16) | (byte2 << 8) | byte3); - return htonl(crc32c); + return (htonl(crc32c)); } u_int16_t