提交 94c821c7 编写于 作者: S Seth David Schoen 提交者: David S. Miller

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: NSeth David Schoen <schoen@loyalty.org>
Suggested-by: NJohn Gilmore <gnu@toad.com>
Acked-by: NDave Taht <dave.taht@gmail.com>
Reviewed-by: NDavid Ahern <dsahern@kernel.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 77091933
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册