]> git.ipfire.org Git - thirdparty/lldpd.git/log
thirdparty/lldpd.git
11 years agodebian: sync a bit with official packaging 0.7.9
Vincent Bernat [Wed, 28 May 2014 10:08:51 +0000 (12:08 +0200)] 
debian: sync a bit with official packaging

11 years agoversion: prepare a new release
Vincent Bernat [Wed, 28 May 2014 10:06:32 +0000 (12:06 +0200)] 
version: prepare a new release

11 years agolldpd: trigger regular interface refresh when changing port ID
Vincent Bernat [Wed, 21 May 2014 16:40:02 +0000 (18:40 +0200)] 
lldpd: trigger regular interface refresh when changing port ID

We don't want to call OS-specific methods. Let's just trigger a regular
interface refresh instead.

11 years agolldpcli: document `configure lldp portidsubtype` command
Vincent Bernat [Wed, 21 May 2014 15:31:34 +0000 (17:31 +0200)] 
lldpcli: document `configure lldp portidsubtype` command

11 years agoNEWS: mention ability to configure port ID
Vincent Bernat [Wed, 21 May 2014 15:22:54 +0000 (17:22 +0200)] 
NEWS: mention ability to configure port ID

11 years agolldpcli: fix a format warning
Vincent Bernat [Wed, 21 May 2014 15:21:40 +0000 (17:21 +0200)] 
lldpcli: fix a format warning

11 years agolldpcli: remove unused variable
Vincent Bernat [Wed, 21 May 2014 15:21:03 +0000 (17:21 +0200)] 
lldpcli: remove unused variable

11 years agoSupport for modifying PortID TLV
Sam Tannous [Wed, 21 May 2014 14:11:24 +0000 (10:11 -0400)] 
Support for modifying PortID TLV

This patch adds the ability to change the behavior of what
lldpd sends in the PortID TLV.

By default, lldpd sets the MAC address in the PortID and the ifname
in the PortDescr field.  This patch allows the user to
configure lldpd via the CLI (lldpcli or /etc/lldpd.conf)
to send either the interface name
(ifname) or the MAC address in the PortID TLV.

Signed-off-by: Sam Tannous <stannous@cumulusnetworks.com>
11 years agoREADME: point to the website for install instructions
Vincent Bernat [Fri, 16 May 2014 18:45:24 +0000 (20:45 +0200)] 
README: point to the website for install instructions

11 years agoREADME: update the intro to better match the reality
Vincent Bernat [Fri, 16 May 2014 18:41:48 +0000 (20:41 +0200)] 
README: update the intro to better match the reality

The inability to handle complex setup has been greatly diminished in 0.7
branch.

11 years agotravis: don't use regular options when on coverity branch
Vincent Bernat [Fri, 16 May 2014 09:06:04 +0000 (11:06 +0200)] 
travis: don't use regular options when on coverity branch

11 years agotravis: don't do anything if not on the coverity branch
Vincent Bernat [Fri, 16 May 2014 08:47:14 +0000 (10:47 +0200)] 
travis: don't do anything if not on the coverity branch

11 years agotravis: reduce matrix by not compiling everything with clang
Vincent Bernat [Fri, 16 May 2014 08:40:11 +0000 (10:40 +0200)] 
travis: reduce matrix by not compiling everything with clang

Only compile with all options when using clang.

11 years agotravis: integrate coverity script in regular run.sh
Vincent Bernat [Fri, 16 May 2014 08:34:16 +0000 (10:34 +0200)] 
travis: integrate coverity script in regular run.sh

11 years agotravis: when running coverity, skip regular build
Vincent Bernat [Fri, 16 May 2014 07:54:05 +0000 (09:54 +0200)] 
travis: when running coverity, skip regular build

11 years agotravis: don't try to install launchd/systemd stuff
Vincent Bernat [Fri, 16 May 2014 00:03:46 +0000 (02:03 +0200)] 
travis: don't try to install launchd/systemd stuff

This won't work as they are not installed inside prefix.

11 years agotravis: no need for `make install`
Vincent Bernat [Thu, 15 May 2014 23:52:52 +0000 (01:52 +0200)] 
travis: no need for `make install`

We already do a `make distcheck` for that purpose.

11 years agobsd: ensure we also have space for the padding after BPF header
Vincent Bernat [Thu, 15 May 2014 23:43:13 +0000 (01:43 +0200)] 
bsd: ensure we also have space for the padding after BPF header

11 years agobsd: ensure proper alignment of BPF header
Vincent Bernat [Thu, 15 May 2014 23:39:52 +0000 (01:39 +0200)] 
bsd: ensure proper alignment of BPF header

This is required as per bpf(4).

11 years agobsd: ensure we also have space for the BPF header
Vincent Bernat [Thu, 15 May 2014 23:18:07 +0000 (01:18 +0200)] 
bsd: ensure we also have space for the BPF header

11 years agobsd: fix clang warning about alignment problem with sockaddr
Vincent Bernat [Thu, 15 May 2014 23:08:27 +0000 (01:08 +0200)] 
bsd: fix clang warning about alignment problem with sockaddr

While this does not seem to be extensively documented, when casting a
`sockaddr *` to something else, like `sockaddr_dl *`, it is believed
that initially, it was a `sockaddr_dl *`, so there is no alignment
problem in this case. We use a macro to cast to `void *` to avoid the
warning.

11 years agotravis: run "make distcheck" with the appropriate configure arguments
Vincent Bernat [Thu, 15 May 2014 23:07:30 +0000 (01:07 +0200)] 
travis: run "make distcheck" with the appropriate configure arguments

Otherwise, we just use the default ones...

11 years agotravis: only run "make distcheck"
Vincent Bernat [Thu, 15 May 2014 13:47:42 +0000 (15:47 +0200)] 
travis: only run "make distcheck"

We don't need to compile stuff twice.

11 years agotravis: on OS X, try with/without embedded libevent and with/without SNMP
Vincent Bernat [Thu, 15 May 2014 13:26:14 +0000 (15:26 +0200)] 
travis: on OS X, try with/without embedded libevent and with/without SNMP

11 years agotravis: try to build only with clang on OS X
Vincent Bernat [Thu, 15 May 2014 13:23:05 +0000 (15:23 +0200)] 
travis: try to build only with clang on OS X

11 years agotravis: use devel version of net-snmp on OSX
Vincent Bernat [Thu, 15 May 2014 13:19:54 +0000 (15:19 +0200)] 
travis: use devel version of net-snmp on OSX

The current stable version does not work with Mavericks. See:
 https://github.com/Homebrew/homebrew/issues/25097

11 years agotravis: misc change to trigger a rebuild
Vincent Bernat [Thu, 15 May 2014 12:46:24 +0000 (14:46 +0200)] 
travis: misc change to trigger a rebuild

11 years agolldpcli: directive to configure IP management pattern
Vincent Bernat [Sun, 11 May 2014 14:21:33 +0000 (16:21 +0200)] 
lldpcli: directive to configure IP management pattern

This closes #54.

11 years agolldp: fix handling of LLDPDU expiration
Vincent Bernat [Sun, 11 May 2014 14:17:42 +0000 (16:17 +0200)] 
lldp: fix handling of LLDPDU expiration

Expiration logic for LLDPDU was totally flawed after the change to
support shutdown LLDPDU. Any LLDPDU would trigger infinite
expiration. Fix that.

11 years agoNEWS: mention support for shutdown LLDPDU
Vincent Bernat [Sat, 10 May 2014 16:02:40 +0000 (18:02 +0200)] 
NEWS: mention support for shutdown LLDPDU

11 years agolldp: support for shutdown LLDPU
Vincent Bernat [Sat, 10 May 2014 15:57:08 +0000 (17:57 +0200)] 
lldp: support for shutdown LLDPU

We just accept 0 as a valid TTL and let the expiration mechanism do its
work. We ensure that we can handle those 0 TTL and avoid underflow.

Closes #5.

11 years agointerfaces: default to use of a local administered MAC address for bonds
Vincent Bernat [Sat, 10 May 2014 15:32:10 +0000 (17:32 +0200)] 
interfaces: default to use of a local administered MAC address for bonds

Since in the default configuration, some swicthes (Cisco on IOS 15.x)
will complain about MAC addresses flapping when using `configure system
bond-slave-src-mac-type fixed`, and some other switches (still Cisco)
will complain when using `configure system bond-slave-src-mac-type
fixed`, we change the default to `local`. This is not the safest option
but the probability of having a collision is quite low.

Usually, locally administered addresses are used for VM but they are
taken from a known prefix and we are unlikely to have a collision with
this prefix. On VM, we will fallback to a fixed address but hopefully,
the switch will be a virtual one which won't have a problem with the
fixed address.

11 years agoNEWS: mention the fix for local address use
Vincent Bernat [Sat, 10 May 2014 08:29:42 +0000 (10:29 +0200)] 
NEWS: mention the fix for local address use

11 years agoman: more documentation for bond-slave-src-mac-type
Vincent Bernat [Sat, 10 May 2014 07:13:02 +0000 (09:13 +0200)] 
man: more documentation for bond-slave-src-mac-type

We document the MAC address used (to be able to find it through Google
or `git grep`). We also explain why the default is `fixed` and when it
should be changed to `local`.

11 years agointerfaces: fallback to fixed MAC if already a local MAC
Vincent Bernat [Sat, 10 May 2014 07:03:03 +0000 (09:03 +0200)] 
interfaces: fallback to fixed MAC if already a local MAC

This is what is documented in the manual page.

11 years agointerfaces: fix use of locally administered use on bond devices
Vincent Bernat [Sat, 10 May 2014 07:00:37 +0000 (09:00 +0200)] 
interfaces: fix use of locally administered use on bond devices

This was broken in a previous commit (2746d430fbcc7).

11 years agoosx: use /var as a base for socket location
Vincent Bernat [Wed, 7 May 2014 11:43:21 +0000 (13:43 +0200)] 
osx: use /var as a base for socket location

11 years agoman: use configured path for /var/run/lldpd.socket
Vincent Bernat [Wed, 7 May 2014 11:31:32 +0000 (13:31 +0200)] 
man: use configured path for /var/run/lldpd.socket

11 years agoconfigure: make default PID location configurable
Vincent Bernat [Wed, 7 May 2014 11:21:50 +0000 (13:21 +0200)] 
configure: make default PID location configurable

Also, document those changes in NEWS as using `localstatedir` may move
stuff from `/var` to `/usr/local/var`.

Closes #64.

11 years agoconfigure: make default socket location configurable in configure
Vincent Bernat [Wed, 7 May 2014 11:12:53 +0000 (13:12 +0200)] 
configure: make default socket location configurable in configure

This closes #63.

11 years agoconfigure: use `runstatedir` instead of /var/run in configure
Vincent Bernat [Wed, 7 May 2014 11:06:05 +0000 (13:06 +0200)] 
configure: use `runstatedir` instead of /var/run in configure

11 years agoconfigure: don't use fallback values in summary
Vincent Bernat [Wed, 7 May 2014 10:42:46 +0000 (12:42 +0200)] 
configure: don't use fallback values in summary

They are not needed anymore, if default values are used, they are expanded.

11 years agolldpcli: return success when reading commands from files
Vincent Bernat [Wed, 7 May 2014 09:54:16 +0000 (11:54 +0200)] 
lldpcli: return success when reading commands from files

When reading commands from files, we chose to not stop on errors (the
main reason is to allow to specify nonexistent configuration files and
allow lldpd to still work after incompatible updates). However, we also
always return a failure status. Fix that.

Thanks to Brian Bidulock for spotting that. Closes #62.

11 years agoosx: update Homebrew formula to match what has been done in Homebrew
Vincent Bernat [Sun, 27 Apr 2014 10:54:44 +0000 (12:54 +0200)] 
osx: update Homebrew formula to match what has been done in Homebrew

11 years agoconfigure: enable use of colored output for gcc
Vincent Bernat [Thu, 24 Apr 2014 15:53:34 +0000 (17:53 +0200)] 
configure: enable use of colored output for gcc

11 years agoconfigure: use -fstack-protector-strong if available
Vincent Bernat [Thu, 24 Apr 2014 15:50:55 +0000 (17:50 +0200)] 
configure: use -fstack-protector-strong if available

11 years agoosx: new release
Vincent Bernat [Sun, 13 Apr 2014 09:49:52 +0000 (11:49 +0200)] 
osx: new release

11 years agolldpcli: document new "configure system hostname" directive
Vincent Bernat [Sun, 13 Apr 2014 08:55:10 +0000 (10:55 +0200)] 
lldpcli: document new "configure system hostname" directive

11 years agoversion: prepare new release 0.7.8
Vincent Bernat [Sun, 13 Apr 2014 08:34:13 +0000 (10:34 +0200)] 
version: prepare new release

11 years agoNEWS: add several items to the changelog
Vincent Bernat [Sun, 13 Apr 2014 06:04:12 +0000 (08:04 +0200)] 
NEWS: add several items to the changelog

11 years agoconfigure: make some flags conditional
Vincent Bernat [Sat, 12 Apr 2014 10:34:28 +0000 (12:34 +0200)] 
configure: make some flags conditional

Use of _XOPEN_SOURCE is quite dangerous.

11 years agoosx: blacklist p2pX interfaces
Vincent Bernat [Sat, 12 Apr 2014 10:11:21 +0000 (12:11 +0200)] 
osx: blacklist p2pX interfaces

They are related to AirDrop and transmitting anything on it will broke
the wireless network. This should fix #61.

11 years agoconfigure: hide errors when systemd is not present
Vincent Bernat [Wed, 9 Apr 2014 19:06:57 +0000 (21:06 +0200)] 
configure: hide errors when systemd is not present

11 years agocompat: fix vsyslog to rely on the result of vasprintf
Vincent Bernat [Wed, 9 Apr 2014 19:03:17 +0000 (21:03 +0200)] 
compat: fix vsyslog to rely on the result of vasprintf

11 years agocompat: include stdarg to get va_list
Vincent Bernat [Wed, 9 Apr 2014 19:03:10 +0000 (21:03 +0200)] 
compat: include stdarg to get va_list

11 years agocompat: fix use of vasprintf (previously _vasprintf)
Vincent Bernat [Wed, 9 Apr 2014 18:56:32 +0000 (20:56 +0200)] 
compat: fix use of vasprintf (previously _vasprintf)

11 years agolldpcli: use a previously unused variable
Vincent Bernat [Wed, 9 Apr 2014 18:56:04 +0000 (20:56 +0200)] 
lldpcli: use a previously unused variable

11 years agolldpd: add a note about command-line options
Vincent Bernat [Wed, 9 Apr 2014 07:56:38 +0000 (09:56 +0200)] 
lldpd: add a note about command-line options

lldpcli should be preferred for new options.

11 years agoMerge pull request #60 from jonasj76/override-hostname
Vincent Bernat [Wed, 9 Apr 2014 07:54:54 +0000 (09:54 +0200)] 
Merge pull request #60 from jonasj76/override-hostname

lldp: add option/command to override hostname

11 years agolldpd: Remove the '-N' command-line flag 60/head
Jonas Johansson [Wed, 9 Apr 2014 06:02:48 +0000 (08:02 +0200)] 
lldpd: Remove the '-N' command-line flag

Too many flags being added, use of configuration file is prefered.

Signed-off-by: Jonas Johansson <jonasj76@gmail.com>
11 years agolldp: add option/command to override hostname
Jonas Johansson [Tue, 8 Apr 2014 11:30:24 +0000 (13:30 +0200)] 
lldp: add option/command to override hostname

Allow to override the system name (hostname) by using '-N' as parameter to
lldpd, or by using "configure system hostname <NAME>" to lldpcli.

Signed-off-by: Jonas Johansson <jonasj76@gmail.com>
11 years agocoverity: change a bit the annotations
Vincent Bernat [Tue, 8 Apr 2014 07:32:02 +0000 (09:32 +0200)] 
coverity: change a bit the annotations

We want coverity to ignore those errors. It doesn't seem to be the case.

11 years agocoverity: fix a false positive in SNMP transport
Vincent Bernat [Tue, 8 Apr 2014 07:17:29 +0000 (09:17 +0200)] 
coverity: fix a false positive in SNMP transport

`remote` is not expected to be a NULL-terminated string. However, just
in case it is used as one somewhere, we alloc the appropriate space for
it.

11 years agocoverity: fix memory leak in lldpd when the same option is repeated
Vincent Bernat [Tue, 8 Apr 2014 07:14:48 +0000 (09:14 +0200)] 
coverity: fix memory leak in lldpd when the same option is repeated

11 years agocoverity: fix memory leak in lldpcli
Vincent Bernat [Tue, 8 Apr 2014 07:11:21 +0000 (09:11 +0200)] 
coverity: fix memory leak in lldpcli

CID 1198257 (#1 of 1): Resource leak (RESOURCE_LEAK)

11 years agoredhat: enable SNMP support on RHEL 5 and CentOS 5 by default
Vincent Bernat [Sun, 6 Apr 2014 21:44:17 +0000 (23:44 +0200)] 
redhat: enable SNMP support on RHEL 5 and CentOS 5 by default

This is related with the fix in the previous commit (ae7f4c2).

11 years agosnmp: link with Net-SNMP later
Vincent Bernat [Sun, 6 Apr 2014 21:41:40 +0000 (23:41 +0200)] 
snmp: link with Net-SNMP later

Some systems contain static libraries in the output of `net-snmp-config
--agent-libs`. It is not possible to build a convenience library with a
static library. Therefore, we just link with the appropriate libs in the
last step. This should fix #57.

11 years agopriv: use AF_UNIX for socketpair()
Vincent Bernat [Fri, 4 Apr 2014 08:17:43 +0000 (10:17 +0200)] 
priv: use AF_UNIX for socketpair()

This is a synonym of AF_LOCAL but it seems more widely known (for
example, on HP-UX).

11 years agoconfigure: _XOPEN_SOURCE=500 to be like _GNU_SOURCE=1
Vincent Bernat [Thu, 3 Apr 2014 07:45:24 +0000 (09:45 +0200)] 
configure: _XOPEN_SOURCE=500 to be like _GNU_SOURCE=1

11 years agohpux: provide a replacement for daemon() for HP-UX
Vincent Bernat [Wed, 2 Apr 2014 16:01:24 +0000 (18:01 +0200)] 
hpux: provide a replacement for daemon() for HP-UX

11 years agohpux: provide a replacement for vsyslog() for HP-UX
Vincent Bernat [Wed, 2 Apr 2014 15:54:20 +0000 (17:54 +0200)] 
hpux: provide a replacement for vsyslog() for HP-UX

11 years agoasprintf: we are also using vasprintf, let's define it correctly
Vincent Bernat [Wed, 2 Apr 2014 15:38:56 +0000 (17:38 +0200)] 
asprintf: we are also using vasprintf, let's define it correctly

11 years agobuild: use __EXTENSIONS__ and _XOPEN_SOURCE_EXTENDED everywhere
Vincent Bernat [Wed, 2 Apr 2014 15:10:08 +0000 (17:10 +0200)] 
build: use __EXTENSIONS__ and _XOPEN_SOURCE_EXTENDED everywhere

It is needed for Solaris and HP-UX. It doesn't seem to harm other
platforms. Let's hope that the autoconf test will catch
problems. Otherwise, we can still conditionally use them.

11 years agobsd: check of SIOCGIFDESCR instead of IFDESCRSIZE
Vincent Bernat [Wed, 2 Apr 2014 13:55:55 +0000 (15:55 +0200)] 
bsd: check of SIOCGIFDESCR instead of IFDESCRSIZE

IFDESCRSIZE is defined at the beginning of the file and is therefore
always defined. Just check if SIOCGIFDESCR exists instead.

11 years agoprivsep: don't use err.h: not needed
Vincent Bernat [Wed, 2 Apr 2014 13:33:02 +0000 (15:33 +0200)] 
privsep: don't use err.h: not needed

11 years agoasprintf: fix warnings in SNMP tests related to asprintf
Vincent Bernat [Tue, 1 Apr 2014 17:20:28 +0000 (19:20 +0200)] 
asprintf: fix warnings in SNMP tests related to asprintf

11 years agoasprintf: do not redeclare on SNMP tests
Vincent Bernat [Tue, 1 Apr 2014 17:16:56 +0000 (19:16 +0200)] 
asprintf: do not redeclare on SNMP tests

11 years agoasprintf: globally define _GNU_SOURCE
Vincent Bernat [Tue, 1 Apr 2014 16:29:07 +0000 (18:29 +0200)] 
asprintf: globally define _GNU_SOURCE

And also provide a replacement for asprintf if it is not available. I
would prefer to not use _GNU_SOURCE everywhere but it seems cleaner than
putting it at the top of random files. Ideally, I should wrap every
function in a separate file to just use _GNU_SOURCE for those
functions. There are `asprintf()` and `setres[ug]id()`.

11 years agodebian: fix postinst to create _lldpd user
Vincent Bernat [Fri, 21 Mar 2014 14:14:06 +0000 (15:14 +0100)] 
debian: fix postinst to create _lldpd user

Previous commit was incorrect and did not create _lldpd user on install.

11 years agodebian: same style for postinst and postrm
Vincent Bernat [Thu, 20 Mar 2014 15:55:55 +0000 (16:55 +0100)] 
debian: same style for postinst and postrm

Use a case switch in both files. Moreover, `#DEBHELPER#` may want to do
something if we configure or reconfigure. Let it do that.

11 years agolib: use strlcpy() instead of strcpy()
Vincent Bernat [Tue, 11 Mar 2014 20:43:59 +0000 (21:43 +0100)] 
lib: use strlcpy() instead of strcpy()

This reverts back 27faad4fd79399eda8811d4315c96317ed47a151 but we
introduce a variable for the value of strlen()+1 to make it clear we know
what we are doing.

11 years agointerfaces: convert a whitelisted interface to a physical one
Vincent Bernat [Fri, 7 Mar 2014 09:21:15 +0000 (10:21 +0100)] 
interfaces: convert a whitelisted interface to a physical one

The previous change didn't allow to have bonds and VLAN handled in a
sensible way in case of a whitelisted interface.

11 years agointerfaces: circumvent any physical check on exact match
Vincent Bernat [Thu, 6 Mar 2014 17:28:21 +0000 (18:28 +0100)] 
interfaces: circumvent any physical check on exact match

When enabling an interface with `-I eth0`, any physical check will be
circumvented. This allows lldpd to send and receive on VLAN interfaces.

11 years agointerfaces: allow whitelisting an interface
Vincent Bernat [Thu, 6 Mar 2014 17:09:27 +0000 (18:09 +0100)] 
interfaces: allow whitelisting an interface

Currently, this means that an interface can be both blacklisted and
whitelisted and in this case, it is accepted as valid.

11 years agointerfaces: document and test pattern matching
Vincent Bernat [Thu, 6 Mar 2014 16:55:22 +0000 (17:55 +0100)] 
interfaces: document and test pattern matching

11 years agobuild: use -fno-omit-frame-pointer for ease of debug
Vincent Bernat [Thu, 6 Mar 2014 16:20:09 +0000 (17:20 +0100)] 
build: use -fno-omit-frame-pointer for ease of debug

We are not a performance sensitive program and this helps debugging in
many situations.

11 years agolib: don't use strlcpy() when strcpy() just works
Vincent Bernat [Sun, 2 Mar 2014 23:48:55 +0000 (00:48 +0100)] 
lib: don't use strlcpy() when strcpy() just works

clang complains when we use strlcpy() with strlen() on the source. The
change was made because some other tools complained that we used
strcpy() instead of a more secure version. Since they don't agree, let's
switch to the saner thing to do: use strcpy() when it is safe to do.

11 years agobuild: remove duplicate const declaration
Vincent Bernat [Sun, 2 Mar 2014 23:45:17 +0000 (00:45 +0100)] 
build: remove duplicate const declaration

clang complains about this. I don't remember why I did this.

11 years agotravis: put installation and test instructions into shell scripts
Vincent Bernat [Sun, 2 Mar 2014 23:30:17 +0000 (00:30 +0100)] 
travis: put installation and test instructions into shell scripts

11 years agotravis: test with OSX and clang
Vincent Bernat [Sun, 2 Mar 2014 23:24:56 +0000 (00:24 +0100)] 
travis: test with OSX and clang

It seems that Travis-CI now supports OSX and clang. Let's try out. See:
 https://github.com/pyca/cryptography/blob/master/.travis.yml

11 years agobuild: on OSX, use glibtoolize by default
Vincent Bernat [Sun, 2 Mar 2014 23:20:20 +0000 (00:20 +0100)] 
build: on OSX, use glibtoolize by default

11 years agolldpcli: fix readline() wrapper to take prompt as argument
Vincent Bernat [Thu, 20 Feb 2014 20:57:29 +0000 (21:57 +0100)] 
lldpcli: fix readline() wrapper to take prompt as argument

`readline()` is expecting the prompt as argument. We fix the wrapper to
have the same requirement.

11 years agolldpcli: check for privileges by checking access to control socket
Vincent Bernat [Thu, 20 Feb 2014 20:52:46 +0000 (21:52 +0100)] 
lldpcli: check for privileges by checking access to control socket

Instead of relying on having used the suid bit to run the program, we
check if the real UID/GID could have opened the control socket. This
really fix #56.

11 years agolldpcli: root is privileged
Vincent Bernat [Thu, 20 Feb 2014 20:37:22 +0000 (21:37 +0100)] 
lldpcli: root is privileged

For some reason, this bug was not catched before. It was expected that
`lldpcli` can be installed as suid `_lldpd` to give user read access to
the neighbor information. However, to avoid write access, we checked if
the user was privileged by checking equality of effective and real user
uid. However, even for root, they don't have to match. Maybe they
matched in the past?

Therefore, directly check for UID == 0 too.

This should fix #56

11 years agointerfaces: reset router and wlan capability bits
Vincent Bernat [Wed, 19 Feb 2014 14:50:41 +0000 (15:50 +0100)] 
interfaces: reset router and wlan capability bits

When adding capability for new interfaces, reset them if the interfaces
providing the capability are not present anymore. Also, add stationOnly
capability if no capability is currently present.

11 years agolldpd: enable "stationOnly" capability if we don't have anything else
Vincent Bernat [Wed, 19 Feb 2014 14:48:37 +0000 (15:48 +0100)] 
lldpd: enable "stationOnly" capability if we don't have anything else

This should fix #55.

11 years agolib: add URL in lldpctl.pc
Vincent Bernat [Wed, 12 Feb 2014 23:01:23 +0000 (00:01 +0100)] 
lib: add URL in lldpctl.pc

11 years agolib: fix includedir in lldpctl.pc
Vincent Bernat [Wed, 12 Feb 2014 23:00:39 +0000 (00:00 +0100)] 
lib: fix includedir in lldpctl.pc

11 years agofgetln: provide a version not relying on getline()
Vincent Bernat [Sun, 19 Jan 2014 10:24:45 +0000 (11:24 +0100)] 
fgetln: provide a version not relying on getline()

`getline()` is not POSIX and is a GNU extension.

11 years agodaemon: unset UPSTART_JOB and NOTIFY_SOCKET once used
Vincent Bernat [Wed, 1 Jan 2014 13:00:33 +0000 (14:00 +0100)] 
daemon: unset UPSTART_JOB and NOTIFY_SOCKET once used

While we shouldn't have children that use those environment variables,
better safe than sorry.