Skip to content

Commit

Permalink
[docker-dhcprelay]: Update to Bullseye (#9736)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
saiarcot895 authored Jan 18, 2022
1 parent 4076194 commit bb33627
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 57 deletions.
2 changes: 1 addition & 1 deletion dockers/docker-dhcp-relay/Dockerfile.j2
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% 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 image_version
Expand Down
9 changes: 3 additions & 6 deletions rules/docker-dhcp-relay.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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)_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_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_DEBS = $(PYTHON3_SWSSCOMMON)
Expand Down Expand Up @@ -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)_FILES += $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT)

SONIC_BUSTER_DOCKERS += $(DOCKER_DHCP_RELAY)
SONIC_BUSTER_DBG_DOCKERS += $(DOCKER_DHCP_RELAY_DBG)
2 changes: 1 addition & 1 deletion rules/isc-dhcp.mk
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# isc-dhcp packages

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

Expand Down
36 changes: 20 additions & 16 deletions sonic-slave-bullseye/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -323,22 +323,22 @@ RUN apt-get update && apt-get install -y \
# For kdump-tools
libbz2-dev \
# For linkmgrd
libboost1.74-dev \
libboost-program-options1.74-dev \
libboost-system1.74-dev \
libboost-thread1.74-dev \
libboost-atomic1.74-dev \
libboost-chrono1.74-dev \
libboost-container1.74-dev \
libboost-context1.74-dev \
libboost-contract1.74-dev \
libboost-coroutine1.74-dev \
libboost-date-time1.74-dev \
libboost-fiber1.74-dev \
libboost-filesystem1.74-dev \
libboost-graph-parallel1.74-dev \
libboost-log1.74-dev \
libboost-regex1.74-dev \
libboost-dev \
libboost-program-options-dev \
libboost-system-dev \
libboost-thread-dev \
libboost-atomic-dev \
libboost-chrono-dev \
libboost-container-dev \
libboost-context-dev \
libboost-contract-dev \
libboost-coroutine-dev \
libboost-date-time-dev \
libboost-fiber-dev \
libboost-filesystem-dev \
libboost-graph-parallel-dev \
libboost-log-dev \
libboost-regex-dev \
googletest \
libgtest-dev \
libgcc-10-dev \
Expand Down Expand Up @@ -481,6 +481,10 @@ EXPOSE 22
RUN git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git /usr/share/depot_tools
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
RUN apt-get update
RUN apt-get install -y \
Expand Down
2 changes: 1 addition & 1 deletion src/dhcp6relay/debian/compat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9
12
7 changes: 2 additions & 5 deletions src/dhcp6relay/debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@ Source: sonic-dhcp6relay
Section: devel
Priority: optional
Maintainer: Kelly Yeh <[email protected]>
Build-Depends: debhelper (>= 8.0.0),
dh-systemd
Build-Depends: debhelper (>= 12.0.0), libevent-dev, libboost-thread-dev, libboost-system-dev, libswsscommon-dev
Standards-Version: 3.9.3
Homepage: https://github.com/Azure/sonic-buildimage
XS-Go-Import-Path: github.com/Azure/sonic-buildimage

Package: sonic-dhcp6relay
Architecture: any
Built-Using: ${misc:Built-Using}
Depends: libevent-2.1-6,
libboost-thread1.71.0,
libboost-system1.71.0
Depends: ${shlibs:Depends}
Description: SONiC DHCPv6 Relay
2 changes: 1 addition & 1 deletion src/dhcpmon/debian/compat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9
12
6 changes: 2 additions & 4 deletions src/dhcpmon/debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@ Source: sonic-dhcpmon
Section: devel
Priority: optional
Maintainer: Tamer Ahmed <[email protected]>
Build-Depends: debhelper (>= 8.0.0),
dh-systemd
Build-Depends: debhelper (>= 12.0.0), libevent-dev, libexplain-dev
Standards-Version: 3.9.3
Homepage: https://github.com/Azure/sonic-buildimage
XS-Go-Import-Path: github.com/Azure/sonic-buildimage

Package: sonic-dhcpmon
Architecture: any
Built-Using: ${misc:Built-Using}
Depends: libexplain51,
libevent-2.1-6
Depends: ${shlibs:Depends}
Description: SONiC DHCP Monitor
16 changes: 8 additions & 8 deletions src/isc-dhcp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ DERIVED_TARGETS = $(ISC_DHCP_RELAY_DBG)

$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
# Remove any stale files
rm -rf ./isc-dhcp
rm -rf ./isc-dhcp-$(ISC_DHCP_VERSION)

# Clone isc-dhcp repo
git clone https://salsa.debian.org/dhcp-team/isc-dhcp.git
pushd ./isc-dhcp
# Get isc-dhcp release, debian files
dget http://deb.debian.org/debian/pool/main/i/isc-dhcp/isc-dhcp_$(ISC_DHCP_VERSION_FULL).dsc
pushd ./isc-dhcp-$(ISC_DHCP_VERSION)

# Reset HEAD to the commit of the proper tag
# NOTE: Using "git checkout <tag_name>" here detaches our HEAD,
# which stg doesn't like, so we use this method instead
git reset --hard debian/$(ISC_DHCP_VERSION_FULL)
# Create a git repository here for stg to apply patches
git init
git add -f *
git commit -qm "initial commit"

# Apply patches
stg init
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,20 +165,7 @@ diff --git a/relay/dhcrelay.c b/relay/dhcrelay.c
index 221106a..c44a79d 100644
--- a/relay/dhcrelay.c
+++ b/relay/dhcrelay.c
@@ -97,6 +97,12 @@ struct downstream_intf_list {
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) {
@@ -431,6 +431,8 @@ main(int argc, char **argv) {
#endif
} else if (!strcmp(argv[i], "-d")) {
/* no_daemon = 1; */
Expand Down

0 comments on commit bb33627

Please sign in to comment.