interface-ip: Fix broadcast address when using /31 or /32 IPv4 addressing
authorBaptiste Jonglez <git@bitsofnetworks.org>
Mon, 14 Sep 2015 10:25:33 +0000 (12:25 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Sat, 26 Sep 2015 11:50:48 +0000 (13:50 +0200)
commita0f133ed22dee4eccc05961f646e14ecc0514060
tree0a1dd925456d609167e3e6ff6db2b1fd72e5174a
parent014698606902e495c7b169bf30688a685cd72d64
interface-ip: Fix broadcast address when using /31 or /32 IPv4 addressing

A /31-addressed interface requires a broadcast address of 255.255.255.255,
because there is no room for a proper broadcast address.  Without this,
any packet destinated to the other end of the link is sent as broadcast,
which is incorrect.

For consistency with the Linux kernel, /32-addressed interfaces are
treated in the same way.

Signed-off-by: Baptiste Jonglez <git@bitsofnetworks.org>
interface-ip.c