summaryrefslogtreecommitdiff
path: root/sbin
AgeCommit message (Collapse)Author
2021-08-04reference route(8) new nameserver command.Sebastian Benoit
2021-08-04Add a new 'nameserver' command to route(8).Sebastian Benoit
It sends nameserver proposals to resolvd(8) using the dns proposal protocol over the route socket. Based on a seperate program written by florian@. deraadt noticed some whitespace issues. more fixes and ok florian@
2021-08-04Do not enter a tight INIT -> REQUESTING -> INIT loop when the dhcpFlorian Obser
server responds to our DHCPDISCOVER but is then slow to respond to our DHCPREQUEST. MAX_EXP_BACKOFF_FAST was introduced to get us quickly out of the REBOOTING state when we switch networks and no dhcp server would NAK our old lease but just ignore us. This is not the issue here, there is a dhcp server willing to talk to us, it's just slow. Problem reported, tested & OK jca
2021-08-03Increase default data bytes limit for Child SAs to 4 GB.tobhe
Lower limits lead to excessive rekeying and lost data in high performance setups without much benefit. Brought up by mvs@ ok patrick@ sthen@
2021-08-01Do not abuse the IMSG_CTL_SEND_REQUEST imsg to transition toFlorian Obser
REBOOTING. There will be a few more cases internal to dhcpleased that have nothing to do with the control socket. While here move requesting a new lease via a call to dhclient under ifndef SMALL, nothing on the ramdisk uses this.
2021-07-28fix broken small build; ok florian@anton
2021-07-27Having 'taken charge' of the interface by eliminating otherKenneth R Westerback
dhclient instances for the interface, check if the IPv4 AUTOCONF flag is set. If it is, go quietly into that good night and let dhcpleased do its thing, comforted by the fact that dhcpleased knows that a new lease has been requested. requested, tested & ok florian@
2021-07-27Please muscle memory when dhclient $if is run and request a new lease.Florian Obser
An upcoming diff for dhclient(8) will make it exit when it discovers an autoconf flag at startup. "Quite a pleasing diff." deraadt@
2021-07-27Improve markup.Florian Obser
Suggested by schwarze
2021-07-27zap trailing comma in SEE ALSO;Jason McIntyre
2021-07-27'{' and '}' are fixed parts of the 'interface' decleration', not optional.Theo de Raadt
concern raised by kn. ok florian
2021-07-27The SIOCAIFADDR_IN6 ioctl could lose a race against another processFlorian Obser
configuring the same IP. I forgot to fix slaacd after fixing the same problem in dhcpleased. Pointed out by afresh1
2021-07-26Report write() and ioctl() errors encountered when writing GPT or MBR to disk.Kenneth R Westerback
Consolidate GPT/MBR read()/write() operations into DISK_writesectors() and DISK_readsectors(), producing clearer logic and consistent handling of i/o and errors. Add some DPRINTF() and #ifdef DEBUG sections to allow more detailed error reporting when desired.
2021-07-26small tweaks to dhcpleased.conf(5), ok jmc florianStuart Henderson
2021-07-26Implement possibility to send vendor class identifier (option 60) andFlorian Obser
client identifier (option 61). Some dhcp servers expect these options and refuse to hand out a lease without them. Need for vendor class identifier pointed out & tested by bket Need for client identifier pointed out by sthen Input & reads OK sthen (as part of a larger diff) OK kn (as part of a larger diff)
2021-07-26The SIOCAIFADDR ioctl could lose a race against another processFlorian Obser
configuring the same IP. Found the hard way by afresh1
2021-07-25If the lease didn't contain renewal or rebinding options set theFlorian Obser
defaults before validating the times to prevent excessive logging. Found the hard way & OK brynet
2021-07-25Do not doubt a secure (i.e. validated) NXDOMAIN response when we justFlorian Obser
switched networks. We validated it, we can't do better than that! While here reorder the long list of conditions to make it easier to understand when we doubt a response because we might be behind a captive portal. First list all conditions when we do not doubt the response and then the two conditions when we do doubt the response. OK benno
2021-07-25We store a list of resolver strategies in order of their preference inFlorian Obser
the configuration struct. This is also an implicit list of enabled resolver strategies. We have also stored an explict lookup array of enabled strategies outside of the configuration to be able to quickly answer "is this strategy enabled" without traversing the preferences list. Move this table into the configuration so that we don't need to "repair" it on config reload. This fixes a bug where on startup the preferences list and enabled lookup table were not in sync. It didn't matter in practice since we do a config reload and then pass in DNSSEC trustanchors on startup. Both actions combined repaired things. OK benno
2021-07-24Capitalise DNS response code, stub learns from SLAAC, clarify wordingkn
OK florian
2021-07-23When dhcpleasectl asks to send a new request on an interface we areFlorian Obser
probably stuck in some way and the user wants a mostly clean slate. If we already have an IP address transition to state REBOOTING so that we no longer unicast dhcp requests. We will then try to reacquire our lease twice before giving up and transition to INIT and send dhcp discover messages accepting any IP address.
2021-07-22mbrfile can be const.Kenneth R Westerback
2021-07-22Make dhcpleased(8) always configure provided routes, regardless ofStefan Sperling
whether the address we received in our lease is already configured. In the case I observed, no default route was added to the routing table even though the server provided both an address and a route option. As it happened the leased address was already configured on the interface. This should not prevent routing table updates, but it did. ok florian
2021-07-22Send rDNS proposals on ramdiskskn
Otherwise resolvd(8) will never learn nameservers and update /etc/resolv.conf with IPv6 resolvers. At the moment IPv6 only installations always prompt for nameservers anyway, but that is its own bug and will be fixed soon. This enables the upcoming fix to detect learned nameservers in the first place. Feedback OK florian
2021-07-22Have PRT_protected_guid() return 0/-1 like everything elseKenneth R Westerback
reporting success/failure. No functional change.
2021-07-22Tweak some err() verbiage.Kenneth R Westerback
2021-07-21A couple of missed 'const'.Kenneth R Westerback
2021-07-21Use a dedicated struct mbr to hold the GPT protective MBR,Kenneth R Westerback
either the one read from disk or the default one created when initializing GPT. Simplifies logic, eliminates MBR_init_GPT() and demotes MBR_protective_mbr() to a helper function called from GPT_read(). Nuke an unused variable in passing. No intentional functional change.
2021-07-21Use exclusive lock under /dev/, silence expected errors in installerkn
resolvd(8), slaacd(8) and dhcpleased(8) are different from other daemons in that there must only be a single instance. resolvd already does this, adjust slaacd and dhcpleased accordingly while moving the lockfile paths under /dev/ such that they work early on boot and don't run into races should /var be (un)mounted between daemon starts. Locking is especially required in the installer where all three daemons are started every time the "(I)nstall, (U)pgrade, (A)utoinstall or (S)hell? " prompt is entered, i.e. restarting installation or dropping into a shell and back into the prompt again would start multiple instances. To avoid expected lockfile error messages in between installer prompts, discard standard error when starting the autoconf daemons; none of them has other potential failure cases in installer mode before daemon(3)izing. Input sthen deraadt OK deraadt
2021-07-19Tweak one comment and nuke a bunch of pointless ones.Kenneth R Westerback
2021-07-19Abstract reading the built-in MBR or MBR file intoKenneth R Westerback
a separate function. No functional change.
2021-07-19MBR_protective_mbr() can take a const struct mbr *.Kenneth R Westerback
No functional change.
2021-07-19An MBR knows (mbr_lba_self) where it is supposed to go, noKenneth R Westerback
need to pass the value to MBR_write(). Let MBR_write() do the translation from struct mbr to the struct dos_mbr that will be written to the disk. Thus eliminating unnecessary struct dos_mbr variables and the parsing thereof. No intentional functional change.
2021-07-19Revert incorrect tweaks to disk geometry calculations andKenneth R Westerback
non '-b' MBR disk initialization. Detected by bluhm@'s ever vigilant regress testing.
2021-07-18Don't save the prt_scyl/prt_ecyl values, change them, use themKenneth R Westerback
and then restore them. Just change/use the saved values and skip the restoring. Allows PRT_make() to add 'const' to its struct mbr parameter, and thus allows MBR_make() to add 'const' to its struct mbr parameter. No intentional functional change.
2021-07-18Make GPT_read() obtain and validate the on-disk MBR itself, viaKenneth R Westerback
MBR_read(), and report success/failure. Simplifies logic and makes clearer that the protective MBR is a required part of a GPT. With the standardization on 0/-1 return values for helper functions, rename 'valid' to 'error' in GPT_read() to make logic less mind bending. No functional change.
2021-07-18Remove hackery around /tmp/i/resolv.conf*. In particular "lookup file bind"Theo de Raadt
is required because of TLS servername for contacting ftp.openbsd.org, and there is no point doing that in resolv.conf.tail because it is no longer used. ok florian kn
2021-07-18Put MBR_parse() invocation inside MBR_read() instead of alwaysKenneth R Westerback
following an invocation of MBR_read() with a call to MBR_parse(). No functional change.
2021-07-18Ignore routers option when a classless static routes option is presentFlorian Obser
as mandated by RFC3442. Pointed out by, initial diff, testing & OK bket@
2021-07-18Document dhcpleased(8) and slaacd(8) besides dhclient(8) as DNS sourcekn
Zap the obsolete dhclient.conf(5) supersede quirk while here. Feedback OK florian
2021-07-17The first think MBR_init() does is memset(0) the gpt header and gptKenneth R Westerback
partition array. So no need to memset(0) the gpt header before each MBR_init() invocation. No functional change.
2021-07-17Nuke a bunch of Capt. Obvious or misleading comments.Kenneth R Westerback
No functional change.
2021-07-17Change edit/gedit/setpid/gsetpid to return 0/-1 to indicate success or failureKenneth R Westerback
as all other helpers do. Makes it clear that X* functions are in charge of deciding which CMD_* value they return to main edting loop. Reduces unnecessary copying/restoring of original partition information. No intentional functional change.
2021-07-17Ignore unwind socket with kevent(2) under SMALLkn
All other unwind related bits are under #ifndef SMALL already, so complete that. OK florian
2021-07-16Change PRT_protected_guid() to take native order uuid's instead of little endianKenneth R Westerback
uuid's. This brings it into line with all the other PRT_ functions taking uuid parameters. While adapting gsetid(), introduce separate partition type and partition guid variables to make the logic clearer. No intentional functional change.
2021-07-16The installer plays weird tricks with /etc/resolv.conf and symlinks itFlorian Obser
from /tmp/i. Work around this in resolvd so that it can correctly update the file until this is fixed in install.sub. probably grudgingly OK deraadt
2021-07-16Compare pointer to NULL, not 0.Kenneth R Westerback
2021-07-16Be consistent and always return -1 to indicate failure.Kenneth R Westerback
DISK_printgeometry() return value was always 0 and never checked so just make it void. No functional change.
2021-07-15Nuke unused variable.Kenneth R Westerback
2021-07-15No need for separate b_sectors, b_offset and b_type variables. We have structKenneth R Westerback
prt to hold this info in one place. Construct a struct prt to hold the boot partition information and stash it in the struct disk for both MBR and GPT to access as needed. Move the blocks to sectors conversions into DISK_open() with all of its geometry friends. No intentional functional change.