diff options
author | Seth David Schoen <schoen@loyalty.org> | 2021-05-13 06:37:49 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-05-17 22:47:58 +0200 |
commit | 94c821c74bf5fe0c25e09df5334a16f98608db90 (patch) | |
tree | 4e1d3a5f1d1cc1356ede4183de65c2af8301ebc1 /net/ipv4/fib_frontend.c | |
parent | net: mdio: ipq8064: enlarge sleep after read/write operation (diff) | |
download | linux-94c821c74bf5fe0c25e09df5334a16f98608db90.tar.xz linux-94c821c74bf5fe0c25e09df5334a16f98608db90.zip |
ip: Treat IPv4 segment's lowest address as unicast
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>
Reviewed-by: David Ahern <dsahern@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/fib_frontend.c')
-rw-r--r-- | net/ipv4/fib_frontend.c | 4 |
1 files changed, 1 insertions, 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); } |