This repository was archived by the owner on Jan 3, 2023. It is now read-only.
forked from sonoble/sonic-buildimage
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[lldpmgrd] Fix potential race condition when interfaces are created (s…
- Loading branch information
Showing
8 changed files
with
137 additions
and
25 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
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,12 +1,17 @@ | ||
# lldpd package | ||
|
||
LLDPD_VERSION = 0.9.5-0 | ||
LLDPD_VERSION = 0.9.5 | ||
|
||
LLDPD = lldpd_$(LLDPD_VERSION)_amd64.deb | ||
LLDPD = lldpd_$(LLDPD_VERSION)-0_amd64.deb | ||
$(LLDPD)_DEPENDS += $(LIBSNMP_DEV) | ||
$(LLDPD)_RDEPENDS += $(LIBSNMP) | ||
$(LLDPD)_SRC_PATH = $(SRC_PATH)/lldpd | ||
SONIC_DPKG_DEBS += $(LLDPD) | ||
SONIC_MAKE_DEBS += $(LLDPD) | ||
|
||
LIBLLDPCTL = liblldpctl-dev_$(LLDPD_VERSION)_amd64.deb | ||
LIBLLDPCTL = liblldpctl-dev_$(LLDPD_VERSION)-0_amd64.deb | ||
$(eval $(call add_derived_package,$(LLDPD),$(LIBLLDPCTL))) | ||
|
||
# Export these variables so they can be used in a sub-make | ||
export LLDPD_VERSION | ||
export LLDPD | ||
export LIBLLDPCTL |
Submodule lldpd
deleted from
396961
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,32 @@ | ||
.ONESHELL: | ||
SHELL = /bin/bash | ||
.SHELLFLAGS += -e | ||
|
||
MAIN_TARGET = $(LLDPD) | ||
DERIVED_TARGETS = $(LIBLLDPCTL) | ||
|
||
$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : | ||
# Remove any stale files | ||
rm -rf ./lldpd | ||
|
||
# Clone lldpd repo | ||
git clone https://github.com/vincentbernat/lldpd.git | ||
pushd ./lldpd | ||
|
||
# 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 $(LLDPD_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 packages to the destination directory | ||
mv $* $(DERIVED_TARGETS) $(DEST)/ | ||
|
||
$(addprefix $(DEST)/, $(DERIVED_TARGETS)): $(DEST)/% : $(DEST)/$(MAIN_TARGET) |
39 changes: 39 additions & 0 deletions
39
src/lldpd/patch/0001-return-error-when-port-does-not-exist.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,39 @@ | ||
From 15e692fb82a61203624829cdd872315211920077 Mon Sep 17 00:00:00 2001 | ||
From: Guohan Lu <[email protected]> | ||
Date: Tue, 6 Mar 2018 09:36:51 +0000 | ||
Subject: [PATCH] return error when port does not exist | ||
|
||
--- | ||
src/client/conf-lldp.c | 8 ++++++++ | ||
1 file changed, 8 insertions(+) | ||
|
||
diff --git a/src/client/conf-lldp.c b/src/client/conf-lldp.c | ||
index c16219b..b51e4eb 100644 | ||
--- a/src/client/conf-lldp.c | ||
+++ b/src/client/conf-lldp.c | ||
@@ -148,6 +148,8 @@ cmd_portid_type_local(struct lldpctl_conn_t *conn, struct writer *w, | ||
const char *name; | ||
const char *id = cmdenv_get(env, "port-id"); | ||
const char *descr = cmdenv_get(env, "port-descr"); | ||
+ const char *portname = cmdenv_get(env, "ports"); | ||
+ int find_port = 0; | ||
|
||
log_debug("lldpctl", "lldp PortID TLV Subtype Local port-id '%s' port-descr '%s'", id, descr); | ||
|
||
@@ -165,6 +167,12 @@ cmd_portid_type_local(struct lldpctl_conn_t *conn, struct writer *w, | ||
log_warnx("lldpctl", "unable to set LLDP Port Description for %s." | ||
" %s", name, lldpctl_last_strerror(conn)); | ||
} | ||
+ find_port = 1; | ||
+ } | ||
+ | ||
+ if (!find_port) { | ||
+ log_warnx("lldpctl", "cannot find port %s", portname); | ||
+ return 0; | ||
} | ||
|
||
return 1; | ||
-- | ||
2.7.4 | ||
|
||
|
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,2 @@ | ||
# This series applies on GIT commit 396961a038a38675d46f96eaa7b430b2a1f8701b | ||
0001-return-error-when-port-does-not-exist.patch |