From ceb830d6c975fa3be04ff83d99db7448618f40a8 Mon Sep 17 00:00:00 2001 From: Seth Schoen Date: Fri, 27 Jan 2023 23:10:30 -0800 Subject: [PATCH] Let's have a directory for useful patches for people to apply themselves --- ...5.14-lowest-address-is-not-broadcast.patch | 33 +++++++++++++++++++ useful-patches/README.md | 11 +++++++ 2 files changed, 44 insertions(+) create mode 100644 useful-patches/0001-Backport-5.14-lowest-address-is-not-broadcast.patch create mode 100644 useful-patches/README.md diff --git a/useful-patches/0001-Backport-5.14-lowest-address-is-not-broadcast.patch b/useful-patches/0001-Backport-5.14-lowest-address-is-not-broadcast.patch new file mode 100644 index 0000000..0f083be --- /dev/null +++ b/useful-patches/0001-Backport-5.14-lowest-address-is-not-broadcast.patch @@ -0,0 +1,33 @@ +From 323c87d4c2de7598ac810632450816732056b111 Mon Sep 17 00:00:00 2001 +From: Seth Schoen +Date: Sun, 22 Jan 2023 14:39:24 -0800 +Subject: [PATCH] Backport 5.14: lowest-address is not broadcast + +Allow the lowest address in a network segment to be used as an +ordinary unicast address, not a duplicate broadcast address. + +Signed-off-by: Seth David Schoen +Suggested-by: John Gilmore +--- + net/ipv4/fib_frontend.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c +index 5f786ef662ea..0b3fadc002d6 100644 +--- a/net/ipv4/fib_frontend.c ++++ b/net/ipv4/fib_frontend.c +@@ -1129,10 +1129,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); + arp_invalidate(dev, prefix | ~mask, false); +-- +2.25.1 + diff --git a/useful-patches/README.md b/useful-patches/README.md new file mode 100644 index 0000000..d8c5b39 --- /dev/null +++ b/useful-patches/README.md @@ -0,0 +1,11 @@ +This directory contains patches which are probably not going to be merged +upstream for various reasons (or were not merged upstream in time for +particular software releases), but if you're building a relevant software +version yourself, you can still make use of them. + +* 0001-Backport-5.14-lowest-address-is-not-broadcast.patch + +This patch is included with Linux 5.14 and later, and makes the lowest +address on an IPv4 segment non-broadcast. You can apply this version +to a Linux 5.10 LTS kernel (or likely to other kernel versions prior +to 5.14).