vxlan-organiser/vm/0001-fix-multiple-interface-with-same-IP.patch
catvayor e07c904c56
feat: use kea for dhcp
include a patch of kea
2025-02-23 21:45:57 +01:00

31 lines
1.1 KiB
Diff

From 417ae050a7dfb6d6d1e227bbe5817992949376f7 Mon Sep 17 00:00:00 2001
From: catvayor <catvayor@katvayor.net>
Date: Sun, 23 Feb 2025 21:15:42 +0100
Subject: [PATCH] fix: multiple interface with same IP
---
src/lib/dhcp/pkt_filter.cc | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/lib/dhcp/pkt_filter.cc b/src/lib/dhcp/pkt_filter.cc
index d6360984ef..4dfdea59c7 100644
--- a/src/lib/dhcp/pkt_filter.cc
+++ b/src/lib/dhcp/pkt_filter.cc
@@ -24,6 +24,14 @@ PktFilter::openFallbackSocket(const isc::asiolink::IOAddress& addr,
" address " << addr << ", port " << port
<< ", reason: " << strerror(errno));
}
+ // allow address to be reused
+ int oneopt = 1;
+ if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &oneopt, sizeof(oneopt))) {
+ close(sock);
+ isc_throw(SocketConfigError, "failed to set SO_REUSEADDR socket for"
+ " address " << addr << ", port " << port
+ << ", reason: " << strerror(errno));
+ }
// Set the close-on-exec flag.
if (fcntl(sock, F_SETFD, FD_CLOEXEC) < 0) {
close(sock);
--
2.47.1