Age | Commit message (Collapse) | Author | Files | Lines |
|
Poll "/proc/sys/kernel/hostname" and update the hostname when it was
changed. systemd has a similar mechanism.
Note that the hostname is not polled if it has been provided on the
command line, or if "/proc/sys/kernel/hostname" cannot be opened.
Patch contributed by @tbetker
Fixes #23
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
|
Instead of spawming a thread for the sole purpose of watching the rtnl
for (presumably) seldom events, just merge the select() for all sockets
together in one single main loop.
This reduces unnecessary complexity and makes llmnrd no longer require
any locking.
It also allows us to handle signals in a thread-safe manner (as there
aren't any ;) and thus the race condition on exit reported in #20
Closes #20
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
|
Add a command line option -i/--interface which allows to bind the llmnrd
sockets to a specific interface. If used, requests are only answered on
the specified interface.
Example: llmnrd -i eth0
Closes #9
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
|
Currently IPv6 addresses are always enumerated via RTNL socket and then
stored internally, even if llmnrd was started without the IPv6 command
line option '-6'. Even though no queries on AF_INET6 sockets will be
answered, this behavior might be confusing. Especially due to messages
like:
Added IPv6 address fe80::f0eb:aaff:feb3:ae58 on interface tap0
being logged.
Explicitely disable IPv6 address enumeration on the RTNL socket to fix
this behavior.
Closes #8
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
|
Use MAXHOSTNAMELEN defined in sys/param.h to determine the size of the
hostname buffer to allocate. Also make sure the string is properly
zero-terminated in all cases, as in some cases it might be undefined
whether a truncated string is properly terminated.
Note: Also remove a TODO comment, as watching for hostname changes at
runtime is outside the scope of llmnrd (also, avahi behaves the same).
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
|
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
|
Make certain syscalls restartable after signal handler.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
|
Discovered by the Coverity scanner CID 99693.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
|
Closes #5
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
|
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
|
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
|
No logging to syslog or dropping of privileges etc yet.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
|
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
|
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
|
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
|
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|