From nobody Thu Jan 11 14:32:29 2024 X-Original-To: dev-commits-src-all@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 4T9nF943Hgz567wc; Thu, 11 Jan 2024 14:32:29 +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 4T9nF91QCMz4Svk; Thu, 11 Jan 2024 14:32:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704983549; 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=a6KY2BecZJxLhKMgn5X8tTxU+hqXYk14jT/wSXZ2lWM=; b=w+Eoo3Qp3gaCN5Fo8EglDtO8JNG4f8QyyvDik2QhUOTpofI3clM5XzRW6Ypgx/APH9T7p9 CtNUayrtPvvQfdCKXQsYb6IOkelU3EgH2X665SCD0YtsuqzRI8BT9tv+prK8OmewPiI98l 0/rani7aiUOXBEGEkHt65LNLUycm1FUQy88ehPRK11SgvSj+rUel+LT2R+McQBl7c1RSBz 12Ks/izl/dHiS5MAJvZ4orVn2w6PHQL0lxerY/g73/dwHWBk34dlGE+imw1GqUo7srTq9/ gBG6ON8eQt3OGO1yHdlIbjQ0p15bKrG9eQE6YeNAo1VNIEy/WHbIGdFT3xGsFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704983549; 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=a6KY2BecZJxLhKMgn5X8tTxU+hqXYk14jT/wSXZ2lWM=; b=QFFoR55YqaiWSIPfhmBKYnWiBFDFgVVu0n0porqXYMw0T7JI5GLSRfJcdto7euEzoM3V6H 2sN9TTtSZ4G/9w9r4SCWudoChIhfPuogGstmBGf4A6abLNxPgJwxEH2wg3rviR+HWyifGg vx6EC/w6APycmtWu8evtHag5VbT/dR+uzlPTL3i16TZB0px3mzdhGN76Bb+d+Xn/MugQZI UqAq9HO/Rqiz8hAPz+3JzylEbY9qwN0a4s04/xZfqVuIkY52UXi6akC4+kyjAMI0hug56p 6FXmvh1yOT9i/21yLdeagkGHtR2GdZVTxoWGl0QNjyeWAk2EoE7y4zvSZikDgw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704983549; a=rsa-sha256; cv=none; b=JdLGZ2O4qW4PbKBV5JyE6vq9qklqaf4QvtRzE2t9hknse5nCk8pfMuhBJUyvrCc355atAL SBFzu9hnexFkzmIAoDR3IEpJ3MQ9AgKAKNe4OlRjveZn7dfWx+S1oQafduY97F1QTIIpl0 nhXKozey1Om0nj8Ki+4207B3M8/O7wJKJD2gdWBxMeVrR1aPqaOZ+9gveWY13Ny+CFPGlm UjVSNQYT10CNN7hfXPZ3Q7nr42Iar5/g9FmD7a2QHqXlbPoFHknFxccA7f7raLPNS1Dj2z GgKQYONDOxgqOGgCvPdGnaiLUkUqg1kC54NIv5ALYi56bBU4nYjv9kz2PF9MGg== 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 4T9nF90RjYzMpv; Thu, 11 Jan 2024 14:32:29 +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 40BEWTTi023921; Thu, 11 Jan 2024 14:32:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40BEWTUc023918; Thu, 11 Jan 2024 14:32:29 GMT (envelope-from git) Date: Thu, 11 Jan 2024 14:32:29 GMT Message-Id: <202401111432.40BEWTUc023918@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: df50b9998cb4 - stable/14 - traceroute6: style(9) fixes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/stable/14 X-Git-Reftype: branch X-Git-Commit: df50b9998cb4ad3abffeb056ab92a4614dd38ae8 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=df50b9998cb4ad3abffeb056ab92a4614dd38ae8 commit df50b9998cb4ad3abffeb056ab92a4614dd38ae8 Author: Jose Luis Duran AuthorDate: 2023-10-27 23:53:44 +0000 Commit: Mark Johnston CommitDate: 2024-01-11 14:18:12 +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 (cherry picked from commit 777e494a7634bbdd8ab0cf403ae22a464669d804) --- 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 cf1c12c5962c..7907952e9328 100644 --- a/usr.sbin/traceroute6/traceroute6.c +++ b/usr.sbin/traceroute6/traceroute6.c @@ -342,7 +342,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 */ @@ -385,7 +385,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 */ @@ -693,7 +693,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); } @@ -1054,7 +1054,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); @@ -1071,14 +1071,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 @@ -1115,7 +1115,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); @@ -1205,7 +1205,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) @@ -1298,7 +1298,7 @@ pr_type(int t0) cp = "Unknown"; break; } - return cp; + return (cp); } int @@ -1366,8 +1366,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; @@ -1452,7 +1451,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; @@ -1614,19 +1613,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, @@ -1707,11 +1706,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