[docker-dhcprelay]: Update to Bullseye (#9736)

As part of this, update the isc-dhcp package to match the Bullseye
version (this fixes some compile errors related to BIND), clean up some
of the build dependencies and runtime dependencies for debian packaging,
and use the default Boost version to compile against instead of
explicitly saying using 1.74.

Signed-off-by: Saikrishna Arcot <sarcot@microsoft.com>
This commit is contained in:
Saikrishna Arcot 2022-01-18 15:11:36 -08:00 committed by GitHub
parent 40761941d4
commit bb3362760d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 40 additions and 57 deletions

View File

@ -1,5 +1,5 @@
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %} {% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %}
FROM docker-config-engine-buster FROM docker-config-engine-bullseye
ARG docker_container_name ARG docker_container_name
ARG image_version ARG image_version

View File

@ -8,12 +8,12 @@ $(DOCKER_DHCP_RELAY)_PATH = $(DOCKERS_PATH)/$(DOCKER_DHCP_RELAY_STEM)
$(DOCKER_DHCP_RELAY)_DEPENDS += $(ISC_DHCP_RELAY) $(SONIC_DHCPMON) $(SONIC_DHCP6RELAY) $(LIBSWSSCOMMON) $(DOCKER_DHCP_RELAY)_DEPENDS += $(ISC_DHCP_RELAY) $(SONIC_DHCPMON) $(SONIC_DHCP6RELAY) $(LIBSWSSCOMMON)
$(DOCKER_DHCP_RELAY)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_BUSTER)_DBG_DEPENDS) $(DOCKER_DHCP_RELAY)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_BULLSEYE)_DBG_DEPENDS)
$(DOCKER_DHCP_RELAY)_DBG_DEPENDS += $(ISC_DHCP_RELAY_DBG) $(SONIC_DHCP6RELAY_DBG) $(DOCKER_DHCP_RELAY)_DBG_DEPENDS += $(ISC_DHCP_RELAY_DBG) $(SONIC_DHCP6RELAY_DBG)
$(DOCKER_DHCP_RELAY)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_BUSTER)_DBG_IMAGE_PACKAGES) $(DOCKER_DHCP_RELAY)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_BULLSEYE)_DBG_IMAGE_PACKAGES)
$(DOCKER_DHCP_RELAY)_LOAD_DOCKERS = $(DOCKER_CONFIG_ENGINE_BUSTER) $(DOCKER_DHCP_RELAY)_LOAD_DOCKERS = $(DOCKER_CONFIG_ENGINE_BULLSEYE)
$(DOCKER_DHCP_RELAY)_INSTALL_PYTHON_WHEELS = $(SONIC_UTILITIES_PY3) $(DOCKER_DHCP_RELAY)_INSTALL_PYTHON_WHEELS = $(SONIC_UTILITIES_PY3)
$(DOCKER_DHCP_RELAY)_INSTALL_DEBS = $(PYTHON3_SWSSCOMMON) $(DOCKER_DHCP_RELAY)_INSTALL_DEBS = $(PYTHON3_SWSSCOMMON)
@ -56,6 +56,3 @@ $(DOCKER_DHCP_RELAY)_CLI_SHOW_PLUGIN = /cli/show/plugins/show_dhcp_relay.py
$(DOCKER_DHCP_RELAY)_CLI_CLEAR_PLUGIN = /cli/clear/plugins/clear_dhcp6relay_counter.py $(DOCKER_DHCP_RELAY)_CLI_CLEAR_PLUGIN = /cli/clear/plugins/clear_dhcp6relay_counter.py
$(DOCKER_DHCP_RELAY)_FILES += $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT) $(DOCKER_DHCP_RELAY)_FILES += $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT)
SONIC_BUSTER_DOCKERS += $(DOCKER_DHCP_RELAY)
SONIC_BUSTER_DBG_DOCKERS += $(DOCKER_DHCP_RELAY_DBG)

View File

@ -1,7 +1,7 @@
# isc-dhcp packages # isc-dhcp packages
ISC_DHCP_VERSION = 4.4.1 ISC_DHCP_VERSION = 4.4.1
ISC_DHCP_VERSION_FULL = ${ISC_DHCP_VERSION}-2 ISC_DHCP_VERSION_FULL = ${ISC_DHCP_VERSION}-2.3
export ISC_DHCP_VERSION ISC_DHCP_VERSION_FULL export ISC_DHCP_VERSION ISC_DHCP_VERSION_FULL

View File

@ -323,22 +323,22 @@ RUN apt-get update && apt-get install -y \
# For kdump-tools # For kdump-tools
libbz2-dev \ libbz2-dev \
# For linkmgrd # For linkmgrd
libboost1.74-dev \ libboost-dev \
libboost-program-options1.74-dev \ libboost-program-options-dev \
libboost-system1.74-dev \ libboost-system-dev \
libboost-thread1.74-dev \ libboost-thread-dev \
libboost-atomic1.74-dev \ libboost-atomic-dev \
libboost-chrono1.74-dev \ libboost-chrono-dev \
libboost-container1.74-dev \ libboost-container-dev \
libboost-context1.74-dev \ libboost-context-dev \
libboost-contract1.74-dev \ libboost-contract-dev \
libboost-coroutine1.74-dev \ libboost-coroutine-dev \
libboost-date-time1.74-dev \ libboost-date-time-dev \
libboost-fiber1.74-dev \ libboost-fiber-dev \
libboost-filesystem1.74-dev \ libboost-filesystem-dev \
libboost-graph-parallel1.74-dev \ libboost-graph-parallel-dev \
libboost-log1.74-dev \ libboost-log-dev \
libboost-regex1.74-dev \ libboost-regex-dev \
googletest \ googletest \
libgtest-dev \ libgtest-dev \
libgcc-10-dev \ libgcc-10-dev \
@ -481,6 +481,10 @@ EXPOSE 22
RUN git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git /usr/share/depot_tools RUN git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git /usr/share/depot_tools
ENV PATH /usr/share/depot_tools:$PATH ENV PATH /usr/share/depot_tools:$PATH
# Install dependencies for dhcp relay test
RUN pip3 install parameterized==0.8.1
RUN pip3 install pyfakefs
# Install docker engine 20.10 inside docker and enable experimental feature # Install docker engine 20.10 inside docker and enable experimental feature
RUN apt-get update RUN apt-get update
RUN apt-get install -y \ RUN apt-get install -y \

View File

@ -1 +1 @@
9 12

View File

@ -2,8 +2,7 @@ Source: sonic-dhcp6relay
Section: devel Section: devel
Priority: optional Priority: optional
Maintainer: Kelly Yeh <kellyyeh@microsoft.com> Maintainer: Kelly Yeh <kellyyeh@microsoft.com>
Build-Depends: debhelper (>= 8.0.0), Build-Depends: debhelper (>= 12.0.0), libevent-dev, libboost-thread-dev, libboost-system-dev, libswsscommon-dev
dh-systemd
Standards-Version: 3.9.3 Standards-Version: 3.9.3
Homepage: https://github.com/Azure/sonic-buildimage Homepage: https://github.com/Azure/sonic-buildimage
XS-Go-Import-Path: github.com/Azure/sonic-buildimage XS-Go-Import-Path: github.com/Azure/sonic-buildimage
@ -11,7 +10,5 @@ XS-Go-Import-Path: github.com/Azure/sonic-buildimage
Package: sonic-dhcp6relay Package: sonic-dhcp6relay
Architecture: any Architecture: any
Built-Using: ${misc:Built-Using} Built-Using: ${misc:Built-Using}
Depends: libevent-2.1-6, Depends: ${shlibs:Depends}
libboost-thread1.71.0,
libboost-system1.71.0
Description: SONiC DHCPv6 Relay Description: SONiC DHCPv6 Relay

View File

@ -1 +1 @@
9 12

View File

@ -2,8 +2,7 @@ Source: sonic-dhcpmon
Section: devel Section: devel
Priority: optional Priority: optional
Maintainer: Tamer Ahmed <tamer.ahmed@microsoft.com> Maintainer: Tamer Ahmed <tamer.ahmed@microsoft.com>
Build-Depends: debhelper (>= 8.0.0), Build-Depends: debhelper (>= 12.0.0), libevent-dev, libexplain-dev
dh-systemd
Standards-Version: 3.9.3 Standards-Version: 3.9.3
Homepage: https://github.com/Azure/sonic-buildimage Homepage: https://github.com/Azure/sonic-buildimage
XS-Go-Import-Path: github.com/Azure/sonic-buildimage XS-Go-Import-Path: github.com/Azure/sonic-buildimage
@ -11,6 +10,5 @@ XS-Go-Import-Path: github.com/Azure/sonic-buildimage
Package: sonic-dhcpmon Package: sonic-dhcpmon
Architecture: any Architecture: any
Built-Using: ${misc:Built-Using} Built-Using: ${misc:Built-Using}
Depends: libexplain51, Depends: ${shlibs:Depends}
libevent-2.1-6
Description: SONiC DHCP Monitor Description: SONiC DHCP Monitor

View File

@ -7,16 +7,16 @@ DERIVED_TARGETS = $(ISC_DHCP_RELAY_DBG)
$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
# Remove any stale files # Remove any stale files
rm -rf ./isc-dhcp rm -rf ./isc-dhcp-$(ISC_DHCP_VERSION)
# Clone isc-dhcp repo # Get isc-dhcp release, debian files
git clone https://salsa.debian.org/dhcp-team/isc-dhcp.git dget http://deb.debian.org/debian/pool/main/i/isc-dhcp/isc-dhcp_$(ISC_DHCP_VERSION_FULL).dsc
pushd ./isc-dhcp pushd ./isc-dhcp-$(ISC_DHCP_VERSION)
# Reset HEAD to the commit of the proper tag # Create a git repository here for stg to apply patches
# NOTE: Using "git checkout <tag_name>" here detaches our HEAD, git init
# which stg doesn't like, so we use this method instead git add -f *
git reset --hard debian/$(ISC_DHCP_VERSION_FULL) git commit -qm "initial commit"
# Apply patches # Apply patches
stg init stg init

View File

@ -165,20 +165,7 @@ diff --git a/relay/dhcrelay.c b/relay/dhcrelay.c
index 221106a..c44a79d 100644 index 221106a..c44a79d 100644
--- a/relay/dhcrelay.c --- a/relay/dhcrelay.c
+++ b/relay/dhcrelay.c +++ b/relay/dhcrelay.c
@@ -97,6 +97,12 @@ struct downstream_intf_list { @@ -431,6 +431,8 @@ main(int argc, char **argv) {
isc_boolean_t use_if_id = ISC_FALSE;
#endif
+/*
+ * If not set, kernel chooses what the src ip is.
+ * If set, uses "from" interface IP for packet Tx.
+ */
+extern int use_src_intf_ip_for_tx = 0;
+
/* Maximum size of a packet with agent options added. */
int dhcp_max_agent_option_packet_length = DHCP_MTU_MIN;
@@ -431,6 +437,8 @@ main(int argc, char **argv) {
#endif #endif
} else if (!strcmp(argv[i], "-d")) { } else if (!strcmp(argv[i], "-d")) {
/* no_daemon = 1; */ /* no_daemon = 1; */