❦ 5 octobre 2013 12:55 CEST, Michael Braun <michael-...@fami-braun.de> :
> I'm running lldpd and tried to identify the local switchport by running > lldpctl. > However, lldpctl just hands. Tracing lldpd and lldpctl, it looks like lldpctl > sends a message to lldpd and lldpd then discards the message (the message is > received unmodified) with the following error: > > select(8, [6 7], NULL, NULL, {23, 239245}) = 1 (in [7], left {20, 944351}) > recvfrom(7, > "\1\200\302\0\0\16x\254\300\344\376{\210\314\2\7\4x\254\300\344\356\0\4\4\007133\6\2\0"..., > 1500, 0, {sa_family=AF_PACKET, proto=0x88cc, if2, pkttype=PACKET_MULTICAST, > addr(6)={1, 78acc0e4fe7b}, [18]) = 276 > time(NULL) = 1380970074 > time(NULL) = 1380970074 > select(8, [6 7], NULL, NULL, {21, 0}^C <unfinished ...> > Process 9127 detached > root@logserver:~# strace -f -p 9127 -s 65535 > Process 9127 attached - interrupt to quit > select(8, [6 7], NULL, NULL, {14, 301586}) = 1 (in [6], left {7, 351326}) > accept(6, 0, NULL) = 8 > time(NULL) = 1380970088 > select(9, [6 7 8], NULL, NULL, {7, 0}) = 1 (in [8], left {6, 999068}) > recv(8, "\1\0\0\0\0\0\335#\0\0", 8192, 0) = 10 > time(NULL) = 1380970088 > send(3, "<26>Oct 5 12:48:08 lldpd[9127]: client_handle_client: too short > message request received", 89, MSG_NOSIGNAL) = 89 > time(NULL) = 1380970088 > select(9, [6 7 8], NULL, NULL, {7, 0}) = 1 (in [8], left {5, 140363}) > recv(8, "", 8192, 0) = 0 > close(8) = 0 > time(NULL) = 1380970090 You say the message is received unmodified but I think you omit a part of the trace. We see that a 10 bytes message is received by lldpd but I don't see if the same message is sent by lldpctl. I am unable to reproduce this on a clean wheezy. Do you have this problem on all your hosts or only one in particular? The message "too short message request received" is here because you received a request that is too short to even contain the message header. struct hmsg_hdr { enum hmsg_type type; int16_t len; pid_t pid; }; type is at least one byte, but there is padding, so two bytes, two bytes for len and four bytes for pid, so eight bytes. Maybe enum is 4 bytes, then 2 bytes for len, 2 bytes for padding and 4 bytes for pid_t, so 12 bytes. I don't see when this struct could be 10 bytes but let's assume that's possible. Maybe there is a mismatch between lldpctl and lldpd. Could you check that lldpd and lldpctl are from the right package: dpkg -S $(which lldpctl) dpkg -S $(which lldpd) sudo ls -l /proc/$(pidof -s lldpd)/exe debsums lldpd sudo lsof -n | grep lldpd | grep /usr/sbin/lldpd ls -li /usr/sbin/lldpd -- Use data arrays to avoid repetitive control sequences. - The Elements of Programming Style (Kernighan & Plauger)
signature.asc
Description: PGP signature