diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2015-05-28 16:19:38 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2015-05-28 16:19:38 +0000 |
commit | 8df45565e92a1712f5e25d101104319a4c5dcf7f (patch) | |
tree | fba4e19a5c05a909b4fb825c13ef543adc91f011 /package/network/services/lldpd/patches/100-os-release.patch | |
parent | 7d44f7630f172047c6e936bc3caef61005abc779 (diff) | |
download | master-31e0f0ae-8df45565e92a1712f5e25d101104319a4c5dcf7f.tar.gz master-31e0f0ae-8df45565e92a1712f5e25d101104319a4c5dcf7f.tar.bz2 master-31e0f0ae-8df45565e92a1712f5e25d101104319a4c5dcf7f.zip |
lldpd: update to v0.7.15 and add support for parsing /etc/openwrt_release
Also drop superseded patches.
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
SVN-Revision: 45810
Diffstat (limited to 'package/network/services/lldpd/patches/100-os-release.patch')
-rw-r--r-- | package/network/services/lldpd/patches/100-os-release.patch | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/package/network/services/lldpd/patches/100-os-release.patch b/package/network/services/lldpd/patches/100-os-release.patch new file mode 100644 index 0000000000..a906f39f6e --- /dev/null +++ b/package/network/services/lldpd/patches/100-os-release.patch @@ -0,0 +1,39 @@ +Index: lldpd-0.7.15/src/daemon/lldpd.c +=================================================================== +--- lldpd-0.7.15.orig/src/daemon/lldpd.c ++++ lldpd-0.7.15/src/daemon/lldpd.c +@@ -736,6 +736,10 @@ lldpd_get_os_release() { + fp = fopen("/usr/lib/os-release", "r"); + } + if (!fp) { ++ log_debug("localchassis", "could not open /usr/lib/os-release"); ++ fp = fopen("/etc/openwrt_release", "r"); ++ } ++ if (!fp) { + log_info("localchassis", + "could not open either /etc/os-release or /usr/lib/os-release"); + return NULL; +@@ -745,7 +749,8 @@ lldpd_get_os_release() { + key = strtok(line, "="); + val = strtok(NULL, "="); + +- if (strncmp(key, "PRETTY_NAME", sizeof(line)) == 0) { ++ if (strncmp(key, "PRETTY_NAME", sizeof(line)) == 0 || ++ strncmp(key, "DISTRIB_DESCRIPTION", sizeof(line)) == 0) { + strlcpy(release, val, sizeof(line)); + break; + } +@@ -755,11 +760,11 @@ lldpd_get_os_release() { + /* Remove trailing newline and all " in the string. */ + ptr1 = release + strlen(release) - 1; + while (ptr1 != release && +- ((*ptr1 == '"') || (*ptr1 == '\n'))) { ++ ((*ptr1 == '"') || (*ptr1 == '\n') || (*ptr1 == '\''))) { + *ptr1 = '\0'; + ptr1--; + } +- if (release[0] == '"') ++ if (release[0] == '"' || release[0] == '\'') + return release+1; + return release; + } |