Commit Graph

  • 811cc67e16 Move add_requests() from dhcpmsg.c to options.c. Fixes a layering violation. Document an ugly-as-hell code bit in ifchange.c. Add some debugging messages for the netlink response code. Clean headers a bit more. Nicholas J. Kain 2011-03-30 07:26:42 -0400
  • 3c85228aaf Add new code for creating DHCP option data, and use it in ndhc.c. Nicholas J. Kain 2011-03-30 07:05:00 -0400
  • 13d9119f3a Remove dhcpd.h. Nicholas J. Kain 2011-03-30 05:55:12 -0400
  • ef9d9d26df Move some defines out of dhcpd.h. Nicholas J. Kain 2011-03-30 05:37:22 -0400
  • 6869a3ba20 Reduce log spam by removing the "adding option" print. Nicholas J. Kain 2011-03-30 05:33:44 -0400
  • d01b104d48 Handle netlink interface-up notification for non-DS_BOUND states. Nicholas J. Kain 2011-03-30 05:24:16 -0400
  • 1ef44c1e4b Document DHCP options in bound_if(). Nicholas J. Kain 2011-03-30 05:23:46 -0400
  • 9d03795a15 Wire up the netlink socket to the epoll handler. Still need to actually react to events in the processing function. Pass the client_state structure to the netlink code explicitly rather than making it a global variable. Nicholas J. Kain 2011-03-29 15:34:00 -0400
  • 55bc002ad6 Use netlink for getting interface mac and index in ndhc instead of ioctl. Nicholas J. Kain 2011-03-29 14:37:45 -0400
  • a53a82bbc5 After fork(), a signalfd-created file descriptor still returns signal info for the parent. Close and recreate a new signalfd after forking into the background. Nicholas J. Kain 2010-12-27 10:05:43 -0500
  • 03d3cbfdb9 Do not treat a failure to write the pid file after backgrounding after obtaining a lease as a fatal error. Nicholas J. Kain 2010-12-26 18:21:58 -0500
  • 11e71837fd Set arp socket as nonblocking. Nicholas J. Kain 2010-12-26 18:19:39 -0500
  • 6f483045f4 Remove redundant #include. Nicholas J. Kain 2010-12-26 18:17:41 -0500
  • 0f3d4598ad Add a missing header and remove an unused variable. Nicholas J. Kain 2010-12-26 15:06:16 -0500
  • ea4041983d Use non-blocking sockets for the listen socket. Nicholas J. Kain 2010-12-26 15:05:00 -0500
  • 8b97107b8d Allow receive of short dhcp packets over raw listen sockets. Nicholas J. Kain 2010-12-26 15:03:14 -0500
  • 08301a7053 Update DESIGN Nicholas J. Kain 2010-12-24 10:49:45 -0500
  • 121e4d1510 Fix --hostname option. Nicholas J. Kain 2010-12-24 10:44:06 -0500
  • d96cb14711 Fix stale declaration of arp_check(). Nicholas J. Kain 2010-12-24 10:40:46 -0500
  • 87b28de015 Fix --clientid option. Nicholas J. Kain 2010-12-24 10:27:24 -0500
  • c0b699ba88 Rename script.[ch] to ifchange.[ch]. Nicholas J. Kain 2010-12-24 10:12:41 -0500
  • eab048fec7 Remove old files from original ndhc. Nicholas J. Kain 2010-12-24 10:04:16 -0500
  • 08f7db1637 Rename clientpacket.c to dhcpmsg.c. Nicholas J. Kain 2010-12-24 10:01:12 -0500
  • d04916aec5 Rename arpping.[ch] to arp.[ch]. Nicholas J. Kain 2010-12-24 09:58:47 -0500
  • 8e905d0611 Move background() to sys.[ch]. Nicholas J. Kain 2010-12-24 09:47:09 -0500
  • 59a0661eb9 Move change_listen_mode to packet.c. Nicholas J. Kain 2010-12-24 09:41:52 -0500
  • 94ad810260 Move timeout and arp handling code out to arpping.c and timeout.c. Nicholas J. Kain 2010-12-24 09:32:58 -0500
  • adcc4bdd3d Move dhcp packet reply code to packet.c. Nicholas J. Kain 2010-12-24 08:55:59 -0500
  • 9390e131b6 Move client runtime state structure declaration and flags to config.h. Nicholas J. Kain 2010-12-24 07:07:48 -0500
  • 8a3deb3c6a Move dhcp client runtime global state into global struct client_state_t cs. Nicholas J. Kain 2010-12-24 07:00:42 -0500
  • 406e316274 Split state machine apart into functions. Nicholas J. Kain 2010-12-24 06:31:06 -0500
  • 6772ddac1b Rename dhcpc.h to config.h. Nicholas J. Kain 2010-12-24 06:00:37 -0500
  • d34c5f27b2 Make dhcp client timeout value signed. Add DHCP_STATE_NULL = 0 state and make LISTEN_NONE = 0. Nicholas J. Kain 2010-12-23 13:41:25 -0500
  • c45d116200 Async arp ping now works properly: arp_success() should be called on timeout Timeout delta now properly uses signed operators. listenFd properly initialized to -1. Nicholas J. Kain 2010-12-23 11:34:57 -0500
  • fa98b4c024 timeout values now have millisecond precision. Nicholas J. Kain 2010-12-02 00:15:03 -0500
  • e37ed0e16b arpping() no longer blocks and address verification via arp is now performed asynchronously in the main event loop. Nicholas J. Kain 2010-12-01 23:33:25 -0500
  • a154f96538 Use epoll() in ndhc. Nicholas J. Kain 2010-12-01 13:11:09 -0500
  • a259640779 Use signalfd() in ndhc. Nicholas J. Kain 2010-12-01 12:35:13 -0500
  • 712c8446d6 Update README. Nicholas J. Kain 2010-12-01 12:24:47 -0500
  • f2b4527179 Use epoll() and signalfd() in ifchd. Nicholas J. Kain 2010-12-01 12:22:08 -0500
  • fb56a9cb2b Make sure to #include <stddef.h> when using offsetof(). Nicholas J. Kain 2010-11-16 17:41:46 -0500
  • 9dce1a0378 Make sure our assigned address is unique on our segment by using arp. Nicholas J. Kain 2010-11-15 20:06:50 -0500
  • 5eb3c18b01 Indentation fix. Nicholas J. Kain 2010-11-14 08:49:58 -0500
  • ba553e5d94 Clean up end_option(), and fix a possible off-by-one in the bound check. Nicholas J. Kain 2010-11-14 07:50:21 -0500
  • 5a38e49a81 Update get_option() to use the function from busybox's udhcp variant; it's much easier to read. The original one is indecipherable, and thus it is difficult to verify correctness. Nicholas J. Kain 2010-11-14 03:41:36 -0500
  • 1ffd1d9df3 Replace 308 with DHCP_OPTIONS_BUFSIZE in options.c. Nicholas J. Kain 2010-11-14 02:02:32 -0500
  • 4ce4323d00 Replace sizeof(struct dhcpMessage) with DHCP_SIZE. Nicholas J. Kain 2010-11-14 02:01:17 -0500
  • 9421da3157 Don't zero-pad kernel-packet sent dhcp packets. Nicholas J. Kain 2010-11-14 01:56:54 -0500
  • f8d856cc0a Don't zero-pad sent raw dhcp packets and clean up packet.c. Nicholas J. Kain 2010-11-14 01:53:23 -0500
  • 8401d175a1 Remove a Win98 DHCP client bug workaround from get_packet(). Nicholas J. Kain 2010-11-14 01:12:32 -0500
  • 0661f4371b Untabify and reindent packet.h. Nicholas J. Kain 2010-11-14 00:54:05 -0500
  • 6a3b004eee Specialize init_header() to only handle client packets, move it to clientpacket.c, and make it static. Nicholas J. Kain 2010-11-14 00:52:32 -0500
  • 1cc648b5ad Clean up and comment listen_socket(). Nicholas J. Kain 2010-11-14 00:46:02 -0500
  • 86ef084835 Clean up parameter names and comment read_interface(). Nicholas J. Kain 2010-11-14 00:41:32 -0500
  • 987ba12982 Enforce upper and lower sanity bounds on lease times. Add some comments. Nicholas J. Kain 2010-11-13 19:37:08 -0500
  • aaca1ab6ef Formatting fixes. Nicholas J. Kain 2010-11-13 19:14:16 -0500
  • 675b527aac Remove some unnecessary memset() and an unused buffer in bound_if(). Nicholas J. Kain 2010-11-13 19:07:00 -0500
  • 00ec886737 Ident fix. Nicholas J. Kain 2010-11-13 19:04:28 -0500
  • ef3a69e00e Clean up an unnecessary buffer in perform_release(). Nicholas J. Kain 2010-11-13 18:49:46 -0500
  • f34fac92bd Remove bashism from the gentoo net script. Nicholas J. Kain 2010-11-13 16:12:17 -0500
  • 75206dce13 Check for failure in creating listen sockets in change_listen_mode(). Nicholas J. Kain 2010-11-13 12:34:22 -0500
  • faa56bb616 Make change_listen_mode() create a new socket instantly rather than waiting for select loop to cycle again. Works better in practice and simplifies the select loop, too. Nicholas J. Kain 2010-11-13 12:30:54 -0500
  • ccae6e4c8a Clean up unnecessary goto exit handler in raw_socket(). Nicholas J. Kain 2010-11-13 12:11:28 -0500
  • 028d3b7bae Clean up send_renew() a bit. Nicholas J. Kain 2010-11-13 12:00:06 -0500
  • a79d86609b Wrap raw_packet() with specialized bcast_raw_packet(). Nicholas J. Kain 2010-11-13 11:42:26 -0500
  • 9f7fe1de8b Use BPF to filter input on raw sockets. Nicholas J. Kain 2010-11-13 11:18:07 -0500
  • 71a3603934 Finish cleaning up get_raw_packet(). Use offsetof() to make UDP checksum verification a bit more compact. Nicholas J. Kain 2010-11-13 08:47:07 -0500
  • 693c9256e4 Add safe_read() to ncmlib and use it in ndhc. Nicholas J. Kain 2010-11-13 08:37:33 -0500
  • a43e69c7ae Factor out safe_write() into ncmlib and use it in ndhc as well. Nicholas J. Kain 2010-11-13 08:18:23 -0500
  • edf3b02b6a Fix header include guards to not use leading underscores. Nicholas J. Kain 2010-11-13 06:51:57 -0500
  • 336a54fa47 Clean dhcpd.h. Nicholas J. Kain 2010-11-13 06:48:50 -0500
  • bb5446cf02 Remove leases.h. Nicholas J. Kain 2010-11-13 06:45:34 -0500
  • a059b5bd13 Clean up 'unsigned long' used with the assumption that long == 32-bit. Nicholas J. Kain 2010-11-13 06:42:52 -0500
  • 8d9cc0bdb4 Remove unused attach_option() from options.c. Nicholas J. Kain 2010-11-13 06:28:03 -0500
  • 431bb5d11e Clean up paren use with sizeof and & in clientpacket.c. Nicholas J. Kain 2010-11-13 06:22:22 -0500
  • 35c4c773cd Remove unnecessary casts from setsockopt(). Prevent access to initialized memory in raw_socket()'s bind() call by using memset(). Nicholas J. Kain 2010-11-13 06:13:10 -0500
  • f59ccfb5b0 In sendto() and write(), make sure all pointer arithmetic is in byte sized units. Nicholas J. Kain 2010-11-13 05:59:15 -0500
  • 502419c598 More detailed error prints in get_raw_packet(). Nicholas J. Kain 2010-11-13 05:53:32 -0500
  • ce518cc99f Properly cast read buffer to (char *) in get_raw_packet(). Nicholas J. Kain 2010-11-12 21:54:20 -0500
  • 37bf851ca7 Clean up raw socket read error path a bit. Nicholas J. Kain 2010-11-12 21:44:28 -0500
  • 7026a9c120 Add gentoo rc script (for /lib64/rc/net on eg amd64) Nicholas J. Kain 2010-11-12 21:01:05 -0500
  • 2ae6025110 Zero length packets cannot be received now in get_raw_packet(). Nicholas J. Kain 2010-11-12 20:15:15 -0500
  • 0b1a3b4c14 Create a pidfile even in the case where ndhc never backgrounds. Nicholas J. Kain 2010-11-12 20:08:16 -0500
  • ac6f60c4fe Create a pidfile that matches the daemon process id when backgrounded. Nicholas J. Kain 2010-11-12 20:03:55 -0500
  • 9ce31ec4d8 Make background() idempotent in a cleaner way. Nicholas J. Kain 2010-11-12 19:50:04 -0500
  • 5f55dbc3ff Fix previous commit -- handle filling empty options properly. Clean up pidfile defaults and help message. Clean up the write/sendto fixes to be a bit more readable. Nicholas J. Kain 2010-11-12 19:43:16 -0500
  • 31d15af0fa Don't fork off subprocesses to send to ifchd. Totally unnecessary. Nicholas J. Kain 2010-11-12 19:04:51 -0500
  • c4f912a525 Fix a bug where a packet read would potentially stop before grabbing a full sized dhcp packet if one is available. Nicholas J. Kain 2010-11-12 18:56:30 -0500
  • 955031bce1 Somehow not all of ncmlib was version controlled. Fix. Nicholas J. Kain 2010-11-12 18:46:45 -0500
  • 5b7a3e43e0 Rename dhcpc.c to ndhc.c. Nicholas J. Kain 2010-11-12 18:46:02 -0500
  • eb6009a5ee Make write() and sendto() properly handle short writes and errors in ndhc. Make ndhc write a pidfile. Clean up defines.h and split out ifchd and ndhc specifics. Nicholas J. Kain 2010-11-12 18:44:49 -0500
  • e781322b4d Add defines for toggling packet send count before timeout and timeout length. Nicholas J. Kain 2010-11-12 18:19:19 -0500
  • c0703fc8c9 Handle option lists properly in script.c. Nicholas J. Kain 2010-11-12 18:04:54 -0500
  • 9d7ad2f11c Fix some strlcpy() misuse that cuts off the last character of the copied string. Clean up some log messages. Nicholas J. Kain 2010-11-12 17:24:54 -0500
  • f4a00f3826 Whitespace and indentation normalization. Nicholas J. Kain 2010-11-12 14:33:17 -0500
  • 2262845be6 Robustify get_raw_packet(). Error messages are now more specific, and read() properly handles short reads and EINTR/EAGAIN/EWOULDBLOCK. Update documentation. Nicholas J. Kain 2010-11-12 13:24:07 -0500
  • 81398c79fb Fix strlcpy to not truncate in ndhc. Length check cleanups. Use xmalloc() rather than malloc(). Nicholas J. Kain 2010-11-12 12:19:52 -0500
  • 8aa6d9a320 Fix file_exists() to deal with modern variant. Update README. Nicholas J. Kain 2010-11-12 12:05:37 -0500
  • 15f6bb66ee Move DESIGN and README to root directory. Nicholas J. Kain 2010-11-12 09:39:33 -0500
  • b2daf09c10 Move set_cap() to ncmlib/cap.[ch]. Nicholas J. Kain 2010-11-12 09:04:43 -0500