summaryrefslogtreecommitdiffstats
path: root/bpf.c
Commit message (Collapse)AuthorAge
* Add (c) to CopyrightRoy Marples2009-05-01
|
* Enforce NetBSD KNF style moreRoy Marples2009-02-11
|
* Remove logger and exclusively uses syslog instead. This saves almost 2K on ↵Roy Marples2008-09-05
| | | | NetBSD/amd64 from before changing strerror to %m.
* Remove #ifdefs to disable specific bits of code. We now build everything - ↵Roy Marples2008-07-23
| | | | we're small enough :)
* fd -> raw_fdRoy Marples2008-07-16
|
* Fix sending of ARP packets.Roy Marples2008-07-10
|
* Cleaner fix for working with PCC.Roy Marples2008-07-03
|
* Work around PCC not supporting the __packed__ attribute on structures. ↵Roy Marples2008-07-03
| | | | dhcpcd now works fully with PCC on NetBSD-4.99.67.
* Cleaner code when ARP is disabled.Roy Marples2008-06-30
|
* Remove the signal array stack as our pipe handling should be secure enough ↵Roy Marples2008-06-10
| | | | now. Also, move the normalize close_on_exec and setting non block.
* Fix compile.Roy Marples2008-06-09
|
* Re-write the client state engine around a simple timer instead of complex ↵Roy Marples2008-06-08
| | | | loops. Use the re-transmission times as per RFC 2131. Integrate the ARP handling code in the new engine so we are able to defend our IPV4LL address whilst negotiating a DHCP lease. This also means we're able to bind the address and fork BEFORE waiting to send announcements which makes us appear faster on the commandline.
* Put my code at the top and UNCONST filters in bpf.cRoy Marples2008-05-22
|
* No need for this check with our non blocking sockets.Roy Marples2008-05-15
|
* get_packet 0 means no more buffer, so loops don't need to know the ↵Roy Marples2008-05-15
| | | | bpf/socket buffering.
* Fix bpf for the correct position on new buffers.Roy Marples2008-05-15
|
* Only alloc a buffer if size is different.Roy Marples2008-05-15
|
* Fix some valgrind errors, and work on Linux again.Roy Marples2008-05-15
|
* Improve get_packet API and memcpy to structure instead of using union pointers.Roy Marples2008-05-15
|
* Prettify code a little.Roy Marples2008-05-14
|
* BIOCIMMEDIATE isn't always availableRoy Marples2008-05-14
|
* Repair whitespace damage.Roy Marples2008-04-26
|
* We should send packets to a specific IP over the udp socket so we don't ↵Roy Marples2008-04-20
| | | | broadcast on layer 2 and unicast on layer 3, #64.
* If _PATH_BPF is set, open that instead of searching for a free BPF device.Roy Marples2008-04-17
|
* Normally I hate massive code drops, but heh.Roy Marples2008-04-11
| | | | | | | | | | The code has been drastically re-arranged. Instead of populating a custom structure while parsing dhcp messages, we now pluck what we need right out of the message itself. We have custom functions and a lookup table to make this really easy. This makes us more like dhclient and udhcpc, and will enable us to easily add (and remove!) more dhcp options without having to actually change the code (much). We now store the real dhcp message we got in /var/db/dhcpcd-$iface.lease, the mtime of the file being used as when we got the lease. This file is read in when re-using an old lease instead of parsing the .info file. The benefit of all of this means that we're actually ~15k smaller when compiled with the same features. This has been tested for quite some time, and I'm pretty sure most bugs with the 3.2 branch have been fixed whilst making this. Right now, we are 99% command line compatible with the 3.2 branch.
* read(2) works on ssize_t so we should use this rather than size_t for our ↵Roy Marples2008-03-31
| | | | buffers. A DHCP or ARP packet still easily fits into this.
* Pointless looping in bpf.packet, as pointed out by D. Young.Roy Marples2008-03-30
|
* Rework our error handling code a little to save ~5k on x86_64Roy Marples2008-03-29
|
* Fix compile on BSD.Roy Marples2008-03-24
|
* Split interface and socket out into OS bpf, if-bsd and if-linux.Roy Marples2008-03-24