Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[radvd] Build radvd from source; Patch so as not to treat out-of-range MTU as an error #2795

Merged
merged 2 commits into from
Apr 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ src/python-click/*
!src/python-click/Makefile
src/python3/*
!src/python3/Makefile
src/radvd/*
!src/radvd/Makefile
!src/radvd/patch/
src/redis/*
!src/redis/Makefile
src/snmpd/*
Expand Down
3 changes: 0 additions & 3 deletions dockers/docker-router-advertiser/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ 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

{% if docker_router_advertiser_debs.strip() -%}
# Copy built Debian packages
{%- for deb in docker_router_advertiser_debs.split(' ') %}
Expand Down
2 changes: 1 addition & 1 deletion rules/docker-router-advertiser.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

DOCKER_ROUTER_ADVERTISER = docker-router-advertiser.gz
$(DOCKER_ROUTER_ADVERTISER)_PATH = $(DOCKERS_PATH)/docker-router-advertiser
$(DOCKER_ROUTER_ADVERTISER)_DEPENDS += $(REDIS_TOOLS)
$(DOCKER_ROUTER_ADVERTISER)_DEPENDS += $(RADVD) $(REDIS_TOOLS)
$(DOCKER_ROUTER_ADVERTISER)_LOAD_DOCKERS = $(DOCKER_CONFIG_ENGINE_STRETCH)
SONIC_DOCKER_IMAGES += $(DOCKER_ROUTER_ADVERTISER)
SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_ROUTER_ADVERTISER)
Expand Down
10 changes: 10 additions & 0 deletions rules/radvd.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# radvd package

RADVD_VERSION = 2.17-2~bpo9+1

export RADVD_VERSION

RADVD = radvd_$(RADVD_VERSION)_amd64.deb
$(RADVD)_SRC_PATH = $(SRC_PATH)/radvd
SONIC_MAKE_DEBS += $(RADVD)
SONIC_STRETCH_DEBS += $(RADVD)
31 changes: 31 additions & 0 deletions src/radvd/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
.ONESHELL:
SHELL = /bin/bash
.SHELLFLAGS += -e

MAIN_TARGET = radvd_$(RADVD_VERSION)_amd64.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 <tag_name>" 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 $* $(DEST)/
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
From 45c15407f11de8b1064b77212727e5234f3ef1e8 Mon Sep 17 00:00:00 2001
From: Joe LeVeque <jolevequ@microsoft.com>
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

2 changes: 2 additions & 0 deletions src/radvd/patch/series
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# This series applies on GIT commit 413616c1b6a05f07f07f3ee6af0cf25a3215fe1a
0001-Don-t-treat-out-of-range-MTU-as-an-error.patch