Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp403894pxu; Tue, 1 Dec 2020 14:23:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJzulHxm2aEGOL1C6VhN2ocn2XFIR62vlojCaTqHWJ12ezqaYAKfoO6WLhVQ61DVDe++jxXI X-Received: by 2002:aa7:dc05:: with SMTP id b5mr5411981edu.47.1606861434102; Tue, 01 Dec 2020 14:23:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606861434; cv=none; d=google.com; s=arc-20160816; b=GAJRytdh7v6Fti0DD0IkenryrPEndpQ7fFtmexBs9Fam16AVhOPF1KmI7XIO431tFS BqzKAVX06nIcrEnUuBsxf6smH4DHuGQkdiEqY5Ko9cTei2YDkI7lUAY7CJx3ImgPfRTc jn2denemH/8pVrNbFkYaeKXnFMep6Y42Ev5deafjlLvPR3D2WaEODfF7BLhdp8zMAiqH iN38SHSLxg0oLKFIbzyUdknEgCSQI+YO+nMior41+lxg5Dh0aQ6ctQiE86KnOqxDkYNl LKjNF0L11v69MoBWGdvWJdoQ9cdu2RtEd0cNIKS1+fLrmgZEIJRfkd6nw8V+IFWKA4pP ytng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=V5iJ3EwY1wz+xQHn5lxcoVFo5vR4xMVkwstqfwDbirI=; b=aHzn4K2ZpCZ2o411NCyhWhbuwOt8iMhW8kdRsP67Oy4v14kau8z64pha0SrJwZTylQ V2IlPWfXzrV1n7ov7QDviV4XBFSBjRvEiVZvbsEgROVHhyTqSQJX4XQuElTaD+jtVPaU 5ek8C1j7JlJyB5UIMOF/F48WYa9FNXeaun1EQ/1Zr46/3BryrYvoAhKsrtWJI9JOFAl1 vEb/t47tm0rjMQsKnzpDr6tVfda2ZGH5r5jMspWKVMjr8wZr6sibvnhIQRxdphKQYlAb md7eYR9vtWCmd2rJ+9K2N3E/aaZuP8Ue50nWgGBSWvkxYpE4+K88LR/ep9jX+C1eDOP/ gIcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="fOI5LIw/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j7si908070ejm.476.2020.12.01.14.23.31; Tue, 01 Dec 2020 14:23:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="fOI5LIw/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389046AbgLAJGl (ORCPT + 99 others); Tue, 1 Dec 2020 04:06:41 -0500 Received: from mail.kernel.org ([198.145.29.99]:40992 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388265AbgLAJDv (ORCPT ); Tue, 1 Dec 2020 04:03:51 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8DD1B20671; Tue, 1 Dec 2020 09:03:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606813391; bh=POG2yQfZgrtmTr75Yxvj9VSPH7jgq3D0r6llJSNcUWg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fOI5LIw/VOXQkn2Me1vOkCaCjx0kq0tMeIZm74tkhfahTv3gq79ppIfZ5B/KD4gd8 nWcUP0V7cHOrfxfXSbSn3loOTf3bSa11vwzRFUyDmtgto0FNqhPQh8fV1BQ5xxPh+F N+siLoBKQbDcDi6GwTZGCDeRzHa/PFdhqvt+j37M= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kim Phillips , Florian Klink , David Ahern , Jakub Kicinski Subject: [PATCH 5.4 03/98] ipv4: use IS_ENABLED instead of ifdef Date: Tue, 1 Dec 2020 09:52:40 +0100 Message-Id: <20201201084653.153353096@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201201084652.827177826@linuxfoundation.org> References: <20201201084652.827177826@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Florian Klink commit c09c8a27b9baa417864b9adc3228b10ae5eeec93 upstream. Checking for ifdef CONFIG_x fails if CONFIG_x=m. Use IS_ENABLED instead, which is true for both built-ins and modules. Otherwise, a > ip -4 route add 1.2.3.4/32 via inet6 fe80::2 dev eth1 fails with the message "Error: IPv6 support not enabled in kernel." if CONFIG_IPV6 is `m`. In the spirit of b8127113d01e53adba15b41aefd37b90ed83d631. Fixes: d15662682db2 ("ipv4: Allow ipv6 gateway with ipv4 routes") Cc: Kim Phillips Signed-off-by: Florian Klink Reviewed-by: David Ahern Link: https://lore.kernel.org/r/20201115224509.2020651-1-flokli@flokli.de Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- net/ipv4/fib_frontend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/ipv4/fib_frontend.c +++ b/net/ipv4/fib_frontend.c @@ -706,7 +706,7 @@ int fib_gw_from_via(struct fib_config *c cfg->fc_gw4 = *((__be32 *)via->rtvia_addr); break; case AF_INET6: -#ifdef CONFIG_IPV6 +#if IS_ENABLED(CONFIG_IPV6) if (alen != sizeof(struct in6_addr)) { NL_SET_ERR_MSG(extack, "Invalid IPv6 address in RTA_VIA"); return -EINVAL;