From patchwork Thu May 13 04:37:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Seth David Schoen X-Patchwork-Id: 12255147 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C4156C433B4 for ; Thu, 13 May 2021 04:37:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A6DD5613B5 for ; Thu, 13 May 2021 04:37:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231130AbhEMEjE (ORCPT ); Thu, 13 May 2021 00:39:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230260AbhEMEi6 (ORCPT ); Thu, 13 May 2021 00:38:58 -0400 Received: from frotz.zork.net (frotz.zork.net [IPv6:2600:3c00:e000:35f::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82828C061574 for ; Wed, 12 May 2021 21:37:49 -0700 (PDT) Received: by frotz.zork.net (Postfix, from userid 1008) id 15B51119A9; Thu, 13 May 2021 04:37:49 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 frotz.zork.net 15B51119A9 Date: Wed, 12 May 2021 21:37:49 -0700 From: Seth David Schoen To: netdev@vger.kernel.org Cc: John Gilmore , Dave Taht , "David S. Miller" , Hideaki YOSHIFUJI , David Ahern Subject: [RESEND PATCH net-next 1/2] ip: Treat IPv4 segment's lowest address as unicast Message-ID: <20210513043749.GM1047389@frotz.zork.net> Mail-Followup-To: Seth David Schoen , netdev@vger.kernel.org, John Gilmore , Dave Taht , "David S. Miller" , Hideaki YOSHIFUJI , David Ahern References: <20210513043625.GL1047389@frotz.zork.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210513043625.GL1047389@frotz.zork.net> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Treat only the highest, not the lowest, IPv4 address within a local subnet as a broadcast address. Signed-off-by: Seth David Schoen Suggested-by: John Gilmore Acked-by: Dave Taht Reviewed-by: David Ahern --- net/ipv4/fib_frontend.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c index 84bb707bd88d..bfb345c88271 100644 --- a/net/ipv4/fib_frontend.c +++ b/net/ipv4/fib_frontend.c @@ -1122,10 +1122,8 @@ void fib_add_ifaddr(struct in_ifaddr *ifa) prefix, ifa->ifa_prefixlen, prim, ifa->ifa_rt_priority); - /* Add network specific broadcasts, when it takes a sense */ + /* Add the network broadcast address, when it makes sense */ if (ifa->ifa_prefixlen < 31) { - fib_magic(RTM_NEWROUTE, RTN_BROADCAST, prefix, 32, - prim, 0); fib_magic(RTM_NEWROUTE, RTN_BROADCAST, prefix | ~mask, 32, prim, 0); }