From 6bc47bcb8d64bba361ca5e37f6fa96400f8b43a0 Mon Sep 17 00:00:00 2001 From: Seth Schoen Date: Wed, 9 Jun 2021 19:28:21 -0700 Subject: [PATCH] First cut at FreeBSD lowest host patch --- pending-patches/STATUS | 17 ++++++++ ...on-t-use-lowest-address-as-broadcast.patch | 41 +++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 pending-patches/freebsd/0001-Don-t-use-lowest-address-as-broadcast.patch diff --git a/pending-patches/STATUS b/pending-patches/STATUS index 032ce46..ed1d5ce 100644 --- a/pending-patches/STATUS +++ b/pending-patches/STATUS @@ -1,11 +1,28 @@ +freebsd/0001-Don-t-use-lowest-address-as-broadcast.patch + + This patch is new as of 2021-06-09 and has not been merged yet. + + It should probably be folded into https://reviews.freebsd.org/D19316 + by Rodney Grimes, which is a currently-working patch that adds + support for 240/4, 0/8, and 127/8 unicast routing in the FreeBSD + kernel. + freebsd/freebsd_e.diff This patch has not been merged as of 2020-09-25. + It should probably be considered superseded by + https://reviews.freebsd.org/D19316 (which adds the same + functionality in a different way). + freebsd/in_zeronet.patch This patch has not been merged as of 2020-09-25. + It should probably be considered superseded by + https://reviews.freebsd.org/D19316 (which adds the same + functionality in a different way). + isdn-utils/isdn4k-utils-3.27_20151118.patch I'm not sure what would be considered the upstream source for this diff --git a/pending-patches/freebsd/0001-Don-t-use-lowest-address-as-broadcast.patch b/pending-patches/freebsd/0001-Don-t-use-lowest-address-as-broadcast.patch new file mode 100644 index 0000000..98b6043 --- /dev/null +++ b/pending-patches/freebsd/0001-Don-t-use-lowest-address-as-broadcast.patch @@ -0,0 +1,41 @@ +From de8f01c87339acddd1a42f9d4887af60d922edd4 Mon Sep 17 00:00:00 2001 +From: Seth Schoen +Date: Wed, 9 Jun 2021 19:23:06 -0700 +Subject: [PATCH] Don't use lowest address as broadcast + +There are still other things to check, but this is a first cut +at making the lowest address no longer be treated as a broadcast. + +It achieved interoperability on a LAN with an analogously-patched +Linux host (both could ARP/ping/netcat with each other when one +was using the .0 address on a /24). +--- + sys/netinet/in.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/sys/netinet/in.c b/sys/netinet/in.c +index bcf071a81e0e..255776a63ce9 100644 +--- a/sys/netinet/in.c ++++ b/sys/netinet/in.c +@@ -1133,13 +1133,13 @@ int + in_ifaddr_broadcast(struct in_addr in, struct in_ifaddr *ia) + { + +- return ((in.s_addr == ia->ia_broadaddr.sin_addr.s_addr || ++ return (in.s_addr == ia->ia_broadaddr.sin_addr.s_addr && + /* +- * Check for old-style (host 0) broadcast, but +- * taking into account that RFC 3021 obsoletes it. ++ * Check for old-style (host 0) broadcast is removed ++ * (not just for point-to-point links per RFC 3021, but ++ * for everything, because we don't need two broadcast ++ * addresses). + */ +- (ia->ia_subnetmask != IN_RFC3021_MASK && +- ntohl(in.s_addr) == ia->ia_subnet)) && + /* + * Check for an all one subnetmask. These + * only exist when an interface gets a secondary +-- +2.25.1 +