summaryrefslogtreecommitdiffstats
path: root/src/if-bsd.c
Commit message (Collapse)AuthorAge
* BSD: Find the correct interface for tunneled routesRoy Marples2021-02-09
| | | | Should disard a harmless diagnostic.
* A belated welcome to 2021Roy Marples2021-01-31
|
* BSD: Plug a memory leakRoy Marples2021-01-28
|
* Check for NetBSD in prior, as we did beforeRoy Marples2020-12-27
|
* NetBSD: Map IP Persistance to roamingRoy Marples2020-12-27
| | | | We can use IN_IFF_TENTATIVE for this.
* Linux: Support wireless IP roamingRoy Marples2020-12-12
| | | | | | | | | | | | | | 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.
* dhcpcd: Simplify the link handling even moreRoy Marples2020-10-07
| | | | | | | 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.
* privsep: We need getsockopt as well as setsockopt on the link socketRoy Marples2020-10-03
| | | | | So we can report receive buffer size. Important for route(4) overflow so we can try and set a bigger buffer.
* privsep: allow CAP_SETSOCKOPT for route(4) fd.Roy Marples2020-10-02
| | | | | If FreeBSD ever implements RO_MISSFILTER it will need special rights to work over Capsium.
* BSD: struct if_data->ifi_link_state is the single source of truthRoy Marples2020-09-28
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* BSD: Ignore vether(4) devices by default.Roy Marples2020-09-27
|
* FreeBSD: Anticipate SIOCGIFDATA not working in CapsicumRoy Marples2020-09-24
|
* BSD: NetBSD is the odd man out with SIOCGIFDATARoy Marples2020-09-24
| | | | | | 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.
* BSD: Of course DragonFly does SIOCGIFDATA differently..Roy Marples2020-09-23
|
* Add a warning about priorRoy Marples2020-09-23
|
* Revert double variable defineRoy Marples2020-09-23
|
* FreeBSD lacks SIOCGIFDATA it seems.Roy Marples2020-09-23
|
* BSD: Use SIOCGIFDATA if no media support and no ifa_dataRoy Marples2020-09-22
| | | | Hopefully this nails link state once and for all on BSD.
* BSD: Detect initial link state in ifa_dataRoy Marples2020-09-22
| | | | | | | | | | | 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.
* Adjust prior so that message is logged before starting devRoy Marples2020-09-19
| | | | Also add os_init incase other os need similar in the future.
* dhcpcd: Add an option to poll the interface carrier stateRoy Marples2020-06-18
| | | | | Only to be used if the interface does not report carrier state changes for whatever reason.
* BSD: Allow non NetBSD and OpenBSD to set IN6_IFF_AUTOCONFRoy Marples2020-06-16
| | | | | I don't think FreeBSD or DragonFly ever filtered it out, so all the BSD family should now have parity here.
* BSD: Mark routes as static only from static configRoy Marples2020-06-15
| | | | | | | 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.
* BSD: Mark address AUTOCONF if no kernel RARoy Marples2020-06-14
|
* privsep: Limit rights generically rather than Capsicum specifcRoy Marples2020-06-05
| | | | | | | | | 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.
* BSD: In privsep with no GIFALIAS support? getifaddrs over privsepRoy Marples2020-06-05
| | | | This makes the heavy weight call even more heavy weight :(
* privsep: Remove pledges inet and dns from the master processRoy Marples2020-06-05
| | | | | | | | | 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.
* BSD: Ignore fwip(4)Roy Marples2020-06-02
|
* OpenBSD: Fix non privsep builds.Roy Marples2020-05-20
|
* Fix compile for prior on NetBSDRoy Marples2020-05-19
|
* privsep: Enable Capsicum for all processes.Roy Marples2020-05-19
| | | | | | | | | | | | | | | | | 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.
* privsep: Handle all file IO in the Priviledged ActioneerRoy Marples2020-05-12
| | | | | | | | | | 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.
* Fix warning for priorRoy Marples2020-05-10
|
* privsep: Fix prior for non pledge systemsRoy Marples2020-05-10
|
* privsep: Implement pledge(2) support as found on OpenBSDRoy Marples2020-05-10
|
* inet6: Move BSD get/set scope function to ipv6 for general useRoy Marples2020-05-07
| | | | | | It seems that FreeBSD doesn't allow binding to scoped addresses, so let's use our functions everwhere rather than directly setting scope.
* NetBSD: Gear up for kernel RA removal.Roy Marples2020-04-29
| | | | | | 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.
* WhitespaceRoy Marples2020-04-28
|
* if: support changing hardware address type on LinuxRoy Marples2020-04-23
|
* OpenBSD: set IN6_IFF_AUTOCONF for addresses generated from a RARoy Marples2020-04-20
| | | | | NetBSD will follow suit once the code in the kernel to handle RA has been removed.
* inet6: Add 'temporary' directive to the slaac optionRoy Marples2020-04-19
| | | | | | | | 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.
* BSD: Dont warn if the kernel does not support flushing routersRoy Marples2020-04-19
| | | | As the implemention might be removed one day.
* BSD: Fix temporary address managementRoy Marples2020-04-07
|
* use TEMP_PREFERRED/VALID_LIFETIME for OpenBSDStuart Henderson2020-04-03
| | | 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.
* Fix build without INET or INET6Roy Marples2020-04-02
|
* FreeBSD: Remove unused compile warningRoy Marples2020-03-30
| | | | The actual warning about the lack of filtering is enough.
* BSD: use satosin6 rather than a direct castRoy Marples2020-03-14
|
* BSD: Fix processing RTM_MISS for non NetBSD BSDsRoy Marples2020-02-09
|
* BSD: Add support for RO_MISSFILTER route(4) socket optionRoy Marples2020-02-08
| | | | | | 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.
* DragonFlyBSD: Fix compileRoy Marples2020-02-07
|