jrfastab / lldpad Goto Github PK
View Code? Open in Web Editor NEWopen-lldp
License: Other
open-lldp
License: Other
Hi All,
On my system, lldp keeps crashing with the following error :
kernel: [1590523.105977] lldpad[17922]: segfault at c68 ip 000055f3a7de9c6a sp 00007ffc816b37c0 error 6 in lldpad[55f3a7dad000+60000]
lldpad.service: main process exited, code=killed, status=11/SEGV
Unit lldpad.service entered failed state.
Version : lldpad-1.0.1-5.1.git036e314.el7.centos.x86_64
We create lots of veth pairs and delete them at certain intervals. I see all these transient interfaces in lldpad.conf, but they are not removed.
lldpad adds all interfaces to lldpad.conf, but they are not cleaned when the interfaces are deleted. If the interfaces are virtual ethernets that are transient, the interfaces are not removed. This causes the lldpad.conf to keep growing.
lldp scan this list for changes to all the listed interfaces. This is causing the lldp to crash. Has there been a fix for this in latest releases ?
Thanks,
Srijit
Man page at https://linux.die.net/man/8/lldptool-pfc claims this should work.
But I get a segfault at
(gdb) bt
#0 0x000000000040a993 in get_arg_val_list (ibuf=0x7fffffffc2cd "07enabled",
ilen=14, ioff=0x7fffffffb12c, args=0x6163e0, argvals=0x6163c0)
at lldp_util.c:1239
#1 0x0000000000403c86 in print_arg_value (ibuf=0x7fffffffc2cd "07enabled")
at lldptool_cmds.c:406
#2 0x0000000000403d65 in print_tlvs (cmd=0x7fffffffb1e0,
ibuf=0x7fffffffc2cd "07enabled") at lldptool_cmds.c:436
#3 0x0000000000404225 in print_cmd_response (
ibuf=0x7fffffffc2b3 "C3010000001504eth10080c20b07enabled", status=0)
at lldptool_cmds.c:559
#4 0x000000000040432a in print_response (
buf=0x7fffffffc2b0 "R00C3010000001504eth10080c20b07enabled", status=0)
at lldptool_cmds.c:591
#5 0x0000000000401f6c in parse_print_message (
msg=0x7fffffffc2b0 "R00C3010000001504eth10080c20b07enabled", print=1)
at lldptool.c:280
#6 0x0000000000402142 in _clif_command (clif=0x616010,
cmd=0x7fffffffd3d2 "M00000001C3010000001504eth1000080c20b07enabled",
print=1) at lldptool.c:337
#7 0x0000000000402180 in clif_command (clif=0x616010,
cmd=0x7fffffffd3d2 "M00000001C3010000001504eth1000080c20b07enabled", raw=0)
at lldptool.c:346
#8 0x000000000040359d in cli_cmd_gettlv (clif=0x616010, argc=1,
argv=0x7fffffffe590, cmd=0x7fffffffd3b0, raw=0) at lldptool_cmds.c:177
#9 0x0000000000402a5a in request (clif=0x616010, argc=8, argv=0x7fffffffe558)
at lldptool.c:643
#10 0x0000000000402f5f in main (argc=8, argv=0x7fffffffe558) at lldptool.c:796
Sounds like this needs
--- a/lldp_util.c
+++ b/lldp_util.c
@@ -1207,7 +1207,7 @@ int get_arg_val_list(char *ibuf, int ilen, int *ioff,
}
hexstr2bin(ibuf+*ioff, &arglen, sizeof(arglen));
*ioff += 2 * (int)sizeof(arglen);
if (ilen - *ioff >= arglen) {
if (ilen - *ioff >= 0) {
args[i] = ibuf+*ioff;
*ioff += arglen;
*(arglens+i) = arglen;
@@ -1217,7 +1217,7 @@ int get_arg_val_list(char *ibuf, int ilen, int *ioff,
sizeof(argvalue_len));
argvalue_len = ntohs(argvalue_len);
ioff += 2sizeof(argvalue_len);
if (ilen - *ioff >= argvalue_len) {
if (ilen - *ioff >= 0) {
argvals[i] = ibuf+*ioff;
*ioff += argvalue_len;
*(argvallens+i) = argvalue_len;
But given that the existing code has cuss-words like ibuf+*ioff
(spaces are free, you know?) one can never tell what the author was thinking.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.