Commit Graph

150 Commits

Author SHA1 Message Date
roy
c1ce8e7e2b Sync 2014-11-26 16:05:14 +00:00
roy
fd710a4140 Sync 2014-11-26 13:43:06 +00:00
roy
3c322f3bc1 Sync 2014-11-14 12:00:54 +00:00
roy
c38e639c09 Add RCSIDs 2014-11-07 20:51:02 +00:00
roy
3eaad260cb Sync 2014-11-07 20:43:33 +00:00
roy
32584761dd Sync 2014-11-07 20:32:04 +00:00
roy
e2e4bfd1df Sync 2014-10-29 01:08:31 +00:00
roy
61932153cd Sync 2014-10-17 23:42:24 +00:00
roy
77cf2730df Sync 2014-10-06 18:22:29 +00:00
roy
041ac88e49 Import dhcpcd-6.5.0 with the following changes:
*  Fix an unaligned access error on BeagleBone Black with FreeBSD.
     Thanks to Guy Yur for the patch.
  *  Remove the fast loop trying to up an interface which does not
     report carrier.
  *  Remove vis based encoding - instead validate against option type and
     stop at invalid [1]
     This removes all shell escaped encoding - dhcpcd will assume that IF
     the --script option is a shell, it will quote variables correctly.
     The stock dhcpcd-run-hooks does.
  *  dhcpcd -V now prints how the variables will be decoded.
  *  Changed some options in dhcpcd-definitions.conf to more sensible defaults.
  *  Don't daemonise on delegated address dad.
  *  Don't drop delegated reject route when forking.
  *  Fix IPv6 handling of link-local addresses on KAME stacks.
  *  Work on OpenBSD-5.6 without any special interface setup needed.
  *  Callout to handlecarrier when we don't have real carrier support and
     rely on looking at IFF_UP and IFF_RUNNING.
     This allows our hooks to know that dhcpcd thinks we have a carrier or not.

[1] DHCP option encodings defined in dhcpcd-definitions.conf
  *  domain (RFC3397)/dname (string) is strict domain name allowance
     (ie, [alnum] with _- (but not at the start or end))
  *  string is now printable ascii (1-127) until invalid
  *  ascii is all ascii (1-127) until invalid
  *  raw is all chars (1-255) until NUL
  *  binhex is a hex representation of the option including embedded NULs
  *  ssid is still escpaed octal because it's expected to be human readable
     AND can technically be all NUL
  *  everything else has strict option -> value encoding
2014-10-06 18:20:16 +00:00
roy
e3e82f6374 Sync 2014-09-27 11:00:07 +00:00
roy
40dcca62eb Import dhcpcd-6.4.7 with the following change:
*  Fix an impossible analyser error and correctly assign unset iaids.
2014-09-27 10:58:10 +00:00
roy
edf064d2d0 Sync 2014-09-27 01:17:34 +00:00
roy
83f33c897c Import dhcpcd-6.4.6 with the following changes:
*  Detect removal of IPv6 routes
  *  Don't add link-local addresses to POINTOPOINT interfaces
  *  Don't discard expired DHCPv6 leases when dumping them
  *  If a DHCPv6 lease has no timers, expire it right away
  *  Report delegated addresses
  *  Call dhcpcd-run-hooks correctly when delegated prefixes already exist
  *  Fix a memory error when ia_* config exists but IPv6 is disabled
  *  Ensure servername and bootfile are safely exported
  *  Sanitise the following characters using svis(3) with VIS_CTYLE and
     VIS_OCTAL:
         | ^ & ; < > ( ) $ ` \ " ' <tab> <newline>
     This allows a non buggy unvis(1) to decode it 100% and stays compatible
     with how dhcpcd used to handle encoding on most platforms.
     For systems that supply svis(3) there is a code reduction, for systems
     that do not, a slight code increase. This change mitigates systems
     affected by bash CVE-2014-6271 and CVE-2014-7169.
2014-09-27 01:14:51 +00:00
roy
06b615d894 Sync 2014-09-18 20:46:30 +00:00
roy
0d512cb656 Import dhcpcd-6.4.5 with the following changes:
*  Remove all instances of if_indextoname as we already know the index
  *  Check we have allocated IPv6 resources before checkings RA's
2014-09-18 20:43:55 +00:00
roy
f1cbc45c57 Sync 2014-09-16 22:27:04 +00:00
roy
f4cc42a9c0 Import dhcpcd-6.4.4 with the following changes:
*  Many bounds checking fixes from Tobias Stoeckmann
  *  Improve error when the authentication token cannot be found
  *  close the IPv4 specific UDP socket when done sending
  *  Implemented a write queue to the control sockets
  *  Only send interfaces to control sockets when in a BOUND state
  *  Add a sample controlgroup directive to dhcpcd.conf to make setup easier
  *  Add variables if_oneup and if_ipwaited so hook scripts know the overall
     state of dhcpcd better
  *  Pass RC_SVCNAME from enviromment to hooks so that a service hook can
     know it's name (may not be dhcpcd)
  *  Document every variable set for dhcpcd-run-hooks(8)
  *  Allow SSIDs with non printable characters to be used in ssid selection
     in dhcpcd.conf
  *  Add an unprivileged control socket so that normal users can obtain
     dhcpcd running state
2014-09-16 22:23:17 +00:00
roy
648f3093d2 Sync 2014-07-30 15:47:32 +00:00
roy
b15082aeb8 Import dhcpcd-6.4.3 with the following changes:
*  Correct DHCPv6 Prefix Delegation option decoding
  *  Poll interfaces on BSD for IFF_RUNNING if link state cannot be obtained
  *  Check for an IA to use in DHCPv6 lease validation
  *  Warn about exceeding IDGEN_RETRIES when a stable private address cannot
     be obtained
  *  Fix DHCP option overload handling, thanks to Tobias Stoeckmann
2014-07-30 15:44:09 +00:00
roy
8ce36d3976 Remove unused file. 2014-07-14 14:07:02 +00:00
roy
130d37ec50 Import dhcpcd-6.4.2 to fix the building of 6.4.1 2014-07-14 14:02:01 +00:00
roy
1f96c74429 Sync 2014-07-14 11:49:48 +00:00
roy
9d162be235 Import dhcpcd-6.4.1 with the following changes:
*  If just given a domain and no search list, make the search list the domain
  *  Skip arpping directives if we have a profile but not parsing one
  *  Allow the request of a DHCPv6 address or prefix, a prefix length must be
     specified
  *  Add the ability to dump DHCPv6 leases
  *  Improve startup with regards to carrier checking and adding a link-local
     IPv6 address
  *  Start the correct interface reference for added devices
  *  Support
     http://datatracker.ietf.org/doc/draft-ietf-dhc-dhcpv6-stateful-issues-06
     via the ia_pd_mix option
  *  Fix link handling where kernel reported flags in LINK_UP may not be
     valid when we actually process them
  *  Fix defining new options in dhcpcd.conf and requesting them
  *  Fix a potential segfault when reloading configurations
  *  Print user defined options via -V
  *  Add support for RFC6603, Prefix Exclude option
  *  When requesting a IA_PD and another IA type, create a psuedo interface
     to handle the IA_PD
  *  Handle truncated DHCPv6 saved leases
2014-07-14 11:45:02 +00:00
roy
11fd74d7c7 Fix for dhcpcd-6.4.0 2014-06-14 21:00:22 +00:00
roy
1578cb1fcc Sync 2014-06-14 20:55:37 +00:00
roy
a468f856ed Import dhcpcd-6.4.0 with the following changes:
*  Only fork when the RA has a RDNSS option AND a valid prefix OR no DHCPv6 instruction.
  *  Handle BSD per interface rtadv kernel flag.
  *  Add a reject route for the delegated prefix so that unassigned prefixes don't go back upstream.
  *  If not specified, Delegated Prefixes will get an automatic SLA of the interface index. If the biggest SLA and the assigned prefix fits into a /64 then dhcpcd creates a /64 prefix so that SLAAC works. If bigger than /64 is needed then dhcpcd creates one rounded upto the nearest multiple of 8. Unless a configured SLA of 0 is assigned, a reject route for the Delegated Prefix is installed to stop unassigned addresses trying to be resolved upstream. Addresses added from Delegated Prefixes now have a default address suffix of 1 instead of using a SLAAC style address.
  *  Don't spam timezone updates unless its actually changed.
  *  Support ND6_IFF_OVERRIDE_RTADV on BSD.
  *  Document why we don't send both FQDN and hostname options.
  *  Respect RFC4861 MAX_RTR_SOLICITATION_DELAY as specified in section 6.3.7.
  *  RFC2131 section 4.4.1 states the client SHOULD wait a random time between one and ten seconds to desynchronize the use of DHCP at startup. Instead we wait a random time between zero and one second to mirror the more modern IPv6RS and DHCPv6 standards unless overridden by defining RFC2131_STRICT.
  *  Always send a carrier as it's no longer encapsulated in the IPv4 stack. When stopping and not departed, run with the STOPPED reason but do not process it in hooks.
  *  Poll kernel neighbour reachability (SIOCGNBRINFO_IN6) for each router instead of sending and listening for Neighbour Soliciation/Advertisement packets. The kernel is privy to a lot more reachability information than userland is.
  *  Ensure that ND6_IFF_PERFORMNUD is set.
  *  controlgroup option changes group ownership of the control socket.
  *  Should use arc4random_uniform when wanting a randon number between 1 and N. Improve the compat arc4random function a little and re-stir on fork.
  *  -4 and -6 are now mutually exclusive and when running on a single interface per protocol pidfiles are created. This means that other control options suchs as -x and -n will require the -4 or -6 option as well.
  *  Implement Stable Private Addresses for SLAAC as per RFC7217. Enable this as default in dhcpcd.conf.
  *  Log error condition if a new or changed Router Advertisment to avoid spamming the log.
  *  Add an IPv6 link-local address before upping the interface if needed. Bring an interface up when we start it and not during discovery. As such, stop waiting on carrier for a second if we did.
  *  Add gateway option to enable the gateway or an interface/profile. Ensure the option and require options disable the nooption option - last wins.
  *  Restarting ntp/yp are not critical and their initialisation continues in the background as well so we may as well background the restart commands for faster dhcpcd performance.
2014-06-14 20:51:03 +00:00
roy
b7fc208426 Crank up the warnings and fortify the build. 2014-03-22 00:04:51 +00:00
roy
083b63d1f4 Sync 2014-03-14 11:31:11 +00:00
roy
f19170ec2b Import dhcpcd-6.3.2 with the following changes:
* Improvements to autoconf build emulation
  * CARRIER/NOCARRIER are now run outside of the IPv4 runs
  * validate domains correctly which contain a - on non bash shells
  * don't remove IPv6 addresses from internal state when added as tentative
  * HUP now rebinds, ALRM now releases - the -x and -k flags work as
    they used to
  * Add -M, --master option to force dhcpcd into master mode even if one
    interface is specified on the command line
  * Fix a crash when receiving a reconfigure key
  * Dumping a DHCPv4 lease works again
  * SEND_DAD code removed
  * hoplimit is no longer defined for DHCPv6 messages
  * hoplimit of 255 for IPv6 RS/ND message is now defined at the socket
    instead of ancillary data with the message
2014-03-14 11:27:36 +00:00
roy
7c6da338a5 Sync 2014-03-01 11:04:21 +00:00
roy
4595db4b43 Import dhcpcd-6.3.1 with the following changes
* all issuses reported by clang static analyser have been resolved.
2014-03-01 11:00:41 +00:00
roy
41cab36847 Build with FORTIFY_SOURCE 2014-02-25 14:10:09 +00:00
roy
edb7c05f00 Sync 2014-02-25 13:20:23 +00:00
roy
6d5dc1d303 Build new auth modules. 2014-02-25 13:16:04 +00:00
roy
07693f32a1 Import dhcpcd-6.3.0 with the following changes:
* IAID must be inside an interface block.
 * Detect IPv6 address flags on Linux.
 * Check that we have ctrl_interface defined in wpa_supplicant.conf and pass this parameter to wpa_cli(8). If not set, warn about not interacting with wpa_supplicant(8).
 * Skip Virtual Interface Masters. Currently this only applies to FreeBSD VAP masters as dhcpcd should only work on wlandev created clones.
 * Fix handling of ARP failures, thanks to Sebastian Huber.
 * Implement RFC 1321 MD5 Message-Digest if not provided in libc.
 * Implement RFC 2104 HMAC Keyed Hashing.
 * Implement RFC 3118 Authentication for DHCP Messages and RFC 3315 Authentication options.
 * Add nodhcp and nodhcp6 directives. Thanks to Sebastian Huber for the initial patch and testing.
 * Implement support for RFC 3203, FORCERENEW message.
 * Implement Force Renew Nonce Capability option, RFC6704
 * Support RECONFIGURE DHCPv6 messages.
 * Add support for DHCP auto configuration, RFC 2563.
 * Add support for the following RFCs
   + DHCP SLP Directory Agent, RFC2610
   + DHCP Name Service Search, RFC2937
   + DHCP PANA Authentication Agent, RFC5192
   + DHCP Lost Server, RFC5223
   + DHCP CAPWAP, RFC5417
   + DHCP Mobility Services, RFC5678
   + DHCP SIP UA, RFC6011
   + DHCP ANDSF, RFC6153
   + DHCP RDNSS Selection for MIF Nodes, RFC6731
   + DHCP TFTP Server Address, RFC5859
   + DHCP PXELINUX, RFC5071
   + DHCP Access Network Domain Name, RFC5986
   + DHCP Virtual Subnet Selection, RFC6607
   + DHCP Relay Agent Remote-ID, RFC4649
   + DHCP Relay Agent Subscriber-ID, RFC4580
   + DHCPv6 Relay-ID, RFC5460
   + DHCPv6 LIS Discovery, RFC5986
   + DHCPv6 SIP UA, RFC6011
   + DHCPv6 Network Boot, RFC5970
   + DHCPv6 Home Info Discovery in MIPv6, RFC6610
   + DHCPv6 RDNSS Selection for MIF Nodes, RFC6731
   + DHCPv6 Kerberos, RFC6784
   + DHCPv6 Relay-Triggered Reconfiguration, RFC6977
   + DHCPv6 SOL_MAX_RT, RFC7083
 * Open UDP sockets for *.*.*.*:bootpc and $ip_address:bootpc to avoid kernel ICMP unreachable messages
 * Moved global variables into context variables so dhcpcd is entirely thread safe.
   dhcpcd doens't use threads, but it can now be used in a pure threads (ie no process) environment.
 * Remove DEBUG_MEMORY guard and always free memory and resources. Remove all atexit(3) and exit(3) calls, instead exiting via the eloop.
 * Replace get_line with sscanf where applicable.
 * Remove custom set_cloexec and set_nonblock functions. Instead pass O_CLOEXEC or SOCK_CLOEXEC to open, socket, etc.
 * Don't use PATH_MAX - we already know the maximum length from the initial directory and IF_NAMESIZE.
 * Add a USE_SIGNALS define. If we're not using signals then we also create a control socket in the non MASTER case. We then use this to communicate instead of signals.
 * Fix arping moving to the next test if we find the IP address but do not have a profile for it. Thanks to David McGurty for the analysis.
 * Respect initial commandline arguments when rebooting via a signal.
2014-02-25 13:14:27 +00:00
roy
7a87327182 Specify correct run directory.
Fixes PR bin/48529 thanks to martin@
2014-01-17 18:36:25 +00:00
roy
4b2bc9385d Don't enforce rc.d usage in the default build. 2014-01-15 20:58:53 +00:00
roy
8e4e77c750 Sync 2014-01-15 20:43:21 +00:00
roy
6b85057a5c Import dhcpcd-6.2.1 with the folowing changes:
* on BSD only flush RA routers and prefixes when trying to own them.
 * Mark some data locations as read only and fix a build issue.
 * Fix some possible NULL dereferences, CID 1153963.
 * Fix CID: 1153964 and 1153966
 * Add support for RFC3495 DHCP option for CableLabs Clients.
   Note that for the TSP suboption 3 we only support the FQDN encoding.
 * Init system detection moved to dhcpcd-run-hooks(8)
 * Fix compile errors and warnings with IPv6 disabled.
2014-01-15 20:36:31 +00:00
roy
8860784217 Build with dhcpcd-6.2.0 2014-01-03 22:27:31 +00:00
roy
8ad72a7637 Sync 2014-01-03 22:24:41 +00:00
roy
322001baf8 Import dhcpcd-6.2.0 with the following changes:
* Fix NAK backoff when a server NAKs a REQUEST after a DISCOVER.
* Fix IPv6 ICMP filtering on Android (RS/RA now works)
* Fix sending of DHCPv6 FQDN when only hostname specified
* Add support for RFC3925 Vendor-Identifying Vendor Options
* Remove hard coded DHCP/DHCPv6 options and embed dhcpcd-definitions.conf.
  This actually results in a slightly smaller binary than before and has the added advantage that the option definitions are now all held within one file.
* Change IAID to default from the last 4 bytes of the MAC address.
  Rationale in the commit, but in a nutshell it allows for a stable IAID between reboots without persistent storage and across different OS's who name or number it differently to each other.
* RFC4242, Information Refresh Time Option for DHCPv6.
* Fix processing of inet4 addr in vendor options and terminate correctly.
* Preserve vendor encapsulated options.
* Fix renewal of Prefix Delegation. Only spam the log if a lease has a new address or changes the vltime of an existing address.
* Add noipv4 and noipv6 options.
* Warn about missing interfaces which require prefix delegation.
* If we timeout, remove any waitip config so that we daemonise correctly.
* Remove the IPv6 forwarding router check as valid use cases exist where you would want IPv6 RS/RA on a router.
* Pass the correct run directory to dhcpcd-run-hooks
2014-01-03 22:10:42 +00:00
joerg
5d70299db9 NUL != NULL, so use the correct literal 2013-11-18 19:55:29 +00:00
martin
7c50380698 Fix typo in previous 2013-11-14 09:11:39 +00:00
christos
5774707710 CID 1102787: Only copy the interface name if it is NUL terminated, avoiding
a buffer overrun by one in the equals case.
2013-11-14 04:24:33 +00:00
christos
dbb1d6e3ee CID 1102809: Fix uninitialized variable 2013-11-14 01:28:16 +00:00
christos
598bc8c2fc avoid pointer gymnastics 2013-10-20 03:14:34 +00:00
wiz
bd0fe7cd58 Remove trailing whitespace. 2013-09-20 21:40:56 +00:00
wiz
e21b239272 Sort, fix Dt. 2013-09-20 21:39:59 +00:00