From nobody Mon Jul 18 13:03:08 2022 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 4LmhwD3sNrz4T69T; Mon, 18 Jul 2022 13:03:08 +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 4LmhwD3L3nz3rR3; Mon, 18 Jul 2022 13:03:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658149388; 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=MzghBWxx3XKOwDKnDWyGzXX0LRRxpqM+SZw9ci5uKpI=; b=Ve1MtSxDeUg421xoYwZOTnnTL6LFqohtwoo3wQbpBgwYIWsswIEI+523wXAlJuwxzgQySR WYz+wzzPTtTcFy8tg9Oeu7KHpjA+kENTXZkxB+ThGnp46sENXkv9YI9w9bZ6Zgzvoupjuz ysdOi2Laohz++Bb4SqG6sjwGh6kQSdIdlyQKEBSuN2UikSoPsvCooAjPQbFlQTwpryBudd wWyof/Sr2DjA1VYiJkh11Q463e33TREg/5UPDwtBSBaySmQ5Y30qciQl5rHaHs3qHhO+I7 +jjIDStC1bGwpQ1mPMKnAUQMl4ZJq0VS/0cjKHM+tN8GRrIHIt2P0XowHTLGiw== 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 4LmhwD2PHpzgTS; Mon, 18 Jul 2022 13:03:08 +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 26ID38MI008284; Mon, 18 Jul 2022 13:03:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26ID38kg008283; Mon, 18 Jul 2022 13:03:08 GMT (envelope-from git) Date: Mon, 18 Jul 2022 13:03:08 GMT Message-Id: <202207181303.26ID38kg008283@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mike Karels Subject: git: a11f080e8682 - main - ofed/infiniband: fix ifdefs for new INET changes, fixing LINT-NOIP 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: karels X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a11f080e8682971cee931b7add0dc4902c06b08b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658149388; 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=MzghBWxx3XKOwDKnDWyGzXX0LRRxpqM+SZw9ci5uKpI=; b=YGKSTel7/FeAg30Cl0+1wk3I6ilRwCDIrwGzfDBMsSvtcH/28hnVllxZzzuwsPIZywLQHC QyhrkoEAgHWNaV0glbtv7E/ieV5A1JZbEoEofAlL/kYHVNSagg6+X90FDi1vjwjEqkYFQb eCj3jnbv9FWzelE1Ycq+ky70v4sye2sJ+W9R52Q1F2SwAKoRKWQmh2drJTUCNxaZYh8Juc I6koDv8Ig9REMOVhy8t8Ac63u8qqnwYENhTS7t5ewV5ZLN6ynq3ngH84VYkPPgK06ohIN2 ZyoAL82fbjswLKy2/WllAyWdXjccQ2NRBmP1ka2/RQtdGJP6Jjvlg/xXYad7ow== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1658149388; a=rsa-sha256; cv=none; b=dgcMxNy8SOp0HyPwDlV7Vt66ZHTY6xE8mFxCmX6eVPcIM64liULX3HiOCUhXAzRojZK3eX Vim/GTEBh8rir/4HzzYox7trN8ROv6r12E6ayHrtX4pUXF+5jGpxIb9NhmzW62V6pS2imn FjUcoqFZBJUXdOyQ/bjkZ5lfI2yvdxnIwX2klGpFtBpk9eaaLP9InQwhaPGkXTgIcPMEIK hbU8EhbXvgNGH/7zTjLr6hS+DMAMiF1NqhrKBRZukv8pCrYDf3KJyhgX++3axcu3X6YkcE Y6jJMic/sgZ0htGycaM1fQoDiGyh3lAa19x9rfbH0q+gp//2A1fJ65XS9MI6Yg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=a11f080e8682971cee931b7add0dc4902c06b08b commit a11f080e8682971cee931b7add0dc4902c06b08b Author: Mike Karels AuthorDate: 2022-07-16 21:05:58 +0000 Commit: Mike Karels CommitDate: 2022-07-18 13:02:01 +0000 ofed/infiniband: fix ifdefs for new INET changes, fixing LINT-NOIP Some of the ofed/infiniband code has INET and INET6 address handling code without using ifdefs. This failed with a recent change to INET, in which IN_LOOPBACK() started using a VNET variable, and which is not present if INET is not configured. Add #ifdef INET, and INET6 for good measure, in cma_loopback_addr(), along with inclusion of the options headers in ib_cma.c. Reviewed by: hselasky rgrimes bz Differential Revision: https://reviews.freebsd.org/D35835 (cherry picked from commit 752b7632776237f9c071783acdd1136ebf5f287d) --- sys/ofed/drivers/infiniband/core/ib_cma.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sys/ofed/drivers/infiniband/core/ib_cma.c b/sys/ofed/drivers/infiniband/core/ib_cma.c index 586524ac88bb..10dedf96f0e6 100644 --- a/sys/ofed/drivers/infiniband/core/ib_cma.c +++ b/sys/ofed/drivers/infiniband/core/ib_cma.c @@ -40,6 +40,9 @@ __FBSDID("$FreeBSD$"); #define LINUXKPI_PARAM_PREFIX ibcore_ +#include "opt_inet.h" +#include "opt_inet6.h" + #include #include #include @@ -1048,10 +1051,18 @@ static inline int cma_zero_addr(struct sockaddr *addr) static inline int cma_loopback_addr(struct sockaddr *addr) { switch (addr->sa_family) { +#ifdef INET + /* + * ipv4_is_loopback() requires an inet variable via vnet, + * not present if INET is not included. + */ case AF_INET: return ipv4_is_loopback(((struct sockaddr_in *) addr)->sin_addr.s_addr); +#endif +#ifdef INET6 case AF_INET6: return ipv6_addr_loopback(&((struct sockaddr_in6 *) addr)->sin6_addr); +#endif case AF_IB: return ib_addr_loopback(&((struct sockaddr_ib *) addr)->sib_addr); default: