lldpd: whitelist sendto, poll, recvmsg and readv in seccomp sandbox

With privilege separation and seccomp enabled, the monitor thread was
dying due to seccomp errors, while leaving the child alive. This whitelists
some extra syscalls to allow the monitor process to stay alive.
Merge pull request #70 from chutz/seccomp-whitelist

seccomp: whitelist sendto, poll, recvmsg and readv in seccomp sandbox
lldpd: fix use of NULL in execl*

See:
 http://c-faq.com/null/nullreq.html
NEWS: credit seccomp fix
lldpd: fix log_info

Currently none of the log_info msgs are getting
printed into syslog. vlog already does the right checks.
Remove the checks in log_info which is making all default log_info
prints no-ops

Also change severity of "interface reset timer" msg

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: Sam Tannous <stannous@cumulusnetworks.com>
log: info messages should be logged on syslog but not on first debug level

Without `-d`, syslog should log info messages. With `-d`, they should
not be displayed. With `-dd`, they should be displayed. This is an
amendment of the previous patch.
Increase event buffer

This buffer is just used to drain the event socket

During high event traffic saw a no buffer space error. This and other
buffers need to be revisited.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: Sam Tannous <stannous@cumulusnetworks.com>
lldpd: Fix netlink notification group for address changes

The current netlink notification registration registers
for only link changes. This patch fixes it to include address
changes.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: Sam Tannous <stannous@cumulusnetworks.com>
Make "too many neighbors for port" msg appear less frequently

There is a max neighbors setting (default value 4).
It prints a msg everytime it gets a new neighbor > 4.
This patch just makes it appear less often.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: Sam Tannous <stannous@cumulusnetworks.com>
make agentx socket non-blocking

This patch makes the lldpd socket non-blocking. And also adds a brief
retry.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: Sam Tannous <stannous@cumulusnetworks.com>
snmp: preserve previous flags when making AgentX socket non-blocking
snmp: use poll() to wait for AgentX socket to be ready

Instead of sleeping for an arbitrary amount of time, query if the socket
is ready using poll() which should be portable enough (POSIX.1-2001) to
work everywhere.
This patch adds bash completion for lldpcli.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: Sam Tannous <stannous@cumulusnetworks.com>
Add ignore handler for SIGHUP in lldpcli

lldpcli which is execed by lldpd is expected to resume lldpd operations.
But in some cases, lldpcli can exiting because of SIGHUP.  This fixes
these cases.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: Kanna Rajagopal <kanna@cumulusnetworks.com>
Signed-off-by: Sam Tannous <stannous@cumulusnetworks.com>
Move interface update msg to debug level

Move interface update msg to debug level so that we don't see
so many of them on large boxes.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: Sam Tannous <stannous@cumulusnetworks.com>
Add error code to the multicast address add/delete failure msg

Move mac filter delete info msg to debug and add error
to the multicast address add/delete failure msg.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: Sam Tannous <stannous@cumulusnetworks.com>
Add call to process more messages from data already read.

Currently, the calls within lldpctl are assumed to be all associated with
synchronous sockets. With async sockets, the data read can be varied and so
its useful to process as much of the data as possible. However, lldpctl_recv
only processes one message and there isn't a call to be made to process
data that's sitting in a control connection's buffer. This patch adds such a
call for external users to call. It simply calls check_for_notification and
returns whatever check_for_notification returns with 0 signalling more
processing is possible and non-zero indicating buffer is fully processed
(though there may still be data).

Signed-off-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
Signed-off-by: Sam Tannous <stannous@cumulusnetworks.com>
lib: update liblldpctl versioning

Previous commit added a function to the API.
lldpcli: add display filter to show nbrs running specific protocols

LLDPD allows a peer to run multiple protocols (LLDP, CDPv1, CDPv2).
lldpcli can be used to show the primary protocol for a nbr or all
the protocols using the "hidden" cmdline arg
This allows lldpcli to filter the nbr display based on the
protocol that is running on it.

Signed-off-by: Kanna Rajagopal <kanna@cumulusnetworks.com>
Signed-off-by: Sam Tannous <stannous@cumulusnetworks.com>
lldpcli: document `-u` argument in synopsis