From nobody Wed May 17 10:05:32 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 4QLpdS2rblz49w2p; Wed, 17 May 2023 10:05:32 +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 4QLpdS1pdXz43dT; Wed, 17 May 2023 10:05:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684317932; 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=b4uYzuhVYY7Db/G7ZWvgD1QBNtHzqMYHMEYZxhENj2o=; b=TtIfnFS1XGaEYkX2ujzMWkSbqeOBvhcoKWKuDCmHw3spPd/l/uxbKPs8Z7HGyondLKAXo5 O/egMzM+GrnqrMlHrR79P1aSy/txhDfwKsQgSYEtje5BpB7+RLY+4zfhatu/UIalxpUH5V +M6WDyW73tO3fzNejmOUl9eOZL7GrkItif2vgA/vgfS9o6PBdR9AVmVtvP6yzAkVIsqmNU 7Vc/wd+G3nt3kbgmpbJidAi+Ktj1OEVjiRBw3LZf20hAjErrdAd4gUrAI0Svux87rvr3BA wY5ImwSsxJyjl1e9y8i6hINqYcl6khNtjdC6XgKFPdi2rEVpjM0lTpPPnzO38A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684317932; 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=b4uYzuhVYY7Db/G7ZWvgD1QBNtHzqMYHMEYZxhENj2o=; b=xWjrDA0Q7uQrF7xAUDtSJVhaZ7uvuwrCTCaUI5laatxg9HI/4RXtLLepnclRwnj/QB2GEZ mE/9J6WufK7yyLO+Yd7Ae9azmkSQiwdMzRwnMq4PKMnZQobM3QH/9j9xmuv2phAHNQd9FQ gMt1zApM7sNvCD2Uq7SnOIDLh2jbewTch1CMTPo6WktYLS6t6twL8oEAeTDK9cZYwAWFfx PbDWBEafPwz4vCevF1ZpaXBDcWCHb488aSYq2aWklZWhlJTITYHBs66nq0MucM5lc8F/cY ff3fMe6TMIV1QGpYj08W1Km+6zwtnfWc6AjbOUSqz+0MoV57kqJ0Bac9pghy7w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684317932; a=rsa-sha256; cv=none; b=B5qOQQwPbRDqVBy0ZG+evHTpjBvBOx/WvDBXkcnrhkm6mVlgEIwv03gfZeoCq+O7Cqvtst xX7xUoQLNFVJjzbLxnVmRUn23u8+dtcGEP0GtcpUnf0P08d+6Jd+t7J/knd3p8Y3S/ngrn KVdn9CtDBXuMc/gSHDifRVuNRIGXKqfE0OQ1k+IWQX3AobVBuboMYny+o0B2kCaUMGbjRC Js+uXlLWkiPTjbwH7Txbw4n/e5cV9LIvdUyieUE5bEvrdDu2GBvWtf5FFqTrfYWzOaSKh3 MRx70HfgObl7vsRSe7flFCcUg8Mu8rTmPSv38/KADJY20J7FmEes6m1CHqiltA== 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 4QLpdS0rBzz10DH; Wed, 17 May 2023 10:05:32 +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 34HA5Wa4056905; Wed, 17 May 2023 10:05:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34HA5Wck056904; Wed, 17 May 2023 10:05:32 GMT (envelope-from git) Date: Wed, 17 May 2023 10:05:32 GMT Message-Id: <202305171005.34HA5Wck056904@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 2a3147f96241 - stable/12 - ip_mroute: Delete unreachable code 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: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 2a3147f962419e07e3eea69d74fece46c526dee2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=2a3147f962419e07e3eea69d74fece46c526dee2 commit 2a3147f962419e07e3eea69d74fece46c526dee2 Author: Zhenlei Huang AuthorDate: 2023-04-23 04:47:57 +0000 Commit: Zhenlei Huang CommitDate: 2023-05-17 10:02:29 +0000 ip_mroute: Delete unreachable code As the flag M_WAITOK is passed to ip_encap_attach(), then the function will never return NULL, and the following code within NULL check branch will be unreachable. No functional change intended. Reviewed by: kp Fixes: 6d8fdfa9d5e7d Rework IP encapsulation handling code MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D39746 (cherry picked from commit b658c0fce10a06493dc468fc9f6699120473e17b) (cherry picked from commit ece63e96c364679e19c124d145abe5af789d1948) --- sys/netinet/ip_mroute.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/sys/netinet/ip_mroute.c b/sys/netinet/ip_mroute.c index 60b18cdbd35c..92074670cf60 100644 --- a/sys/netinet/ip_mroute.c +++ b/sys/netinet/ip_mroute.c @@ -2889,13 +2889,6 @@ ip_mroute_modevent(module_t mod, int type, void *unused) &pim_squelch_wholepkt); pim_encap_cookie = ip_encap_attach(&ipv4_encap_cfg, NULL, M_WAITOK); - if (pim_encap_cookie == NULL) { - printf("ip_mroute: unable to attach pim encap\n"); - VIF_LOCK_DESTROY(); - MFC_LOCK_DESTROY(); - MROUTER_LOCK_DESTROY(); - return (EINVAL); - } ip_mcast_src = X_ip_mcast_src; ip_mforward = X_ip_mforward;