From nobody Tue Apr 25 06:44:04 2023 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 4Q5CC84DtPz46khc; Tue, 25 Apr 2023 06:44:04 +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 4Q5CC82Zvbz3LnN; Tue, 25 Apr 2023 06:44:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682405044; 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=DjmdDFTJQ8rYaN537xOML58cyLPM69lK/qZMNofHh0c=; b=cGKA+Sky3GBCkO9MpB3i75avQIZc/G/rfFX5Mb2sPbh+7q1HNvEHHQCTYZG8rymFPDAv5f PhAuxCX+6wTNQgJPf4MwIdDNqYP1Pni+BZB3G2L95iCpkPEsGpTPna+wfrAzykmGB17H1T JRRk75RQeTZ7PY2SJ36T9Q94PKTlNKmWaxb8JB+fYbbqI2t7HadY8xEYHBywyUnwPWDGwq bUurxazi7/S0ONJksiuLMqGLt+lc26+IEvFc3ko4PzGW0tKN0ZZq3aoGlBpWOWG+TkKH8T CIo54FWpF/jjM47fepVEDo24Wx2LPuUBaCsmnRoaDh6Y0jymT2FUMr2JeLhbjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682405044; 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=DjmdDFTJQ8rYaN537xOML58cyLPM69lK/qZMNofHh0c=; b=M590bz5OhPl0BvUpXKefpXXovcEzXsTFozQIpvKA4Y/90fjjj8b8tqm2sDH86RyoPMUppU 0dVOxIs1ZKWb++VZ/EiEia5mBM1DMbIRASuKJT+yZH1IEmLcdUNbeerHJWaVRaQuHLFJz0 azZLas3uU9qvRUs3EuTHrKg81Kf+kg9ItSMj3m+l5/TW8vojJlz1MgNVWzpF4JQ3OOe0kB YwHiKzqEF9AEi3QyUWTT5RV5zQI4TJenxFOkWowdnewFwcsrXl5q9WosV2Bi8GfVbc5jSe ZSP57FwvP4ozIqzTgwMKW0NxJISj6j+aCBm31sk+WMvEhoQLEmTDkSMKwoDHFg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682405044; a=rsa-sha256; cv=none; b=PTh9F3U80t3hPHWRKPYbQlwSN+UrGPXNlz21xXHVtBbc/yLodyfLbH9/sIkP6NGTTzZMfH Ly2B+5O8K05Al16unfEjmb43AIeat39UxZaRUfTk49oRNXDYqlbyixEKaN2E4FKhq1S5P7 TZJlJrU10ep6y4mcQ4BdBJl6GoAzGmFGxan0psCvg+nUwO3vlPyahhSpGvvD6fGoqCFhlm kjigc+RcEML2Bi1w7ZNaHVtXGcjgBpxSwOwFTldcVVlPJ/xBKWCbBjdpa6GjXNrLnKTu1D 0G07kbNjsJ1e34afQN0lgr8zlsDEdZDiBwC1nt0QoSsQ2Ov8JP2muMgfa4v8tA== 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 4Q5CC8141Hzxdt; Tue, 25 Apr 2023 06:44:04 +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 33P6i4W7066857; Tue, 25 Apr 2023 06:44:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33P6i46n066856; Tue, 25 Apr 2023 06:44:04 GMT (envelope-from git) Date: Tue, 25 Apr 2023 06:44:04 GMT Message-Id: <202304250644.33P6i46n066856@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: fcc7aabdcabb - main - netipsec: some style 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: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fcc7aabdcabbce82b7281607fa3a51c52de6c1b4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=fcc7aabdcabbce82b7281607fa3a51c52de6c1b4 commit fcc7aabdcabbce82b7281607fa3a51c52de6c1b4 Author: Konstantin Belousov AuthorDate: 2021-07-31 01:46:17 +0000 Commit: Konstantin Belousov CommitDate: 2023-04-25 06:39:51 +0000 netipsec: some style Sponsored by: NVidia networking --- sys/netipsec/key.c | 8 ++++---- sys/netipsec/keysock.c | 23 +++++++++++------------ 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/sys/netipsec/key.c b/sys/netipsec/key.c index 62aa99019437..e759dcf770a6 100644 --- a/sys/netipsec/key.c +++ b/sys/netipsec/key.c @@ -8243,7 +8243,7 @@ spdcache_init(void) V_spdcache_lock = malloc(sizeof(struct mtx) * (V_spdcachehash_mask + 1), - M_IPSEC_SPDCACHE, M_WAITOK|M_ZERO); + M_IPSEC_SPDCACHE, M_WAITOK | M_ZERO); for (i = 0; i < V_spdcachehash_mask + 1; ++i) SPDCACHE_LOCK_INIT(i); @@ -8255,10 +8255,10 @@ spdcache_entry_alloc(const struct secpolicyindex *spidx, struct secpolicy *sp) { struct spdcache_entry *entry; - entry = malloc(sizeof(struct spdcache_entry), - M_IPSEC_SPDCACHE, M_NOWAIT|M_ZERO); + entry = malloc(sizeof(struct spdcache_entry), M_IPSEC_SPDCACHE, + M_NOWAIT | M_ZERO); if (entry == NULL) - return NULL; + return (NULL); if (sp != NULL) SP_ADDREF(sp); diff --git a/sys/netipsec/keysock.c b/sys/netipsec/keysock.c index d0ab2f6020ec..e2fca3b881dc 100644 --- a/sys/netipsec/keysock.c +++ b/sys/netipsec/keysock.c @@ -134,9 +134,9 @@ key_send(struct socket *so, int flags, struct mbuf *m, error = key_parse(m, so); m = NULL; end: - if (m) + if (m != NULL) m_freem(m); - return error; + return (error); } /* @@ -168,11 +168,11 @@ key_sendup0(struct keycb *kp, struct mbuf *m, int promisc) PFKEYSTAT_INC(in_nomem); m_freem(m); soroverflow(kp->kp_socket); - return ENOBUFS; + return (ENOBUFS); } sorwakeup(kp->kp_socket); - return 0; + return (0); } /* so can be NULL if target != KEY_SENDUP_ONE */ @@ -195,7 +195,7 @@ key_sendup_mbuf(struct socket *so, struct mbuf *m, int target) m = m_pullup(m, sizeof(struct sadb_msg)); if (m == NULL) { PFKEYSTAT_INC(in_nomem); - return ENOBUFS; + return (ENOBUFS); } } if (m->m_len >= sizeof(struct sadb_msg)) { @@ -222,8 +222,8 @@ key_sendup_mbuf(struct socket *so, struct mbuf *m, int target) if (so != NULL && so->so_pcb == kp) continue; - if (target == KEY_SENDUP_ONE || ( - target == KEY_SENDUP_REGISTERED && kp->kp_registered == 0)) + if (target == KEY_SENDUP_ONE || (target == + KEY_SENDUP_REGISTERED && kp->kp_registered == 0)) continue; /* KEY_SENDUP_ALL + KEY_SENDUP_REGISTERED */ @@ -267,12 +267,12 @@ key_attach(struct socket *so, int proto, struct thread *td) if (td != NULL) { error = priv_check(td, PRIV_NET_RAW); - if (error) - return error; + if (error != 0) + return (error); } error = soreserve(so, key_sendspace, key_recvspace); - if (error) + if (error != 0) return (error); kp = malloc(sizeof(*kp), M_PCB, M_WAITOK); @@ -313,7 +313,6 @@ key_detach(struct socket *so) static int key_shutdown(struct socket *so) { - socantsendmore(so); return (0); } @@ -324,7 +323,7 @@ SYSCTL_NODE(_net, PF_KEY, key, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, static struct protosw keysw = { .pr_type = SOCK_RAW, .pr_protocol = PF_KEY_V2, - .pr_flags = PR_ATOMIC|PR_ADDR, + .pr_flags = PR_ATOMIC | PR_ADDR, .pr_abort = key_close, .pr_attach = key_attach, .pr_detach = key_detach,