From owner-dev-commits-src-all@freebsd.org Tue Mar 9 19:49:25 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7E15D56E05E; Tue, 9 Mar 2021 19:49:25 +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 4Dw5Px37Ynz4rwL; Tue, 9 Mar 2021 19:49:25 +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 5E5F121BE7; Tue, 9 Mar 2021 19:49:25 +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 129JnPb9016659; Tue, 9 Mar 2021 19:49:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 129JnP9N016658; Tue, 9 Mar 2021 19:49:25 GMT (envelope-from git) Date: Tue, 9 Mar 2021 19:49:25 GMT Message-Id: <202103091949.129JnP9N016658@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 299f8977cef6 - main - if_wg: wg_input: remove a couple locals (NFC) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 299f8977cef66d19c05d52d19b892fd8c7a235ea Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Mar 2021 19:49:25 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=299f8977cef66d19c05d52d19b892fd8c7a235ea commit 299f8977cef66d19c05d52d19b892fd8c7a235ea Author: Kyle Evans AuthorDate: 2021-03-09 10:59:21 +0000 Commit: Kyle Evans CommitDate: 2021-03-09 19:49:13 +0000 if_wg: wg_input: remove a couple locals (NFC) We have no use for the udphdr or this hlen local, just spell out the addition inline. MFC after: 3 days Reviewed by: grehan, markj Differential Revision: https://reviews.freebsd.org/D29142 --- sys/dev/if_wg/module/if_wg_session.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/sys/dev/if_wg/module/if_wg_session.c b/sys/dev/if_wg/module/if_wg_session.c index ae9e44cffef5..5360b047426b 100644 --- a/sys/dev/if_wg/module/if_wg_session.c +++ b/sys/dev/if_wg/module/if_wg_session.c @@ -1891,17 +1891,14 @@ wg_input(struct mbuf *m0, int offset, struct inpcb *inpcb, struct wg_pkt_data *pkt_data; struct wg_endpoint *e; struct wg_softc *sc = _sc; - struct udphdr *uh; struct mbuf *m; - int pktlen, pkttype, hlen; + int pktlen, pkttype; struct noise_remote *remote; struct wg_tag *t; void *data; - uh = (struct udphdr *)(m0->m_data + offset); - hlen = offset + sizeof(struct udphdr); - - m_adj(m0, hlen); + /* Caller provided us with srcsa, no need for this header. */ + m_adj(m0, offset + sizeof(struct udphdr)); /* * Ensure mbuf has at least enough contiguous data to peel off our