[RESEND,net-next,1/2] ip: Treat IPv4 segment's lowest address as unicast

Message ID 20210505232812.GQ2734@frotz.zork.net
State Superseded
Headers show
Series
  • [RESEND,net-next,1/2] ip: Treat IPv4 segment's lowest address as unicast
Related show

Commit Message

Seth David Schoen May 5, 2021, 11:28 p.m.
Treat only the highest, not the lowest, IPv4 address within a local
subnet as a broadcast address.

Signed-off-by: Seth David Schoen <schoen@loyalty.org>
Suggested-by: John Gilmore <gnu@toad.com>
Acked-by: Dave Taht <dave.taht@gmail.com>
---
 net/ipv4/fib_frontend.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Jakub Kicinski May 7, 2021, 12:36 a.m. | #1
On Wed, 5 May 2021 16:28:12 -0700 Seth David Schoen wrote:
> Treat only the highest, not the lowest, IPv4 address within a local

> subnet as a broadcast address.


We don't accept patches to net-next during the merge window.

Please repost in a week, please make sure you CC IP maintainers
(get_maintainer script will point them out).

Patch

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);
 		}