From fb8f09a116d4d9f2dce23da5e081c5e71813f00e Mon Sep 17 00:00:00 2001 From: Joe LeVeque Date: Tue, 1 Sep 2020 13:53:36 -0700 Subject: [PATCH] [radvd] No longer build from source; Install vanilla Debian package once again (#5242) Remove radvd Makefile and patch, change docker-router-advertiser Dockerfile template to simply install the vanilla radvd package using apt-get. - In PR https://github.com/Azure/sonic-buildimage/pull/2795, we started building radvd from source and patching it to prevent it from erroring out when advertising an MTU of 9100 which was greater than the MTU size configured on the bridge interface (1500), which was due to a limitation in the 4.9 Linux kernel. - Master branch is now using Linux kernel 4.19. As of 4.18, the kernel supports setting a bridge MTU to a value > 1500. - PR https://github.com/Azure/sonic-swss/pull/1393 modified vlanmgrd to take advantage of this and now configures the MTU of bridge interfaces in SONiC to the proper size of 9100. Therefore, we no longer need to patch radvd. Since we no longer need to patch radvd, we no longer need to build it from source, so we can save build time by going back to simply installing the vanilla radvd Debian package in the router-advertiser container. --- .../docker-router-advertiser/Dockerfile.j2 | 3 ++ rules/docker-router-advertiser.mk | 1 - rules/radvd.dep | 10 ------ rules/radvd.mk | 17 ---------- src/radvd/.gitignore | 4 --- src/radvd/Makefile | 32 ------------------ ...t-treat-out-of-range-MTU-as-an-error.patch | 33 ------------------- src/radvd/patch/series | 2 -- 8 files changed, 3 insertions(+), 99 deletions(-) delete mode 100644 rules/radvd.dep delete mode 100644 rules/radvd.mk delete mode 100644 src/radvd/.gitignore delete mode 100644 src/radvd/Makefile delete mode 100644 src/radvd/patch/0001-Don-t-treat-out-of-range-MTU-as-an-error.patch delete mode 100644 src/radvd/patch/series diff --git a/dockers/docker-router-advertiser/Dockerfile.j2 b/dockers/docker-router-advertiser/Dockerfile.j2 index 1d5a9acc43..3896286556 100644 --- a/dockers/docker-router-advertiser/Dockerfile.j2 +++ b/dockers/docker-router-advertiser/Dockerfile.j2 @@ -10,6 +10,9 @@ ENV DEBIAN_FRONTEND=noninteractive # Update apt's cache of available packages RUN apt-get update +# Install radvd Debian package +RUN apt-get -y install radvd=1:2.17-2 + {% if docker_router_advertiser_debs.strip() -%} # Copy built Debian packages {{ copy_files("debs/", docker_router_advertiser_debs.split(' '), "/debs/") }} diff --git a/rules/docker-router-advertiser.mk b/rules/docker-router-advertiser.mk index 11549815e2..3b9f7ae8ba 100644 --- a/rules/docker-router-advertiser.mk +++ b/rules/docker-router-advertiser.mk @@ -6,7 +6,6 @@ DOCKER_ROUTER_ADVERTISER_DBG = $(DOCKER_ROUTER_ADVERTISER_STEM)-$(DBG_IMAGE_MARK $(DOCKER_ROUTER_ADVERTISER)_PATH = $(DOCKERS_PATH)/$(DOCKER_ROUTER_ADVERTISER_STEM) -$(DOCKER_ROUTER_ADVERTISER)_DEPENDS += $(RADVD) $(DOCKER_ROUTER_ADVERTISER)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_BUSTER)_DBG_DEPENDS) $(DOCKER_ROUTER_ADVERTISER)_DBG_DEPENDS += $(RADVD_DBG) diff --git a/rules/radvd.dep b/rules/radvd.dep deleted file mode 100644 index 457a74becc..0000000000 --- a/rules/radvd.dep +++ /dev/null @@ -1,10 +0,0 @@ - -SPATH := $($(RADVD)_SRC_PATH) -DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/radvd.mk rules/radvd.dep -DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) -DEP_FILES += $(shell git ls-files $(SPATH)) - -$(RADVD)_CACHE_MODE := GIT_CONTENT_SHA -$(RADVD)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) -$(RADVD)_DEP_FILES := $(DEP_FILES) - diff --git a/rules/radvd.mk b/rules/radvd.mk deleted file mode 100644 index f0a0482804..0000000000 --- a/rules/radvd.mk +++ /dev/null @@ -1,17 +0,0 @@ -# radvd package - -RADVD_VERSION = 2.17-2 - -export RADVD_VERSION - -RADVD = radvd_$(RADVD_VERSION)_$(CONFIGURED_ARCH).deb -$(RADVD)_SRC_PATH = $(SRC_PATH)/radvd -SONIC_MAKE_DEBS += $(RADVD) - -RADVD_DBG = radvd-dbgsym_$(RADVD_VERSION)_$(CONFIGURED_ARCH).deb -$(eval $(call add_derived_package,$(RADVD),$(RADVD_DBG))) - -# The .c, .cpp, .h & .hpp files under src/{$DBG_SRC_ARCHIVE list} -# are archived into debug one image to facilitate debugging. -# -DBG_SRC_ARCHIVE += radvd diff --git a/src/radvd/.gitignore b/src/radvd/.gitignore deleted file mode 100644 index d19db76ab9..0000000000 --- a/src/radvd/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -* -!.gitignore -!Makefile -!patch/ diff --git a/src/radvd/Makefile b/src/radvd/Makefile deleted file mode 100644 index 98e62bc216..0000000000 --- a/src/radvd/Makefile +++ /dev/null @@ -1,32 +0,0 @@ -.ONESHELL: -SHELL = /bin/bash -.SHELLFLAGS += -e - -MAIN_TARGET = radvd_$(RADVD_VERSION)_$(CONFIGURED_ARCH).deb -DERIVED_TARGETS = radvd-dbgsym_$(RADVD_VERSION)_$(CONFIGURED_ARCH).deb - -$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : - # Remove any stale files - rm -rf ./radvd - - # Clone radvd repo - git clone https://salsa.debian.org/debian/radvd.git - pushd ./radvd - - # Reset HEAD to the commit of the proper tag - # NOTE: Using "git checkout " here detaches our HEAD, - # which stg doesn't like, so we use this method instead - # NOTE 1: For some reason, tags in the Debian radvd repo are prefixed with "1%" - # NOTE 2: "~" in version string is replaced by "_" in branch name - git reset --hard debian/1\%$(subst ~,_,$(RADVD_VERSION)) - - # Apply patches - stg init - stg import -s ../patch/series - - # Build source and Debian packages - dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) - popd - - # Move the newly-built .deb package to the destination directory - mv $(DERIVED_TARGETS) $* $(DEST)/ diff --git a/src/radvd/patch/0001-Don-t-treat-out-of-range-MTU-as-an-error.patch b/src/radvd/patch/0001-Don-t-treat-out-of-range-MTU-as-an-error.patch deleted file mode 100644 index a9f988fee5..0000000000 --- a/src/radvd/patch/0001-Don-t-treat-out-of-range-MTU-as-an-error.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 45c15407f11de8b1064b77212727e5234f3ef1e8 Mon Sep 17 00:00:00 2001 -From: Joe LeVeque -Date: Sat, 16 Feb 2019 02:59:10 +0000 -Subject: [PATCH] Don't treat out-of-range MTU as an error - ---- - interface.c | 9 +++++++-- - 1 file changed, 7 insertions(+), 2 deletions(-) - -diff --git a/interface.c b/interface.c -index 512f2bd..0dc19f4 100644 ---- a/interface.c -+++ b/interface.c -@@ -200,9 +200,14 @@ int check_iface(struct Interface *iface) - - if ((iface->AdvLinkMTU != 0) && ((iface->AdvLinkMTU < MIN_AdvLinkMTU) || - (iface->sllao.if_maxmtu != -1 && (iface->AdvLinkMTU > iface->sllao.if_maxmtu)))) { -- flog(LOG_ERR, "AdvLinkMTU for %s (%u) must be zero or between %u and %u", iface->props.name, iface->AdvLinkMTU, -+ // FIXME: Temporary workaround for SONiC. Currently, when interfaces are added -+ // or removed from VLANs, the kernel sets the MTU size for the VLAN to the -+ // default value of 1500. Here, we prevent radvd from treating a larger value -+ // in its configuration as an error. Instead of logging an error and setting -+ // res to -1, we simply log a warning and continue on. Once the aforementioned -+ // behavior is addressed, this patch should be removed. -+ flog(LOG_WARNING, "AdvLinkMTU for %s (%u) must be zero or between %u and %u", iface->props.name, iface->AdvLinkMTU, - MIN_AdvLinkMTU, iface->sllao.if_maxmtu); -- res = -1; - } - - if (iface->ra_header_info.AdvReachableTime > MAX_AdvReachableTime) { --- -2.17.1 - diff --git a/src/radvd/patch/series b/src/radvd/patch/series deleted file mode 100644 index 7a12163dc0..0000000000 --- a/src/radvd/patch/series +++ /dev/null @@ -1,2 +0,0 @@ -# This series applies on GIT commit 413616c1b6a05f07f07f3ee6af0cf25a3215fe1a -0001-Don-t-treat-out-of-range-MTU-as-an-error.patch