From nobody Wed Dec 01 17:10:06 2021 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 BB48C18CB1E4; Wed, 1 Dec 2021 17:10:07 +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 4J45Dt5kQVz4dVJ; Wed, 1 Dec 2021 17:10:06 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 53095584B; Wed, 1 Dec 2021 17:10:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B1HA6cd016372; Wed, 1 Dec 2021 17:10:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B1HA6No016369; Wed, 1 Dec 2021 17:10:06 GMT (envelope-from git) Date: Wed, 1 Dec 2021 17:10:06 GMT Message-Id: <202112011710.1B1HA6No016369@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 9684452504f9 - stable/12 - if_stf: style(9) pass 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: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 9684452504f94d197eefcd1f2e24ac4d03922d4b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638378606; 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=rGdcXA54NecUalGbpPK+Yu8L0T/WmiFu0QQhvIXlCnE=; b=Vs9YAIz5j9DJ5XnuLAFr4VlCm2Mo/QMrvi8XoZE4jVdJ7wKXorsNmkPIzUv8JK9ZRZQPlW V4TmCBlwmwCroFoujgEq7pur96KccGn3i1N6IROBWJhclGRuP9BlPqNT5H7CJcrMhvFYn/ z+T14DHuc3w0q+GPAm/albQGgtkKyQBDOnPl+khXGtn+0kzJ5b8a/9T62DPHzHECBJXDXo o7sby4OAqpDvz08JvQoJFgY7JssgKq09tFKo+ImcmVYki/G10SEeuQTurK3kNV4OUyvrSp pImBQdkoqg6mPPOItsb1GHBaB0vQZPmHgEENpaWTXCUDa9drDO8vcaXKQxN2Ow== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638378606; a=rsa-sha256; cv=none; b=TALlLhLOsBhMJndyAMVebGy1oHloP9frIYG74bv5qH7iY685eWuTHSksXmd0jYll+sTwrn 6ZPkMSP0OeqoT/rivVr6uZ9oT1dY1Y7Ncm3lxNnDa0OaWlp0DFLXmUtPzJ9DnmfYSmqVBW rCaPAD1vvTL0gxL0VSte0ikLIuCv1j3c7rTqBMjzUsfPeyYzUbCdeBuP3p5+kfegr46Cum BJ+vwNDXKYoErjx9GhP4RUQvLeqGBkHNTpZzg9eTO/NKYFg+xwPRvC7u0dUApozWEPZVJB UCmdzsq56rCPqllgSAVPW2kO/k5GzELn/Rg0q8qo5E+6dIQF2uXJnhFbHC5+8w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=9684452504f94d197eefcd1f2e24ac4d03922d4b commit 9684452504f94d197eefcd1f2e24ac4d03922d4b Author: Kristof Provost AuthorDate: 2021-11-05 10:20:16 +0000 Commit: Kristof Provost CommitDate: 2021-11-30 07:41:28 +0000 if_stf: style(9) pass As stated in style(9): "Values in return statements should be enclosed in parentheses." MFC after: 3 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D32848 (cherry picked from commit 3576121c8b1fcaa31b3a45ea52ff83f7c5855266) --- sys/net/if_stf.c | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/sys/net/if_stf.c b/sys/net/if_stf.c index f9abe4c6a630..098099052264 100644 --- a/sys/net/if_stf.c +++ b/sys/net/if_stf.c @@ -334,22 +334,22 @@ stf_encapcheck(const struct mbuf *m, int off, int proto, void *arg) sc = (struct stf_softc *)arg; if (sc == NULL) - return 0; + return (0); if ((STF2IFP(sc)->if_flags & IFF_UP) == 0) - return 0; + return (0); /* IFF_LINK0 means "no decapsulation" */ if ((STF2IFP(sc)->if_flags & IFF_LINK0) != 0) - return 0; + return (0); if (proto != IPPROTO_IPV6) - return 0; + return (0); m_copydata(m, 0, sizeof(ip), (caddr_t)&ip); if (ip.ip_v != 4) - return 0; + return (0); if (stf_getsrcifa6(STF2IFP(sc), &addr6, &mask6) != 0) return (0); @@ -360,7 +360,7 @@ stf_encapcheck(const struct mbuf *m, int off, int proto, void *arg) * success on: dst = 10.1.1.1, ia6->ia_addr = 2002:0a01:0101:... */ if (bcmp(GET_V4(&addr6), &ip.ip_dst, sizeof(ip.ip_dst)) != 0) - return 0; + return (0); /* * check if IPv4 src matches the IPv4 address derived from the @@ -375,10 +375,10 @@ stf_encapcheck(const struct mbuf *m, int off, int proto, void *arg) b = ip.ip_src; b.s_addr &= mask.s_addr; if (a.s_addr != b.s_addr) - return 0; + return (0); /* stf interface makes single side match only */ - return 32; + return (32); } static int @@ -449,7 +449,7 @@ stf_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, if ((ifp->if_flags & IFF_UP) == 0) { m_freem(m); if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); - return ENETDOWN; + return (ENETDOWN); } /* @@ -460,14 +460,14 @@ stf_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, if (stf_getsrcifa6(ifp, &addr6, &mask6) != 0) { m_freem(m); if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); - return ENETDOWN; + return (ENETDOWN); } if (m->m_len < sizeof(*ip6)) { m = m_pullup(m, sizeof(*ip6)); if (!m) { if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); - return ENOBUFS; + return (ENOBUFS); } } ip6 = mtod(m, struct ip6_hdr *); @@ -485,7 +485,7 @@ stf_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, else { m_freem(m); if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); - return ENETUNREACH; + return (ENETUNREACH); } bcopy(ptr, &in4, sizeof(in4)); @@ -504,7 +504,7 @@ stf_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, M_PREPEND(m, sizeof(struct ip), M_NOWAIT); if (m == NULL) { if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); - return ENOBUFS; + return (ENOBUFS); } ip = mtod(m, struct ip *); @@ -524,7 +524,7 @@ stf_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); error = ip_output(m, NULL, NULL, 0, NULL, NULL); - return error; + return (error); } static int @@ -538,9 +538,9 @@ isrfc1918addr(struct in_addr *in) (ntohl(in->s_addr) & 0xff000000) >> 24 == 10 || (ntohl(in->s_addr) & 0xfff00000) >> 16 == 172 * 256 + 16 || (ntohl(in->s_addr) & 0xffff0000) >> 16 == 192 * 256 + 168)) - return 1; + return (1); - return 0; + return (0); } static int @@ -554,10 +554,10 @@ stf_checkaddr4(struct stf_softc *sc, struct in_addr *in, struct ifnet *inifp) * 224.0.0.0/4 0.0.0.0/8 127.0.0.0/8 255.0.0.0/8 */ if (IN_MULTICAST(ntohl(in->s_addr))) - return -1; + return (-1); switch ((ntohl(in->s_addr) & 0xff000000) >> 24) { case 0: case 127: case 255: - return -1; + return (-1); } /* @@ -565,7 +565,7 @@ stf_checkaddr4(struct stf_softc *sc, struct in_addr *in, struct ifnet *inifp) * (requirement from RFC3056 section 2 1st paragraph) */ if (isrfc1918addr(in)) - return -1; + return (-1); /* * reject packets with broadcast @@ -576,7 +576,7 @@ stf_checkaddr4(struct stf_softc *sc, struct in_addr *in, struct ifnet *inifp) continue; if (in->s_addr == ia4->ia_broadaddr.sin_addr.s_addr) { IN_IFADDR_RUNLOCK(&in_ifa_tracker); - return -1; + return (-1); } } IN_IFADDR_RUNLOCK(&in_ifa_tracker); @@ -594,7 +594,7 @@ stf_checkaddr4(struct stf_softc *sc, struct in_addr *in, struct ifnet *inifp) return (-1); } - return 0; + return (0); } static int @@ -606,7 +606,7 @@ stf_checkaddr6(struct stf_softc *sc, struct in6_addr *in6, struct ifnet *inifp) if (IN6_IS_ADDR_6TO4(in6)) { struct in_addr in4; bcopy(GET_V4(in6), &in4, sizeof(in4)); - return stf_checkaddr4(sc, &in4, inifp); + return (stf_checkaddr4(sc, &in4, inifp)); } /* @@ -616,9 +616,9 @@ stf_checkaddr6(struct stf_softc *sc, struct in6_addr *in6, struct ifnet *inifp) * (2) to be safe against future ip6_input change. */ if (IN6_IS_ADDR_V4COMPAT(in6) || IN6_IS_ADDR_V4MAPPED(in6)) - return -1; + return (-1); - return 0; + return (0); } static int @@ -770,5 +770,5 @@ stf_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) break; } - return error; + return (error); }