-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[dhcp_relay] Add support for DHCP client(s) on one VLAN and DHCP serv…
…er(s) on another (#2946)
- Loading branch information
Showing
12 changed files
with
924 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,11 @@ | ||
# isc-dhcp packages | ||
|
||
ISC_DHCP_VERSION = 4.3.5-3.1 | ||
ISC_DHCP_VERSION = 4.3.5-2 | ||
|
||
export ISC_DHCP_VERSION | ||
|
||
ISC_DHCP_COMMON = isc-dhcp-common_$(ISC_DHCP_VERSION)_amd64.deb | ||
$(ISC_DHCP_COMMON)_SRC_PATH = $(SRC_PATH)/isc-dhcp | ||
SONIC_MAKE_DEBS += $(ISC_DHCP_COMMON) | ||
|
||
ISC_DHCP_RELAY = isc-dhcp-relay_$(ISC_DHCP_VERSION)_amd64.deb | ||
$(eval $(call add_derived_package,$(ISC_DHCP_COMMON),$(ISC_DHCP_RELAY))) | ||
$(ISC_DHCP_RELAY)_SRC_PATH = $(SRC_PATH)/isc-dhcp | ||
SONIC_MAKE_DEBS += $(ISC_DHCP_RELAY) | ||
|
||
SONIC_STRETCH_DEBS += $(ISC_DHCP_COMMON) $(ISC_DHCP_RELAY) | ||
SONIC_STRETCH_DEBS += $(ISC_DHCP_RELAY) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/isc-dhcp/patch/0005-Add-enable-use-sockets-to-configure-flags-in-debian-.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
From 5c64cb06e3ac50a1cbca85669625fe16439064ad Mon Sep 17 00:00:00 2001 | ||
From: Joe LeVeque <[email protected]> | ||
Date: Fri, 17 May 2019 21:49:00 +0000 | ||
Subject: [PATCH 1/3] Add --enable-use-sockets to configure flags in | ||
debian/rules | ||
|
||
--- | ||
debian/rules | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
||
diff --git a/debian/rules b/debian/rules | ||
index 114606b..9919237 100755 | ||
--- a/debian/rules | ||
+++ b/debian/rules | ||
@@ -23,7 +23,7 @@ CFLAGS+=-D_PATH_DHCLIENT_CONF='\"/etc/dhcp/dhclient.conf\"' | ||
CFLAGS+=-D_PATH_DHCLIENT_DB='\"$(LEASE_PATH)/dhclient.leases\"' | ||
CFLAGS+=-D_PATH_DHCLIENT6_DB='\"$(LEASE_PATH)/dhclient6.leases\"' | ||
|
||
-CONFFLAGS=--prefix=/usr --enable-log-pid --enable-paranoia | ||
+CONFFLAGS=--prefix=/usr --enable-log-pid --enable-paranoia --enable-use-sockets | ||
|
||
# cross-architecture building | ||
ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE)) | ||
-- | ||
2.17.1 | ||
|
275 changes: 275 additions & 0 deletions
275
src/isc-dhcp/patch/0006-Bugfix-Ensure-HAVE_SO_BINDTODEVICE-has-a-chance-to-b.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,275 @@ | ||
From 6620d4778fe36c89ce2e95d6932338cefc90df7d Mon Sep 17 00:00:00 2001 | ||
From: Joe LeVeque <[email protected]> | ||
Date: Fri, 17 May 2019 21:53:52 +0000 | ||
Subject: [PATCH 2/3] Bugfix: Ensure HAVE_SO_BINDTODEVICE has a chance to be | ||
defined before it is referenced | ||
|
||
--- | ||
includes/osdep.h | 239 ++++++++++++++++++++++++----------------------- | ||
1 file changed, 120 insertions(+), 119 deletions(-) | ||
|
||
diff --git a/includes/osdep.h b/includes/osdep.h | ||
index cfae90b..f07c43c 100644 | ||
--- a/includes/osdep.h | ||
+++ b/includes/osdep.h | ||
@@ -48,37 +48,6 @@ | ||
#define BYTE_ORDER DHCP_BYTE_ORDER | ||
#endif /* BYTE_ORDER */ | ||
|
||
-/* Porting:: | ||
- | ||
- If you add a new network API, you must add a check for it below: */ | ||
- | ||
-#if !defined (USE_SOCKETS) && \ | ||
- !defined (USE_SOCKET_SEND) && \ | ||
- !defined (USE_SOCKET_RECEIVE) && \ | ||
- !defined (USE_RAW_SOCKETS) && \ | ||
- !defined (USE_RAW_SEND) && \ | ||
- !defined (USE_SOCKET_RECEIVE) && \ | ||
- !defined (USE_BPF) && \ | ||
- !defined (USE_BPF_SEND) && \ | ||
- !defined (USE_BPF_RECEIVE) && \ | ||
- !defined (USE_LPF) && \ | ||
- !defined (USE_LPF_SEND) && \ | ||
- !defined (USE_LPF_RECEIVE) && \ | ||
- !defined (USE_NIT) && \ | ||
- !defined (USE_NIT_SEND) && \ | ||
- !defined (USE_NIT_RECEIVE) && \ | ||
- !defined (USE_DLPI_SEND) && \ | ||
- !defined (USE_DLPI_RECEIVE) | ||
-/* Determine default socket API to USE. */ | ||
-# if defined(HAVE_BPF) | ||
-# define USE_BPF 1 | ||
-# elif defined(HAVE_LPF) | ||
-# define USE_LPF 1 | ||
-# elif defined(HAVE_DLPI) | ||
-# define USE_DLPI 1 | ||
-# endif | ||
-#endif | ||
- | ||
#if !defined (TIME_MAX) | ||
# define TIME_MAX 2147483647 | ||
#endif | ||
@@ -91,94 +60,6 @@ | ||
# define vsnprintf isc_print_vsnprintf | ||
#endif | ||
|
||
-/* Porting:: | ||
- | ||
- If you add a new network API, and have it set up so that it can be | ||
- used for sending or receiving, but doesn't have to be used for both, | ||
- then set up an ifdef like the ones below: */ | ||
- | ||
-#ifdef USE_SOCKETS | ||
-# define USE_SOCKET_SEND | ||
-# define USE_SOCKET_RECEIVE | ||
-# if defined(HAVE_DLPI) && !defined(sun) && !defined(USE_V4_PKTINFO) | ||
-# define USE_DLPI_HWADDR | ||
-# elif defined(HAVE_LPF) | ||
-# define USE_LPF_HWADDR | ||
-# elif defined(HAVE_BPF) | ||
-# define USE_BPF_HWADDR | ||
-# endif | ||
-#endif | ||
- | ||
-#ifdef USE_RAW_SOCKETS | ||
-# define USE_RAW_SEND | ||
-# define USE_SOCKET_RECEIVE | ||
-#endif | ||
- | ||
-#ifdef USE_BPF | ||
-# define USE_BPF_SEND | ||
-# define USE_BPF_RECEIVE | ||
-#endif | ||
- | ||
-#ifdef USE_LPF | ||
-# define USE_LPF_SEND | ||
-# define USE_LPF_RECEIVE | ||
-#endif | ||
- | ||
-#ifdef USE_NIT | ||
-# define USE_NIT_SEND | ||
-# define USE_NIT_RECEIVE | ||
-#endif | ||
- | ||
-#ifdef USE_DLPI | ||
-# define USE_DLPI_SEND | ||
-# define USE_DLPI_RECEIVE | ||
-#endif | ||
- | ||
-#ifdef USE_UPF | ||
-# define USE_UPF_SEND | ||
-# define USE_UPF_RECEIVE | ||
-#endif | ||
- | ||
-/* Porting:: | ||
- | ||
- If you add support for sending packets directly out an interface, | ||
- and your support does not do ARP or routing, you must use a fallback | ||
- mechanism to deal with packets that need to be sent to routers. | ||
- Currently, all low-level packet interfaces use BSD sockets as a | ||
- fallback. */ | ||
- | ||
-#if defined (USE_BPF_SEND) || defined (USE_NIT_SEND) || \ | ||
- defined (USE_DLPI_SEND) || defined (USE_UPF_SEND) || \ | ||
- defined (USE_LPF_SEND) || \ | ||
- (defined (USE_SOCKET_SEND) && defined (HAVE_SO_BINDTODEVICE)) | ||
-# define USE_SOCKET_FALLBACK | ||
-# define USE_FALLBACK | ||
-#endif | ||
- | ||
-/* Porting:: | ||
- | ||
- If you add support for sending packets directly out an interface | ||
- and need to be able to assemble packets, add the USE_XXX_SEND | ||
- definition for your interface to the list tested below. */ | ||
- | ||
-#if defined (USE_RAW_SEND) || defined (USE_BPF_SEND) || \ | ||
- defined (USE_NIT_SEND) || defined (USE_UPF_SEND) || \ | ||
- defined (USE_DLPI_SEND) || defined (USE_LPF_SEND) | ||
-# define PACKET_ASSEMBLY | ||
-#endif | ||
- | ||
-/* Porting:: | ||
- | ||
- If you add support for receiving packets directly from an interface | ||
- and need to be able to decode raw packets, add the USE_XXX_RECEIVE | ||
- definition for your interface to the list tested below. */ | ||
- | ||
-#if defined (USE_RAW_RECEIVE) || defined (USE_BPF_SEND) || \ | ||
- defined (USE_NIT_RECEIVE) || defined (USE_UPF_RECEIVE) || \ | ||
- defined (USE_DLPI_RECEIVE) || defined (USE_LPF_RECEIVE) | ||
-# define PACKET_DECODING | ||
-#endif | ||
- | ||
/* If we don't have a DLPI packet filter, we have to filter in userland. | ||
Probably not worth doing, actually. */ | ||
#if defined (USE_DLPI_RECEIVE) && !defined (USE_DLPI_PFMOD) | ||
@@ -288,4 +169,124 @@ | ||
# define STDERR_FILENO 2 | ||
#endif | ||
|
||
+/* Porting:: | ||
+ | ||
+ If you add a new network API, you must add a check for it below: */ | ||
+ | ||
+#if !defined (USE_SOCKETS) && \ | ||
+ !defined (USE_SOCKET_SEND) && \ | ||
+ !defined (USE_SOCKET_RECEIVE) && \ | ||
+ !defined (USE_RAW_SOCKETS) && \ | ||
+ !defined (USE_RAW_SEND) && \ | ||
+ !defined (USE_SOCKET_RECEIVE) && \ | ||
+ !defined (USE_BPF) && \ | ||
+ !defined (USE_BPF_SEND) && \ | ||
+ !defined (USE_BPF_RECEIVE) && \ | ||
+ !defined (USE_LPF) && \ | ||
+ !defined (USE_LPF_SEND) && \ | ||
+ !defined (USE_LPF_RECEIVE) && \ | ||
+ !defined (USE_NIT) && \ | ||
+ !defined (USE_NIT_SEND) && \ | ||
+ !defined (USE_NIT_RECEIVE) && \ | ||
+ !defined (USE_DLPI_SEND) && \ | ||
+ !defined (USE_DLPI_RECEIVE) | ||
+/* Determine default socket API to USE. */ | ||
+# if defined(HAVE_BPF) | ||
+# define USE_BPF 1 | ||
+# elif defined(HAVE_LPF) | ||
+# define USE_LPF 1 | ||
+# elif defined(HAVE_DLPI) | ||
+# define USE_DLPI 1 | ||
+# endif | ||
+#endif | ||
+ | ||
+/* Porting:: | ||
+ | ||
+ If you add a new network API, and have it set up so that it can be | ||
+ used for sending or receiving, but doesn't have to be used for both, | ||
+ then set up an ifdef like the ones below: */ | ||
+ | ||
+#ifdef USE_SOCKETS | ||
+# define USE_SOCKET_SEND | ||
+# define USE_SOCKET_RECEIVE | ||
+# if defined(HAVE_DLPI) && !defined(sun) && !defined(USE_V4_PKTINFO) | ||
+# define USE_DLPI_HWADDR | ||
+# elif defined(HAVE_LPF) | ||
+# define USE_LPF_HWADDR | ||
+# elif defined(HAVE_BPF) | ||
+# define USE_BPF_HWADDR | ||
+# endif | ||
+#endif | ||
+ | ||
+#ifdef USE_RAW_SOCKETS | ||
+# define USE_RAW_SEND | ||
+# define USE_SOCKET_RECEIVE | ||
+#endif | ||
+ | ||
+#ifdef USE_BPF | ||
+# define USE_BPF_SEND | ||
+# define USE_BPF_RECEIVE | ||
+#endif | ||
+ | ||
+#ifdef USE_LPF | ||
+# define USE_LPF_SEND | ||
+# define USE_LPF_RECEIVE | ||
+#endif | ||
+ | ||
+#ifdef USE_NIT | ||
+# define USE_NIT_SEND | ||
+# define USE_NIT_RECEIVE | ||
+#endif | ||
+ | ||
+#ifdef USE_DLPI | ||
+# define USE_DLPI_SEND | ||
+# define USE_DLPI_RECEIVE | ||
+#endif | ||
+ | ||
+#ifdef USE_UPF | ||
+# define USE_UPF_SEND | ||
+# define USE_UPF_RECEIVE | ||
+#endif | ||
+ | ||
+/* Porting:: | ||
+ | ||
+ If you add support for sending packets directly out an interface, | ||
+ and your support does not do ARP or routing, you must use a fallback | ||
+ mechanism to deal with packets that need to be sent to routers. | ||
+ Currently, all low-level packet interfaces use BSD sockets as a | ||
+ fallback. */ | ||
+ | ||
+#if defined (USE_BPF_SEND) || defined (USE_NIT_SEND) || \ | ||
+ defined (USE_DLPI_SEND) || defined (USE_UPF_SEND) || \ | ||
+ defined (USE_LPF_SEND) || \ | ||
+ (defined (USE_SOCKET_SEND) && defined (HAVE_SO_BINDTODEVICE)) | ||
+# define USE_SOCKET_FALLBACK | ||
+# define USE_FALLBACK | ||
+#endif | ||
+ | ||
+/* Porting:: | ||
+ | ||
+ If you add support for sending packets directly out an interface | ||
+ and need to be able to assemble packets, add the USE_XXX_SEND | ||
+ definition for your interface to the list tested below. */ | ||
+ | ||
+#if defined (USE_RAW_SEND) || defined (USE_BPF_SEND) || \ | ||
+ defined (USE_NIT_SEND) || defined (USE_UPF_SEND) || \ | ||
+ defined (USE_DLPI_SEND) || defined (USE_LPF_SEND) | ||
+# define PACKET_ASSEMBLY | ||
+#endif | ||
+ | ||
+/* Porting:: | ||
+ | ||
+ If you add support for receiving packets directly from an interface | ||
+ and need to be able to decode raw packets, add the USE_XXX_RECEIVE | ||
+ definition for your interface to the list tested below. */ | ||
+ | ||
+#if defined (USE_RAW_RECEIVE) || defined (USE_BPF_SEND) || \ | ||
+ defined (USE_NIT_RECEIVE) || defined (USE_UPF_RECEIVE) || \ | ||
+ defined (USE_DLPI_RECEIVE) || defined (USE_LPF_RECEIVE) | ||
+# define PACKET_DECODING | ||
+#endif | ||
+ | ||
+ | ||
#endif /* __ISC_DHCP_OSDEP_H__ */ | ||
-- | ||
2.17.1 | ||
|
Oops, something went wrong.