From nobody Wed Jan 03 18:32:55 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 4T4yyJ2857z56R76; Wed, 3 Jan 2024 18:32:56 +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 4T4yyJ15DMz423W; Wed, 3 Jan 2024 18:32:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704306776; 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=1WwGef5gynCIc+ISwNBv3nYp1qn07oHoOm2ROzTAGDs=; b=fqYZ9lQv1FaBZXIvhv/r6BKYUROxdMNQg/2/WUePw3dwDpnV4ar++Q7rH29cHvG6xJX2p+ JTwkV3XuIk9XxabHXeicpT8RCvpScHEQdFSlvfTRyxYnX6x+g1tnVUfz0i2msTG0/ikKeu xMDKsrI24No5XVxsilJ9mfVB2Nq5QYI4Prk41t1R80MCInmiCktR2NMfqw8peLCFjC9grb mcdEjbRc/28rQ2yIEGAHcBCNKFzG/SLv4QjrlrXmzy42srfCXMgMKmD4QL7XMcHFq5PWr6 m3o/xXWQD7+aGYXxqX1i5K26s8KJsea68ioFLFIRmGsaarkOgPYb46QEehDKng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704306776; 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=1WwGef5gynCIc+ISwNBv3nYp1qn07oHoOm2ROzTAGDs=; b=XE3KNxRx4Vq0SPgYtlF4mTe+BLl4MuxnKuaVrCNX9Ja8nbbPvBBC7PaOk9G1GUUGDFCIvt uQ62wGxb7GBngErx45JRyAwVAtm/RO5NiSMsKHCs5W2OTq/pUuGva/8/AnEUqJfdDcNk0F VbKel1aB0u1+3FirGcWRy9S42SjkHCIq4WRnu1+Vm74GZWYSuLtOLQ9hDGc38BApODYyT3 DJa9RTFpJ6+RSYIgeWKUWwvcLilO4hBqYN8X1LKfczgz/qWUDlj7EZVuxD3ZrXEXH7bzyR nBi8VGIXI9uBrLBGA0iT4I5Dy05vkUL23HRUz8rXpaHhlflcR6y4mCXH6ML+mA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704306776; a=rsa-sha256; cv=none; b=hT3OxLPPfSjoelDyHZa87QTUKY/njLvs4FcTb9u2zzgFJ3QFQ5+iHu6sTvVew3X7iS1wF4 Leu5GVRBwHdRdIloRwgp4GMeCpC27Ei0T+VHAWJmcyzg/82K0q7vI5XlgjmEPAKtPsGtxU L7KICTZLFhhVSIDfFn2Y4Jea1gZnw9Sys7mmMFvEbjgDJd1H2FS08Rb/3Flc3yRTMXxv0N Qvpc8r6/Xt8FeZJlfksE7OfusT9DDTPCTK32E+h5ENixNhpFsaEbazRP6vdJZREKPxA0xZ 9hPt2EqBd2phyxJcCp2DQeFiRbfQwIzsdOO0lWLXnrMxFMBJt5ry3o6rqb/ifw== 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 4T4yyJ07RTzvp6; Wed, 3 Jan 2024 18:32:56 +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 403IWtdR018863; Wed, 3 Jan 2024 18:32:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 403IWtuB018860; Wed, 3 Jan 2024 18:32:55 GMT (envelope-from git) Date: Wed, 3 Jan 2024 18:32:55 GMT Message-Id: <202401031832.403IWtuB018860@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: 943a9f4e470c - main - traceroute: 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: 943a9f4e470c3d45e4e93e3c91449b8c369c27ab Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=943a9f4e470c3d45e4e93e3c91449b8c369c27ab commit 943a9f4e470c3d45e4e93e3c91449b8c369c27ab Author: Jose Luis Duran AuthorDate: 2023-10-28 00:13:19 +0000 Commit: Mark Johnston CommitDate: 2024-01-03 17:56:10 +0000 traceroute: 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 --- contrib/traceroute/traceroute.c | 55 +++++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/contrib/traceroute/traceroute.c b/contrib/traceroute/traceroute.c index 38fd812b17f6..282d4b2af929 100644 --- a/contrib/traceroute/traceroute.c +++ b/contrib/traceroute/traceroute.c @@ -539,7 +539,7 @@ main(int argc, char **argv) exit(1); } /* - * Do the setuid-required stuff first, then lose priveleges ASAP. + * Do the setuid-required stuff first, then lose privileges ASAP. * Do error checking for these two calls where they appeared in * the original code. */ @@ -762,7 +762,7 @@ main(int argc, char **argv) } #ifdef HAVE_SETLINEBUF - setlinebuf (stdout); + setlinebuf(stdout); #else setvbuf(stdout, NULL, _IOLBF, 0); #endif @@ -988,7 +988,7 @@ main(int argc, char **argv) if (bind(sndsock, (struct sockaddr *)from, sizeof(*from)) < 0) { Fprintf(stderr, "%s: bind: %s\n", prog, strerror(errno)); - exit (1); + exit(1); } if (as_path) { @@ -1104,7 +1104,8 @@ main(int argc, char **argv) continue; if (!gotlastaddr || from->sin_addr.s_addr != lastaddr) { - if (gotlastaddr) printf("\n "); + if (gotlastaddr) + printf("\n "); print(packet, cc, from); lastaddr = from->sin_addr.s_addr; ++gotlastaddr; @@ -1292,7 +1293,7 @@ wait_for_reply(register int sock, register struct sockaddr_in *fromp, (struct sockaddr *)fromp, &fromlen); free(fdsp); - return(cc); + return (cc); } void @@ -1354,14 +1355,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_IP, IP_IPSEC_POLICY, buf, ipsec_get_policylen(buf)); free(buf); - return 0; + return (0); } #endif @@ -1390,9 +1391,9 @@ pr_type(register u_char t) }; if (t > 16) - return("OUT-OF-RANGE"); + return ("OUT-OF-RANGE"); - return(ttab[t]); + return (ttab[t]); } int @@ -1433,7 +1434,7 @@ packet_ok(register u_char *buf, int cc, register struct sockaddr_in *from, if (type == ICMP_ECHOREPLY && proto->num == IPPROTO_ICMP && (*proto->check)((u_char *)icp, (u_char)seq)) - return -2; + return (-2); if ((type == ICMP_TIMXCEED && code == ICMP_TIMXCEED_INTRANS) || type == ICMP_UNREACH) { u_char *inner; @@ -1459,7 +1460,7 @@ packet_ok(register u_char *buf, int cc, register struct sockaddr_in *from, Printf("%2d: %8.8x\n", i, ntohl(*lp++)); } #endif - return(0); + return (0); } void @@ -1495,7 +1496,7 @@ udp_prep(struct outdata *outdata) outudp->uh_ulen = htons((u_short)protlen); outudp->uh_sum = 0; if (doipcksum) { - u_short sum = p_cksum(outip, (u_short*)outudp, protlen, protlen); + u_short sum = p_cksum(outip, (u_short *)outudp, protlen, protlen); outudp->uh_sum = (sum) ? sum : 0xffff; } @@ -1521,7 +1522,7 @@ udplite_prep(struct outdata *outdata) outudp->uh_ulen = htons(8); outudp->uh_sum = 0; if (doipcksum) { - u_short sum = p_cksum(outip, (u_short*)outudp, protlen, 8); + u_short sum = p_cksum(outip, (u_short *)outudp, protlen, 8); outudp->uh_sum = (sum) ? sum : 0xffff; } @@ -1551,7 +1552,7 @@ tcp_prep(struct outdata *outdata) tcp->th_sum = 0; if (doipcksum) - tcp->th_sum = p_cksum(outip, (u_short*)tcp, protlen, protlen); + tcp->th_sum = p_cksum(outip, (u_short *)tcp, protlen, protlen); } int @@ -1676,7 +1677,7 @@ gre_check(const u_char *data, int seq) { struct grehdr *const gre = (struct grehdr *) data; - return(ntohs(gre->proto) == port + return (ntohs(gre->proto) == port && ntohs(gre->callId) == ident + seq); } @@ -1694,7 +1695,7 @@ gen_check(const u_char *data, int seq) { u_int16_t *const ptr = (u_int16_t *) data; - return(ntohs(ptr[0]) == ident + return (ntohs(ptr[0]) == ident && ntohs(ptr[1]) == port + seq); } @@ -1720,7 +1721,7 @@ print(register u_char *buf, register int cc, register struct sockaddr_in *from) Printf(" %s (%s)", inetname(from->sin_addr), addr); if (verbose) - Printf(" %d bytes to %s", cc, inet_ntoa (ip->ip_dst)); + Printf(" %d bytes to %s", cc, inet_ntoa(ip->ip_dst)); } /* @@ -1737,10 +1738,10 @@ p_cksum(struct ip *ip, u_short *data, int len, int cov) ipo.ih_src = ip->ip_src; ipo.ih_dst = ip->ip_dst; - sum[1] = in_cksum((u_short*)&ipo, sizeof(ipo)); /* pseudo ip hdr cksum */ - sum[0] = in_cksum(data, cov); /* payload data cksum */ + sum[1] = in_cksum((u_short *)&ipo, sizeof(ipo)); /* pseudo ip hdr cksum */ + sum[0] = in_cksum(data, cov); /* payload data cksum */ - return ~in_cksum(sum, sizeof(sum)); + return (~in_cksum(sum, sizeof(sum))); } /* @@ -1782,7 +1783,7 @@ in_cksum(register u_short *addr, register int len) * 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, @@ -1863,11 +1864,11 @@ sctp_crc32c(const void *packet, 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)); } /* @@ -2052,7 +2053,7 @@ str2val(register const char *str, register const char *what, } else val = (int)strtol(str, &ep, 10); if (*ep != '\0') { - Fprintf(stderr, "%s: \"%s\" bad value for %s \n", + Fprintf(stderr, "%s: \"%s\" bad value for %s\n", prog, str, what); exit(1); } @@ -2095,7 +2096,7 @@ setproto(char *pname) pnum = str2val(optarg, "proto number", 1, 255); proto->num = pnum; } - return proto; + return (proto); } void