| Commit message (Collapse) | Author | Age |
| |
|
|
| |
Should disard a harmless diagnostic.
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
We can use IN_IFF_TENTATIVE for this.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is achieved by checking that the interface is wireless,
IFF_UP and IFF_LOWER_UP are present, but IFF_RUNNING is missing.
This gives exactly the same support as modern NetBSD when carrier
loss is detected, but without the address verifications when the
carrier comes back as that needs to be handled in the kernel.
While IP setup is maintained, other configuration data is discarded.
Note that this should be improved in the future.
Thanks to Boris Krasnovskiy <borkra@gmail.com> for helping with this.
|
| |
|
|
|
|
|
| |
Move the IS_LINK_UP macro to if_is_link_up function to reduce
binary size.
Rather than DHCPCD_LINK option controlling the carrier state,
use it in if_is_link_up to determine the outcome.
|
| |
|
|
|
| |
So we can report receive buffer size.
Important for route(4) overflow so we can try and set a bigger buffer.
|
| |
|
|
|
| |
If FreeBSD ever implements RO_MISSFILTER it will need special
rights to work over Capsium.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Vastly improve and simplify link detection on BSD.
dhcpcd either examines the whole system via getifaddrs(3) or
reacts to events via route(4).
In both cases we have struct if_data which has ifi_link_state.
Armed with this knowledge, we no longer need SIOCGIFDATA or
SIOCGIFMEDIA.
To solve the issue of newly attached interfaces having
LINK_STATE_UNKNOWN or some interfaces not even changing it,
we only change the local knowledge of interface flags when
reports them by getifaddrs(3) or route(4) when we change them.
For example, if we set IFF_UP and it succeeds we don't set this
internally until reported by the kernel as above.
This keeps flags and link state in sync with each other.
The hope is that the kernel can set the real link state before
it reports IFF_UP.
As such, we no longer require the poll option or need to enter a
tight loop for old interfaces.
|
| | |
|
| | |
|
| |
|
|
|
|
| |
So setup the #defines like so.
On OpenBSD, pledge blocks it and there is no escape.
Luckily we already allow indirect ioctls via privsep so it works fine.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
Hopefully this nails link state once and for all on BSD.
|
| |
|
|
|
|
|
|
|
|
|
| |
Not all interfaces report media state to get the link state.
However, link state is available from getifaddrs(3) ifa_data
for AF_LINK addresses.
Testing shows that link state is also sent correctly via
route(4) messages for the same interface.
This makes pppoe(4) interfaces more reliable on FreeBSD and OpenBSD.
|
| |
|
|
| |
Also add os_init incase other os need similar in the future.
|
| |
|
|
|
| |
Only to be used if the interface does not report carrier state
changes for whatever reason.
|
| |
|
|
|
| |
I don't think FreeBSD or DragonFly ever filtered it out, so
all the BSD family should now have parity here.
|
| |
|
|
|
|
|
| |
Rather than if genered by an address.
This allows RA prefix routes without an address to be non static,
so you could derive whether a route came from something autoconf
or not.
|
| | |
|
| |
|
|
|
|
|
|
|
| |
You never know when another sandbox tech comes around.
While here, add limits for every socket in the unpriviledged
processes. Some were absent before.
Also, note that RLIMIT_NOFILE breaks our control socket so
temporary disable that.
|
| |
|
|
| |
This makes the heavy weight call even more heavy weight :(
|
| |
|
|
|
|
|
|
|
| |
Achieved by adding IPC to ignore interfaces names based on
the interface group.
This means every process just pledges stdio for IPC which the
exception of the master process which also pledges route so it
can access the routing table.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Except for the priviledged process.
This is quite an in-depth change:
* ARP is now one process per address
* BPF flags are now returned via privsep
* BPF write filters are locked when supported
* The root process sends to the network
The last step is done by opening RAW sockets and then sending a UDP
header (where applicable) to avoid binding to an address
which is already in use by the reader sockets.
This is slightly wasteful for OS's without sandboxing but does
have the very nice side effect of not needing a source address
to unicast DHCPs replies from which makes the code smaller.
|
| |
|
|
|
|
|
|
|
|
| |
This allows us to move the database directory back into the
root of the filesystem.
While here, harden the files by denying any user read access to them.
As part of this change, init the DUID from any machine data and
cache the default DHCP vendor field before dropping priviledges as we
may lose access to this later.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
| |
It seems that FreeBSD doesn't allow binding to scoped addresses,
so let's use our functions everwhere rather than directly
setting scope.
|
| |
|
|
|
|
| |
linkmtu will vanish from nd_ifinfo along with other things.
Also, there is not need to pre-fetch ifinfo because flags are no
longer updated when setting ifinfo back again.
|
| | |
|
| | |
|
| |
|
|
|
| |
NetBSD will follow suit once the code in the kernel to handle RA
has been removed.
|
| |
|
|
|
|
|
|
| |
This instructs dhcpcd to create a temporary address for each
address generated from a RA.
As such, dhcpcd no longer looks at the kernel option for it
as the functionality is being removed from some or never existed
in the first place.
|
| |
|
|
| |
As the implemention might be removed one day.
|
| | |
|
| |
|
| |
Shortly after dhcpcd started using these constants, they were dropped from OpenBSD kernel headers as they're only used by rad(8). Switch to dhcpcd's own constants instead, fixing build on recent -current.
|
| | |
|
| |
|
|
| |
The actual warning about the lack of filtering is enough.
|
| | |
|
| | |
|
| |
|
|
|
|
| |
This allows dhcpcd to only listen for RTM_MISS generated by
default routers dhcpcd *could* install so if one becomes
unreachable we can pick another.
|
| | |
|