1
0
mirror of https://github.com/dtaht/unicast-extensions.git synced 2024-05-11 05:55:07 +00:00

First cut at FreeBSD lowest host patch

This commit is contained in:
Seth Schoen
2021-06-09 19:28:21 -07:00
parent 6fd9a65e24
commit 6bc47bcb8d
2 changed files with 58 additions and 0 deletions

View File

@@ -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

View File

@@ -0,0 +1,41 @@
From de8f01c87339acddd1a42f9d4887af60d922edd4 Mon Sep 17 00:00:00 2001
From: Seth Schoen <schoen@loyalty.org>
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