6f6aad211eDocumentation update.
Nicholas J. Kain
2015-01-10 18:34:51 -0500
9f87bd8b30udp_checksum(): Clamp the value of the UDP packet header length.
Nicholas J. Kain
2015-01-06 07:07:08 -0500
6548b5ce54get_raw_packet(): Perform the UDP checksum after the packet length checks.
Nicholas J. Kain
2015-01-06 04:32:58 -0500
c8dcf5a06bMake sure that received DHCP packets have a valid options end marker.
Nicholas J. Kain
2015-01-06 04:02:52 -0500
94c107d465Make sure all sockets are set NONBLOCK so that writes do not block.
Nicholas J. Kain
2014-08-19 11:09:59 -0400
12114c9baeAdd more explicit length checks for get_raw_packet.
Nicholas J. Kain
2014-07-25 20:34:01 -0400
2518e0a2bcUse SO_LOCK_FILTER to ensure that BPF filters cannot be removed once attached.
Nicholas J. Kain
2014-06-13 22:37:37 -0400
56e30a0923Fix the return value for nlmsg_get_error().
Nicholas J. Kain
2014-06-13 22:35:57 -0400
ae03b6dd8fMove the ip checksum code out to ncmlib.
Nicholas J. Kain
2014-06-08 20:34:34 -0400
4a083d3367get_dhcp_opt() didx argument should be passed as a reference rather than relying on the caller re-assigning to didx. The previous didx += get_dhcp_opt(...) was wrong and should have used =.
Nicholas J. Kain
2014-05-10 21:32:15 -0400
99e21004eaarp_min_close_fd() will always force the arp fd to be equal to -1, so there is no need to check force_reopen twice.
Nicholas J. Kain
2014-05-10 21:13:24 -0400
3721cc926bDocumentation updates.
Nicholas J. Kain
2014-04-24 18:29:52 -0400
6af0d26351Remove the obsolete init script for Gentoo's network configuration system.
Nicholas J. Kain
2014-04-24 18:24:00 -0400
2420bed259Accept no command line arguments without error.
Nicholas J. Kain
2014-04-21 12:04:13 -0400
dbc91b0811Background option in config files should be a boolval rathe than a value.
Nicholas J. Kain
2014-04-21 09:02:58 -0400
034e2bb1dbWhen sockd transfers a file descriptor to ndhc, close the fd in sockd. Since the transfer is conceptually a move, this is the correct thing to do and prevents sockets from spuriously hanging around forever and eventually exhausting the per process limit on fds.
Nicholas J. Kain
2014-04-17 11:04:00 -0400
07cbd88049Just use raw sockets for listening to DHCP requests. A UDP SO_BROADCAST socket was previously used only for receiving RENEWING packets, and it added needless complexity and was somewhat fragile.
Nicholas J. Kain
2014-04-16 01:00:36 -0400
ca85a6ba9fStyle cleanups in dhcp.c.
Nicholas J. Kain
2014-04-16 00:24:40 -0400
d8260b4e63Print an error message when bind() fails when creating a UDP socket in sockd.
Nicholas J. Kain
2014-04-16 00:24:13 -0400
0884d96d1ePR_SET_PDEATHSIG is not fully reliable, so instead maintain a pair of AF_UNIX SOCK_STREAM sockets between the master processes and each subprocess, and poll for the HUP event.
Nicholas J. Kain
2014-04-15 23:19:24 -0400
e526adce19Make the signal handling code use safe_read() and unify ifchd and sockd signals code.
Nicholas J. Kain
2014-04-15 20:55:13 -0400
baa394af9aUDP listen sockets should be requested with 'U' instead of 'u'.
Nicholas J. Kain
2014-04-15 20:54:35 -0400
b3578737dfUpdate the Makefile to build cfg.c from cfg.rl.
Nicholas J. Kain
2014-04-15 20:50:54 -0400
b00444ab8bBound the subprocess lifetime using prctl(PR_SET_PDEATHSIG, ...).
Nicholas J. Kain
2014-04-15 18:01:01 -0400
b3ce601f20state.c: Print error messages if we fail to send DHCP packets.
Nicholas J. Kain
2014-04-15 17:59:15 -0400
18604c5245get_udp_unicast_socket() needs to have the client address as an argument when sending the request to sockd.
Nicholas J. Kain
2014-04-15 17:55:28 -0400
a9055b5ca5Update more message prints to prefix with the interface name.
Nicholas J. Kain
2014-04-15 15:24:22 -0400
58b4ba768cIf the IP header length does not match the size of the UDP packet received via the raw socket, print both lengths in the warning message.
Nicholas J. Kain
2014-04-15 15:23:52 -0400
730e5ef310setpgid() can return EPERM if we are already a process group leader.
Nicholas J. Kain
2014-04-15 15:02:20 -0400
e5834da6d3Permit sendmsg in the seccomp syscall whitelist for all daemons.
Nicholas J. Kain
2014-04-15 14:57:07 -0400
b5f0ccd88dIn cfg.rl, when performing clear action, don't clear the cs member in ccfg.
Nicholas J. Kain
2014-04-15 14:56:35 -0400
a777766cc6Fix stupid typo in ndhc.c that would cause the clientid option to corrupt the start of the hostname option if both were specified.
Nicholas J. Kain
2014-04-15 14:55:50 -0400
8a9fbb6f09Documentation updates.
Nicholas J. Kain
2014-04-14 18:32:08 -0400
74ad01a086Update the manual page.
Nicholas J. Kain
2014-04-14 15:52:39 -0400
a501789e04Parse config options with ragel and support a configuration file.
Nicholas J. Kain
2014-04-14 15:06:31 -0400
51033d3664Detect the glibc version in CMake and link librt if it is required.
Nicholas J. Kain
2014-04-07 19:14:31 -0400
d267c2c44bUse the raw capability interface via updated ncmlib rather than linking to libcap.
Nicholas J. Kain
2014-04-07 15:05:34 -0400
bb1ff7a506arp.c: Make logging messages print the associated interface name.
Nicholas J. Kain
2014-04-07 04:43:21 -0400
74678ef510Use safe_recvmsg().
Nicholas J. Kain
2014-04-07 04:22:32 -0400
6804be2277Use safe_sendto where necessary, and check for short writes.
Nicholas J. Kain
2014-04-07 04:15:02 -0400
650da6a7fdAdd recvfrom to the seccomp syscall whitelist.
Nicholas J. Kain
2014-04-07 03:54:30 -0400
cab9162d8dRemove socketpair from the seccomp syscall filter whitelist.
Nicholas J. Kain
2014-04-07 03:44:53 -0400
5fa2030babUse a socketpair rather than a pair of pipes for communication between ndhc and ifch, similar to sockd. A single pipe is also maintained so that SIGPIPE can bound the lifetime of an orphaned ifch process.
Nicholas J. Kain
2014-04-07 03:44:02 -0400
e2ee728982Consolidate all of the global static variables in arp.c into a single struct, and use booleans where appropriate.
Nicholas J. Kain
2014-04-06 22:12:31 -0400
a86363f248Create a new process ID group for ndhc.
Nicholas J. Kain
2014-04-06 22:07:12 -0400
b761889025Move source from ndhc/ to src/ since ifchd is no longer a separate program.
Nicholas J. Kain
2014-04-06 16:57:06 -0400
b511d45c2fChange most error comparisons from == -1 to < 0. Some were not changed, as the different negative values equate to different errors.
Nicholas J. Kain
2014-04-06 06:33:14 -0400
c03be059f5writeordie() was buggy; delete the == 1 which makes no sense.
Nicholas J. Kain
2014-04-06 06:31:40 -0400
3d76fbeedcMake sure that all safe_* return values use ssize_t.
Nicholas J. Kain
2014-04-06 06:24:13 -0400
745e9e8923If we encounter read errors reading the duid or iaid after successfully opening the file, print an error and exit.
Nicholas J. Kain
2014-04-06 06:06:53 -0400
7b0db5b8d3arp.c: If the safe_read that fetches arp responses encounters a return of -1 with errno == EAGAIN or EWOULDBLOCK, then report the error, as it should never happen given that the function is called only once after polling for ready-reads.
Nicholas J. Kain
2014-04-06 06:02:03 -0400
8b4c7f05b2arp.c: Check for < 0 for invalid fds and function errors instead of == -1.
Nicholas J. Kain
2014-04-06 05:54:21 -0400
8af6bee46darp_switch_state() was far too confusing and buggy. Pass the target state as an argument, and only switch the global state after a change is successfully made.
Nicholas J. Kain
2014-04-06 05:51:52 -0400
1e52914f2eRemove a lot of permitted syscalls from the seccomp filter list.
Nicholas J. Kain
2014-04-06 05:21:56 -0400
812912126eifch doesn't need to save a pidfile because its lifetime is strictly bounded by that of ndhc by the shared pipe, so remove that option.
Nicholas J. Kain
2014-04-06 02:27:52 -0400
6b1d422d6farp_min_close_fd() and arp_close_fd() can return void.
Nicholas J. Kain
2014-04-05 23:40:18 -0400
1c30247c36arp_reopen_fd() can be return void.
Nicholas J. Kain
2014-04-05 23:37:44 -0400
6750209e12Have sockd apply BPF filters to ARP sockets.
Nicholas J. Kain
2014-04-05 21:39:27 -0400
5212e0dfc5Switch to using a socket for ndhc/sockd IPC so that fd passing works.
Nicholas J. Kain
2014-04-05 05:25:56 -0400
9622640698Add command line help for the sockd-user option.
Nicholas J. Kain
2014-04-05 05:23:37 -0400
ef51971a6dUpdate to latest ncmlib privilege.[ch].
Nicholas J. Kain
2014-04-05 05:23:18 -0400
09d6f7dfb8Introduce a ndhc-sockd daemon that separates out the remaining elevated capabilities from the ndhc master process.
Nicholas J. Kain
2014-04-04 04:12:25 -0400
65c3cd4fd9Make many more logging prints specify the interface and function, and make the return checks for safe_(read|write) stricter.
Nicholas J. Kain
2014-04-04 04:01:49 -0400
2200b68affPrint a warning if the BPF is not installed for an ARP socket.
Nicholas J. Kain
2014-04-04 03:55:32 -0400
dc2ac46fd4Update to latest ncmlib and remove some dead preprocessor defines.
Nicholas J. Kain
2014-03-31 16:06:41 -0400
2f54ff75f3Use nk_uidgidbyname().
Nicholas J. Kain
2014-03-30 22:18:04 -0400
2d8654ae59Update copyright dates.
Nicholas J. Kain
2014-03-30 17:23:35 -0400
1abf8462d3Convert logging messages to suicide() where appropriate and clean up the logging messages a bit.
Nicholas J. Kain
2014-03-30 17:21:27 -0400
82d9682ed8Update to latest ncmlib changes.
Nicholas J. Kain
2014-03-30 17:02:48 -0400
abda60e0e9Remove unused defines.
Nicholas J. Kain
2014-03-28 11:17:52 -0400
1b6b52d2ebDon't background the daemon by default. Process supervision is finally catching on and becoming the norm.
Nicholas J. Kain
2014-03-28 00:12:33 -0400
704e414171Add nl_sendgetaddr and nl_sendgetaddrs variants for v4/v6.
Nicholas J. Kain
2014-03-28 00:09:53 -0400
77ce7b9a6cprintf 'hh' length modifier is a gnu extension. Don't use it.
Nicholas J. Kain
2014-03-25 05:27:47 -0400
00e7e2a61bRemove an implicit narrowing cast from void* in nl.h.
Nicholas J. Kain
2014-03-24 09:55:55 -0400
4b92b10f32ifch doesn't need chmod or unlink whitelisted for seccomp-filter.
Nicholas J. Kain
2014-03-22 23:39:50 -0400
71db577ed5Replace the remaining calls to rand() with nk_random_u32().
Nicholas J. Kain
2014-03-22 02:08:23 -0400
009f80b428x86 has a slightly different syscall interface, so some changes are necessary for the seccomp filters to work.
Nicholas J. Kain
2014-03-22 01:32:55 -0400
22dcfc00eeEnable seccomp-filter if CMake detects that host is x86_64 or x86.
Nicholas J. Kain
2014-03-21 23:52:15 -0400
2d79465eedEnforce field width for MAC address prints.
Nicholas J. Kain
2014-03-21 21:29:25 -0400
ab68966442ifchange.c: Fix ifcmd_iplist so that it works properly.
Nicholas J. Kain
2014-03-20 23:50:58 -0400
6cfb1eb340duiaid.c: Fix trivial errors found from testing so that it works.
Nicholas J. Kain
2014-03-20 23:26:19 -0400
a73a28588fFactor out copy_cmdarg() to common ncmlib header.
Nicholas J. Kain
2014-03-20 05:25:40 -0400
f365498188Convert the remaining strnk* calls to use snprintf instead, and make sure to detect truncations and failures in all cases.
Nicholas J. Kain
2014-03-20 04:07:12 -0400
daadae0bf5Switch to using snprintf in dhcp.c and ifch.c so that truncations can be easily detected.
Nicholas J. Kain
2014-03-19 19:32:45 -0400
f5281ee7abifchange.c: inet_ntop won't fail so long as we always use a statically determined valid address family and sufficiently long destination buffer.
Nicholas J. Kain
2014-03-19 19:14:38 -0400
fa801fbec4ifchange.c doesn't need strl.h included anymore.
Nicholas J. Kain
2014-03-19 06:42:39 -0400
17f1889d4difchd_cmd() had a lot of helper macros that were more obfuscating than helpful. Remove them.
Nicholas J. Kain
2014-03-19 06:40:42 -0400
db6169e099Rename ifchd_cmd_* to ifcmd_*.
Nicholas J. Kain
2014-03-19 06:34:29 -0400
4b78acb65aRemove an intermediate buffer in options.c after all of the functions operating on that buffer now always leave the buffer so that it has a valid list of commands.
Nicholas J. Kain
2014-03-19 06:32:13 -0400
2de848f2c7If the snprintf in ifcmd_raw() fails, then we can restore the buffer to its original state by zeroing out the data that was appended to the buffer by the failed snprintf.
Nicholas J. Kain
2014-03-19 06:14:50 -0400
a2e8136bc9options.c: Rewrite the ifchd_cmd_* options command generation functions.
Nicholas J. Kain
2014-03-19 06:07:01 -0400
89d4649439options.c: Conditionalize some functions to only be compiled for ndhs, as ndhc does not use them.
Nicholas J. Kain
2014-03-19 06:00:45 -0400
861ab28186Reduce the scope of a static variable, and zero-initialize a structure just to satisfy cppcheck even though it should be safe.
Nicholas J. Kain
2014-03-19 06:00:08 -0400
597c858f44duiaid.c: Trivial style cleanups. No functional change.
Nicholas J. Kain
2014-03-19 05:58:29 -0400
e188658c4cStore the leasefile in the state directory by default, since a state directory is now the normal mode of operation because of RFC4361.
Nicholas J. Kain
2014-03-19 04:12:24 -0400
b1e1ccf7c3Add support for setting the metric for the default GW route.
Nicholas J. Kain
2014-03-19 01:13:11 -0400
ce99b0a6d7Update documentation and add '-s' switch to change the state directory.
Nicholas J. Kain
2014-03-19 00:46:54 -0400
15598c9207Support RFC4361.
Nicholas J. Kain
2014-03-19 00:42:32 -0400
aad83608d1Add a lot of const annotations to options.[ch].
Nicholas J. Kain
2014-03-18 03:38:32 -0400
cd269c7261Make ndhc RFC6842-compliant.
Nicholas J. Kain
2014-03-18 03:13:51 -0400