]> git.ipfire.org Git - thirdparty/dhcpcd.git/log
thirdparty/dhcpcd.git
5 years agoBSD: ignore XEN DOM0 virtual interface xvif
Roy Marples [Tue, 4 Feb 2020 16:30:29 +0000 (16:30 +0000)] 
BSD: ignore XEN DOM0 virtual interface xvif

5 years agoif: decode XEN vif1.2 and xvif1i2 as vif1:2
Roy Marples [Tue, 4 Feb 2020 16:29:07 +0000 (16:29 +0000)] 
if: decode XEN vif1.2 and xvif1i2 as vif1:2

5 years agoBSD: When applying RA base information, get info without privsep
Roy Marples [Tue, 4 Feb 2020 15:44:49 +0000 (15:44 +0000)] 
BSD: When applying RA base information, get info without privsep

privsep cannot current pass it back ..... duh

5 years agoRevert "BSD: When applying RA base information, ensure flags are correct"
Roy Marples [Tue, 4 Feb 2020 15:39:50 +0000 (15:39 +0000)] 
Revert "BSD: When applying RA base information, ensure flags are correct"

This reverts commit 8437a9be7c91dc24915d1fbc0cbe59618ebb1bbe.

5 years agoBSD: When applying RA base information, ensure flags are correct
Roy Marples [Tue, 4 Feb 2020 15:21:40 +0000 (15:21 +0000)] 
BSD: When applying RA base information, ensure flags are correct

For some resaon, under privsep only, SIOCGIFINFO_IN6 returns 0
in flags even though the kernel seems to set it correctly.
SIOCSIFINFO_IN6 *will* overwrite flags regardless, so ensure
it has the correct value for dhcpcd.

5 years agoStyle
Roy Marples [Tue, 4 Feb 2020 15:01:18 +0000 (15:01 +0000)] 
Style

5 years agoeloop: cast away a compile warning
Roy Marples [Tue, 4 Feb 2020 02:38:35 +0000 (02:38 +0000)] 
eloop: cast away a compile warning

5 years agoARP: add a comment to note ethernet padding upto 60 bytes.
Roy Marples [Fri, 31 Jan 2020 11:04:27 +0000 (11:04 +0000)] 
ARP: add a comment to note ethernet padding upto 60 bytes.

5 years agoBSD: Don't log an error failing to get inet6 adress flags
Roy Marples [Wed, 29 Jan 2020 17:06:34 +0000 (17:06 +0000)] 
BSD: Don't log an error failing to get inet6 adress flags

When the interface departs and we're validating route messages.
This mirrors inet.

5 years agoMention chroot
Roy Marples [Mon, 27 Jan 2020 21:47:24 +0000 (21:47 +0000)] 
Mention chroot

5 years agoIPv4LL: A state might not always exist when running the script.
Christos Zoulas [Mon, 27 Jan 2020 12:56:04 +0000 (12:56 +0000)] 
IPv4LL: A state might not always exist when running the script.

For example, we deleted existing IPv4LL addresses that dhcpcd
doesn't directly control when we obtained a DHCP lease.

5 years agoDHCP: redirect message to other interfaces if received for inactive
Roy Marples [Sun, 26 Jan 2020 16:44:40 +0000 (16:44 +0000)] 
DHCP: redirect message to other interfaces if received for inactive

This is unlikely but possible if you have a manual subnet route
via another interface you normally receive a DHCP address inside
this subnet.

Saves spamming the log that we received for an inactive interface
as well.

5 years agodhcpcd: report how large a route rocket receive buffer size we set
Roy Marples [Sun, 26 Jan 2020 15:58:51 +0000 (15:58 +0000)] 
dhcpcd: report how large a route rocket receive buffer size we set

5 years agodhcpcd: When route socket overflows, report how large it is.
Roy Marples [Sun, 26 Jan 2020 15:46:41 +0000 (15:46 +0000)] 
dhcpcd: When route socket overflows, report how large it is.

Of course Linux likes to double it, so cater for this.

5 years agoif: Don't use a variable length buffer
Roy Marples [Sun, 26 Jan 2020 15:46:16 +0000 (15:46 +0000)] 
if: Don't use a variable length buffer

Otherwise SSP complains.

5 years agodhcpcd: For anonymous do not bring interface up if was down
Roy Marples [Sat, 25 Jan 2020 13:27:36 +0000 (13:27 +0000)] 
dhcpcd: For anonymous do not bring interface up if was down

We need to bring the interface down on carrier loss to change the
hardware address, but we should only bring it up again if it was
up previously.

After all it's really an administrative flag.

5 years agoBSD: Fix INET flags on RTM_NEWADDR messages.
Roy Marples [Wed, 22 Jan 2020 19:25:14 +0000 (19:25 +0000)] 
BSD: Fix INET flags on RTM_NEWADDR messages.

5 years agoDHCP: Defend already configured static addresses
Roy Marples [Wed, 22 Jan 2020 17:15:30 +0000 (17:15 +0000)] 
DHCP: Defend already configured static addresses

5 years agoARP: Fix defend time check
Roy Marples [Wed, 22 Jan 2020 16:32:09 +0000 (16:32 +0000)] 
ARP: Fix defend time check

5 years agoprivsep: Fix compile on Linux
Roy Marples [Wed, 22 Jan 2020 16:24:38 +0000 (16:24 +0000)] 
privsep: Fix compile on Linux

setgroup requires <grp.h>

5 years agoDHCP: Take interface reference on Address Defend failure
Roy Marples [Wed, 22 Jan 2020 16:21:12 +0000 (16:21 +0000)] 
DHCP: Take interface reference on Address Defend failure

As the astate could be freed on dropping the DHCP state.

5 years agologging: Always log to syslog(3).
Roy Marples [Wed, 22 Jan 2020 12:00:10 +0000 (12:00 +0000)] 
logging: Always log to syslog(3).

--logfile may not work that well in a chroot on receipt of SIGUSR2
because the path is of course different.

Might have to drop this option soon as I have no good ideas
on how to resolve it :(

5 years agoRemove RC_SVCNAME.
Roy Marples [Tue, 21 Jan 2020 22:39:55 +0000 (22:39 +0000)] 
Remove RC_SVCNAME.

We've not used that for quite a while now.....

5 years agoprivsep: Note CHROOT script
Roy Marples [Tue, 21 Jan 2020 22:35:31 +0000 (22:35 +0000)] 
privsep: Note CHROOT script

While here make BUILDING.md match reality and fix a warning
compiling without privsep.

5 years agoLinux: setup mounts in chroot
Roy Marples [Tue, 21 Jan 2020 22:09:14 +0000 (22:09 +0000)] 
Linux: setup mounts in chroot

This allows dhcpcd to work.
udev sadly requires /run/udev as well, so heh ho.

5 years agoprivsep: Fix compile on Alpine Linux
Roy Marples [Tue, 21 Jan 2020 20:37:12 +0000 (20:37 +0000)] 
privsep: Fix compile on Alpine Linux

5 years agoprivsep: Only fetch PRIVSEP_USER at init
Roy Marples [Tue, 21 Jan 2020 20:17:27 +0000 (20:17 +0000)] 
privsep: Only fetch PRIVSEP_USER at init

And not each time it's needed - we don't want a sudden change in
the details to affect a running dhcpcd.

5 years agoprivsep: copy configuration file into chroot
Roy Marples [Tue, 21 Jan 2020 20:08:56 +0000 (20:08 +0000)] 
privsep: copy configuration file into chroot

Only if it has changed.
Saves having to maintian it outside of dhcpcdm in a script or
something.

5 years agoinet6: fix forced RA expiration for a given interface
Roy Marples [Tue, 21 Jan 2020 16:26:41 +0000 (16:26 +0000)] 
inet6: fix forced RA expiration for a given interface

5 years agoprivsep: chroot the master process
Roy Marples [Tue, 21 Jan 2020 16:17:18 +0000 (16:17 +0000)] 
privsep: chroot the master process

This means that the privileged actioneer process needs to cleanup
sockets and pidfile.
It also has some reliance on how dhcpcd is started to create
a decent chroot area AND copy the configuration file to it.

5 years agoprivsep: Close stdout/stderr after forking processes
Roy Marples [Tue, 21 Jan 2020 16:11:37 +0000 (16:11 +0000)] 
privsep: Close stdout/stderr after forking processes

Well, redirect them to /dev/null anyway.
Also tidy a few things in common whilst here.

5 years agoBSD: Improve RTM_NEWADDR/RTM_DELADDR validaton some more
Roy Marples [Tue, 21 Jan 2020 12:01:02 +0000 (12:01 +0000)] 
BSD: Improve RTM_NEWADDR/RTM_DELADDR validaton some more

5 years agoOnly ignore address messages from ourself for deletion.
Roy Marples [Mon, 20 Jan 2020 11:59:06 +0000 (11:59 +0000)] 
Only ignore address messages from ourself for deletion.

We need to process addition for flag changes.

5 years agoBSD: Validate RTM_NEWADDR as well
Roy Marples [Fri, 17 Jan 2020 22:27:18 +0000 (22:27 +0000)] 
BSD: Validate RTM_NEWADDR as well

This is important because the address could be added and quickly
deleted and RTM_NEWADDR arrvives after deletion.

5 years agoinet6: Check if we can try a new address on DAD failure.
Roy Marples [Fri, 17 Jan 2020 21:09:04 +0000 (21:09 +0000)] 
inet6: Check if we can try a new address on DAD failure.

Not all prefixes are autoconfable.

5 years agoinet6: Log expiration of a prefix if autoconf is not set
Roy Marples [Fri, 17 Jan 2020 20:33:20 +0000 (20:33 +0000)] 
inet6: Log expiration of a prefix if autoconf is not set

Rather than the address. Otherwise it looks wierd.

5 years agoMinor fix to prior.
Roy Marples [Fri, 17 Jan 2020 17:23:50 +0000 (17:23 +0000)] 
Minor fix to prior.

5 years agoOpenBSD: Support privacy extensions
Roy Marples [Fri, 17 Jan 2020 17:18:45 +0000 (17:18 +0000)] 
OpenBSD: Support privacy extensions

If course, OpenBSD is really different from other BSD's.
IN6_IFF_PRIVACY is their IN6_IFF_TEMPORARY.
Temporary addresses are on by default, you need to turn them
off on OpenBSD via ifconfig.
Temporary addresss timings are not configurable and the address
itself is always preferred over non temporary addresses within the
same scope.

5 years agoinet6: Temporary addresses only work if prefix + ifidlen == 128
Roy Marples [Fri, 17 Jan 2020 16:21:37 +0000 (16:21 +0000)] 
inet6: Temporary addresses only work if prefix + ifidlen == 128

Cater for various prefix lengths when using temporay addresses.

5 years agoprivsep: chdir after chroot
Roy Marples [Fri, 17 Jan 2020 14:02:59 +0000 (14:02 +0000)] 
privsep: chdir after chroot

chroot itself does not actually change the directory....

5 years agoinet6: Support a /128 autoconf prefix from RA
Roy Marples [Fri, 17 Jan 2020 13:22:57 +0000 (13:22 +0000)] 
inet6: Support a /128 autoconf prefix from RA

This is apparently a thing. Unsure why, but heh ho.

5 years agoLinux: Silence a warning on 32-bit Linux
Roy Marples [Fri, 17 Jan 2020 12:58:28 +0000 (12:58 +0000)] 
Linux: Silence a warning on 32-bit Linux

5 years agoBSD: Disable checking rtm_pid and comment why.
Roy Marples [Thu, 16 Jan 2020 21:56:35 +0000 (21:56 +0000)] 
BSD: Disable checking rtm_pid and comment why.

It's because we turn off SO_USELOOPBACK.
Also note that this trick does NOT work for addresses.

5 years agoBSD: Ignore messages from ourself in privsep.
Roy Marples [Thu, 16 Jan 2020 21:47:27 +0000 (21:47 +0000)] 
BSD: Ignore messages from ourself in privsep.

5 years agoLinux: Use the persistent route socket for writing netlink msgs
Roy Marples [Thu, 16 Jan 2020 17:33:24 +0000 (17:33 +0000)] 
Linux: Use the persistent route socket for writing netlink msgs

This reverts 2c8dc9ee7.
This *should* be fine because we can detect ourself and privsep
sending messages so we can ignore them.

5 years agoTypo
Roy Marples [Thu, 16 Jan 2020 14:48:25 +0000 (14:48 +0000)] 
Typo

5 years agodhcpcd: Ignore SIGPIPE, prefer EPIPE.
Roy Marples [Thu, 16 Jan 2020 03:20:53 +0000 (03:20 +0000)] 
dhcpcd: Ignore SIGPIPE, prefer EPIPE.

This is mainly to get dhcpcd running in privsep on my ERLITE
router running some NetBSD pre-9 branch.

So far, seems harmless....

5 years agoanonymous: Allow Domain Name option through.
Roy Marples [Wed, 15 Jan 2020 19:16:58 +0000 (19:16 +0000)] 
anonymous: Allow Domain Name option through.

To be clear, we don't send our domain name, we just request one
for old servers that don't support Domain Search.

5 years agoDHCP6: Fix writing mudurl
Roy Marples [Wed, 15 Jan 2020 17:22:12 +0000 (17:22 +0000)] 
DHCP6: Fix writing mudurl

5 years agodhcpcd: Don't report DUID or IAID in anonymous.
Roy Marples [Wed, 15 Jan 2020 16:24:37 +0000 (16:24 +0000)] 
dhcpcd: Don't report DUID or IAID in anonymous.

It just confuses things.

5 years agoSolaris: Add a shim for hardware address randomisation
Roy Marples [Wed, 15 Jan 2020 16:18:54 +0000 (19:18 +0300)] 
Solaris: Add a shim for hardware address randomisation

Doesn't work yet.

5 years agoDHCP6: Fix a bogus compile warning
Roy Marples [Wed, 15 Jan 2020 16:18:35 +0000 (19:18 +0300)] 
DHCP6: Fix a bogus compile warning

5 years agoLinux: Support hardware address randomisation
Roy Marples [Wed, 15 Jan 2020 16:07:27 +0000 (16:07 +0000)] 
Linux: Support hardware address randomisation

5 years agoFreeBSD: Support hardware address randomisation
Roy Marples [Wed, 15 Jan 2020 15:49:23 +0000 (15:49 +0000)] 
FreeBSD: Support hardware address randomisation

5 years agoif: Fix hardware address randomisation
Roy Marples [Wed, 15 Jan 2020 15:48:27 +0000 (15:48 +0000)] 
if: Fix hardware address randomisation

And copy back the actual length of it, not the whole buffer.

5 years agodhcpcd: carrier up does not mean interface is up
Roy Marples [Wed, 15 Jan 2020 15:47:45 +0000 (15:47 +0000)] 
dhcpcd: carrier up does not mean interface is up

And we really want it up here.

5 years agoImplement Anonymity Profiles for DHCP Clients, RFC 7844
Roy Marples [Wed, 15 Jan 2020 14:28:24 +0000 (14:28 +0000)] 
Implement Anonymity Profiles for DHCP Clients, RFC 7844

This works by randomising the hardware address when carrier is down
and using this to construct a DUID LL which is used over any saved
DUID. IAID is defaulted to zero and hostname + FQDN are disabled.
Then every possible option is masked out except for essential ones.

It's possible to request options *after* anonymous option which
will enable it. This is RFC compliant and allows 100% flexability
in letting the user decide what, if any, details leek out.

This is disabled by default.
Only works on NetBSD, other OS coming shortly.

5 years agoLinux: close the netlink privsep socket once done.
Roy Marples [Tue, 14 Jan 2020 11:53:29 +0000 (11:53 +0000)] 
Linux: close the netlink privsep socket once done.

5 years agoprivsep: Remove fd's from event loop and ensure all closed.
Roy Marples [Tue, 14 Jan 2020 11:53:05 +0000 (11:53 +0000)] 
privsep: Remove fd's from event loop and ensure all closed.

5 years agocontrol: avoid unlinking the socket when sending commands
Roy Marples [Thu, 9 Jan 2020 15:59:15 +0000 (15:59 +0000)] 
control: avoid unlinking the socket when sending commands

5 years agoprivsep: Fix prior so we init
Roy Marples [Thu, 9 Jan 2020 15:52:41 +0000 (15:52 +0000)] 
privsep: Fix prior so we init

5 years agoprivsep: Delay control startup after starting privsep
Roy Marples [Thu, 9 Jan 2020 15:39:18 +0000 (15:39 +0000)] 
privsep: Delay control startup after starting privsep

This means we don't need to close it for other processes.
Add ps_init so that we can change directory permissions before
starting privsep itself.

5 years agoDHCP: Spawn a listener in non master mode for a new lease
Roy Marples [Thu, 9 Jan 2020 14:48:56 +0000 (14:48 +0000)] 
DHCP: Spawn a listener in non master mode for a new lease

Fixes a privsep issue

5 years agoprivsep: sa_family_t can be a different size
Roy Marples [Thu, 9 Jan 2020 00:33:03 +0000 (00:33 +0000)] 
privsep: sa_family_t can be a different size

5 years agoprivsep: correct debug struct name
Roy Marples [Thu, 9 Jan 2020 00:32:39 +0000 (00:32 +0000)] 
privsep: correct debug struct name

5 years agoprivsep: If the privsep user does not exist, reset errno
Roy Marples [Wed, 8 Jan 2020 20:32:15 +0000 (20:32 +0000)] 
privsep: If the privsep user does not exist, reset errno

Incase logerrx sets it....
Now we work on musl!

5 years agoioctl: The POSIX signature differs from BSD and glibc
Roy Marples [Wed, 8 Jan 2020 20:13:20 +0000 (20:13 +0000)] 
ioctl: The POSIX signature differs from BSD and glibc

BSD and glibc have the signature for request as unsigned long.
musl and Solaris have a signed int.

As such, we need to detect this at compile time and adjust the
signature of our internal ioctl functions to match.
To keep the onwire format the same, memcpy the request to the
unsigned long request and back again, thus preserving the signedness.

5 years agoLinux: privsep write uint to path needs to read the resultant error
Roy Marples [Wed, 8 Jan 2020 16:57:46 +0000 (16:57 +0000)] 
Linux: privsep write uint to path needs to read the resultant error

Otherwise it hangs around and provides bogus errors to the next
caller of root processes.

5 years agoprivsep: Pad structs out so there are no uninited memory issues
Roy Marples [Wed, 8 Jan 2020 16:07:58 +0000 (16:07 +0000)] 
privsep: Pad structs out so there are no uninited memory issues

Add #ifdef'd out debug code for them as well.

5 years agoLinux: Improve privsep code a little
Roy Marples [Wed, 8 Jan 2020 15:58:57 +0000 (15:58 +0000)] 
Linux: Improve privsep code a little

5 years agoLinux: clean up some compile warnings without privsep
Roy Marples [Wed, 8 Jan 2020 14:26:01 +0000 (14:26 +0000)] 
Linux: clean up some compile warnings without privsep

5 years agoLinux: write uints to paths again
Roy Marples [Wed, 8 Jan 2020 12:24:38 +0000 (12:24 +0000)] 
Linux: write uints to paths again

Remove debug ... sigh

5 years agoDHCP6: Only set RT to state with callbacks.
Roy Marples [Wed, 8 Jan 2020 11:17:30 +0000 (11:17 +0000)] 
DHCP6: Only set RT to state with callbacks.

5 years agoeloop: header is now the single source of truth for SEC_PER_SEC
Roy Marples [Wed, 8 Jan 2020 00:43:11 +0000 (00:43 +0000)] 
eloop: header is now the single source of truth for SEC_PER_SEC

Saves duplication

5 years agoDHCP: Fix a bogus gcc warning
Roy Marples [Sat, 4 Jan 2020 07:44:10 +0000 (07:44 +0000)] 
DHCP: Fix a bogus gcc warning

5 years agoThis cast is no longer needed.
Roy Marples [Wed, 8 Jan 2020 00:13:44 +0000 (00:13 +0000)] 
This cast is no longer needed.

5 years agocommon: Remove some now unused timing definitions
Roy Marples [Sat, 4 Jan 2020 07:36:35 +0000 (07:36 +0000)] 
common: Remove some now unused timing definitions

5 years agodhcpcd: Use milliseconds rather than timespec for delays
Roy Marples [Sat, 4 Jan 2020 07:32:34 +0000 (07:32 +0000)] 
dhcpcd: Use milliseconds rather than timespec for delays

5 years agocommon: Remove now unused timespec macros
Roy Marples [Sat, 4 Jan 2020 07:28:35 +0000 (07:28 +0000)] 
common: Remove now unused timespec macros

5 years agoinet6: Use milliseconds rather than timespec for calculating delays
Roy Marples [Sat, 4 Jan 2020 07:26:04 +0000 (07:26 +0000)] 
inet6: Use milliseconds rather than timespec for calculating delays

5 years agoinet6: Use milliseconds rather than timespec for calcuating delays
Roy Marples [Sat, 4 Jan 2020 07:20:50 +0000 (07:20 +0000)] 
inet6: Use milliseconds rather than timespec for calcuating delays

5 years agoARP: Use milliseconds rather than timespec for retransmission
Roy Marples [Sat, 4 Jan 2020 07:14:47 +0000 (07:14 +0000)] 
ARP: Use milliseconds rather than timespec for retransmission

5 years agoDHCP: Use milliseconds rather than timespec for retranmission
Roy Marples [Sat, 4 Jan 2020 06:54:23 +0000 (06:54 +0000)] 
DHCP: Use milliseconds rather than timespec for retranmission

5 years agoeloop: fix some warnings
Roy Marples [Tue, 7 Jan 2020 22:49:34 +0000 (22:49 +0000)] 
eloop: fix some warnings

5 years agocommon: We don't use timespeccmp anymore.
Roy Marples [Tue, 7 Jan 2020 22:38:40 +0000 (22:38 +0000)] 
common: We don't use timespeccmp anymore.

It's error prone when time wraps.

5 years agoinet6: Don't compare router dates when sorting
Roy Marples [Tue, 7 Jan 2020 22:36:56 +0000 (22:36 +0000)] 
inet6: Don't compare router dates when sorting

Newest routers are added at the end, so we prefer newest anyway.

5 years agoeloop: We no longer use timespec macros here
Roy Marples [Tue, 7 Jan 2020 22:31:17 +0000 (22:31 +0000)] 
eloop: We no longer use timespec macros here

5 years agoarp: use eloop_timespec_diff to handle wrapped times
Roy Marples [Tue, 7 Jan 2020 22:28:55 +0000 (22:28 +0000)] 
arp: use eloop_timespec_diff to handle wrapped times

5 years agocommon: Don't need timespecadd/sub anymore
Roy Marples [Tue, 7 Jan 2020 22:28:25 +0000 (22:28 +0000)] 
common: Don't need timespecadd/sub anymore

5 years agoDHCP6: Calulate ReTransmission using milliseconds
Roy Marples [Tue, 7 Jan 2020 22:15:09 +0000 (22:15 +0000)] 
DHCP6: Calulate ReTransmission using milliseconds

This is the exact formula in RFC8415 Section 15, the prior one
was not so exact.
This makes the code a lot simpler and removes the need for
complicated timespec handling.

5 years agoeloop: reduce timers rather than calculating expiry
Roy Marples [Tue, 7 Jan 2020 14:15:14 +0000 (14:15 +0000)] 
eloop: reduce timers rather than calculating expiry

This saves the need to store a created date per timer, we just need
to know when the timers were last changed which we can store in the
eloop.

This makes it easier to make the actual timeout for polling.

While here, add the eloop_timespec_diff function to workout the
elapsed time from usp to tsp even when time has wrapped on one or
both times.
This works if time wraps on the maximal size time_t allows AND
we know that tsp is always newer than usp.

5 years agoeloop: Allow for for timeouts greater than time_t and time wrapping
Roy Marples [Wed, 1 Jan 2020 11:18:49 +0000 (11:18 +0000)] 
eloop: Allow for for timeouts greater than time_t and time wrapping

On some systems time_t is int32_t.
However, on wire timeouts are generally uint32_t.
As such, we need to avoid using timespec internally except to
record when the timeout was created. Instead, record the timeout
as unsigned int seconds and long nanoseconds.

On long running systems using time_t as int32_t, monotonic time
would wrap after approximately 68 years. It's highly unlikely dhcpcd
would be running for so long, but just incase it does, the code
should now cope.

5 years agoWelcome to 2020!
Roy Marples [Fri, 3 Jan 2020 13:10:48 +0000 (13:10 +0000)] 
Welcome to 2020!

5 years agoinet: Open ARP for probing when not in privsep.
Roy Marples [Thu, 2 Jan 2020 16:07:58 +0000 (16:07 +0000)] 
inet: Open ARP for probing when not in privsep.

5 years agoinet: Allow forcing a host route from an interface without a lease
Roy Marples [Thu, 2 Jan 2020 11:14:13 +0000 (11:14 +0000)] 
inet: Allow forcing a host route from an interface without a lease

5 years agoinet6: Adjust prior so that we don't support old kernels
Roy Marples [Wed, 1 Jan 2020 22:52:43 +0000 (22:52 +0000)] 
inet6: Adjust prior so that we don't support old kernels

Mulitplying retrans could overflow on 32-bit kernels with
big timers, so just don't bother.

5 years agoMerge pull request #12 from andersk/ra-time-units
Roy Marples [Wed, 1 Jan 2020 22:35:56 +0000 (22:35 +0000)] 
Merge pull request #12 from andersk/ra-time-units

The RA times are provided in milliseconds, but commit
569051c8aa8fc297eb8edb7bd228e0fd353d30c1 (dhcpcd-8.1.3~18) “Linux:
prefer ms RA times” incorrectly scaled them by an extra factor of 1000
before writing them to retrans_time_ms and base_reachable_time_ms.
Instead, write the values in milliseconds directly to the *_ms files,
and correctly convert to jiffies or seconds for the other files if
necessary.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
5 years agoLinux: fix RA time unit confusion 12/head
Anders Kaseorg [Wed, 1 Jan 2020 19:42:47 +0000 (11:42 -0800)] 
Linux: fix RA time unit confusion

The RA times are provided in milliseconds, but commit
569051c8aa8fc297eb8edb7bd228e0fd353d30c1 (dhcpcd-8.1.3~18) “Linux:
prefer ms RA times” incorrectly scaled them by an extra factor of 1000
before writing them to retrans_time_ms and base_reachable_time_ms.
Instead, write the values in milliseconds directly to the *_ms files,
and correctly convert to jiffies or seconds for the other files if
necessary.

Fixes NixOS/nixpkgs#76710.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
5 years agooptions: Fix allocating the script option
Roy Marples [Fri, 20 Dec 2019 22:05:59 +0000 (22:05 +0000)] 
options: Fix allocating the script option

When passing PARSE_STRING_NULL we expect to store the string
NULL terminated. As such, allocate space for it an ensure we have
space for it.

5 years agoDHCP: Ensure we have a lease to extract options from.
Roy Marples [Thu, 19 Dec 2019 15:36:31 +0000 (15:36 +0000)] 
DHCP: Ensure we have a lease to extract options from.