summaryrefslogtreecommitdiff
path: root/sbin
AgeCommit message (Collapse)Author
2018-05-23Some interfaces (e.g. cdce(4)) can't tell if they are connected. TheyKenneth R Westerback
always report a link status of UNKNOWN. Do not use recorded leases to configure such interfaces. In such cases only use the address in the recorded lease to ask for a new lease. Avoids debilitating /etc/resolv.conf changes by unplugged higher priority interfaces given to the tender mercies of dhclient after a working interface has already set /etc/resolv.conf correctly. Reported for cdce(4) by guenther@ at p2k18.
2018-05-19Add '-r', which causes running dhclient to releaseKenneth R Westerback
lease and exit. Man page tweaks from jmc@. Request, tests & ok tb@. ok millert@ on previous version.
2018-05-19Revert change that benno apparently commited by mistake and breaks buildMatthieu Herrb
on gcc architectures. ok florian@
2018-05-18A pf rule with a "on rdomain n" with nonexisting rdomain n will cause anSebastian Benoit
pfctl: DIOCADDRULE: Device busy error when loading the ruleset, with no information which rule caused the problem and no indication that the problem is the rdomain <nonexisting>. This diff makes pfctl check if the rdomain really exists when parsing the config. ok bluhm@
2018-05-18merge two ifndef small blocks; no functional changeFlorian Obser
2018-05-18dead stores; from llvm scan-buildFlorian Obser
2018-05-18typo, pointed out by llvm scan-build, how did this even work though?Florian Obser
2018-05-17Any IPv4 address change could alter which interface has the activeKenneth R Westerback
default route and thus 'owns' resolv.conf. So check if resolv.conf should be (re)written after all IPv4 RTM_NEWADDR or RTM_DELADDR messages.
2018-05-17Handle RTM_DELETE of slaacd managed default route by re-inserting it.Florian Obser
Problem pointed out & OK phessler
2018-05-17Fully align this with route(8); no need to be different here and mightFlorian Obser
help us if we ever get rid of KAME hack.
2018-05-17Introduce SLAACD_RTA_LABEL define to not use a string constant allFlorian Obser
over the place.
2018-05-16Always record the client identifier used to obtain a lease. ServersKenneth R Westerback
obeying RFC 2131 will never echo the identifier in OFFER/ACK packets. Servers obeying RFC 6842 will always echo the identifier. Confused servers may or may not do the echoing. This permits more reliable association of recorded leases with the MAC address in use at the time the lease was obtained. Requested by & ok tb@
2018-05-16Create all sockets with SOCK_CLOEXEC, we never want to hold on to themFlorian Obser
over execve(2).
2018-05-15typo in log messageFlorian Obser
2018-05-15drop unused <time.h>cheloha
ok kn@ mpi@
2018-05-12Document current behaviour of 'ignore' directive and 'append',Kenneth R Westerback
'prepend', 'default' and 'supersede' directives with respect to 'ignore'. Document 'filename', 'fixed-address', 'next-server' and 'server-name' directives.
2018-05-12log_procnames[] needs to be in sync with slaacd_process enum otherwiseFlorian Obser
processes have the wrong process title leading to confusion.
2018-05-12Make LACP_STATE_BITS accessible to userlandccardenas
Update ifconfig to display LACP State (Actor and Partner) on each trunk port Ok benno@, phessler@, and tb@
2018-05-11Write out updated dhclient.leases.<if>, /etc/resolv.conf and any -LKenneth R Westerback
file before going daemon. Alleviates a race scripts (e.g. the installer in autoinstall mode) can encounter under the reasonable assumption that all related information is available when dhclient(8) returns control to the script as a result of going daemon. Pointed out by rpe@.
2018-05-09Fix (include file ) line number counting by keeping track of the ungetOtto Moerbeek
buffer per file; also use that buffer to expand macros. ok sashan@ dennis@ krw@
2018-05-07Add the logging parameters to mousecfg.c, and make the 'param' fieldUlf Brosziewski
available for all wsmouse devices.
2018-05-05document unit value for pltime and vltime;Jason McIntyre
from paul de weerd ok kn
2018-05-02sort;Jason McIntyre
2018-05-01Mention RFC 7217 and RFC 7772Florian Obser
2018-05-01The -d flag should be a no-op in monitor mode since it does not modifyFlorian Obser
the routing table. However, if -d is provided route monitor lists all interfaces and their associated addresses and exits. This is confusing, unexpected and no longer needed (if ever). Make -d a proper no-op for route monitor and get rid of the interfaces function which didn't use the correct sysctl idiom anyway. OK benno
2018-05-01Sync p_rttables() to netstat(1) version. Pointed out by claudio andFlorian Obser
mpi. Remaining differences are pledge and priority handling which only route(8) has. While here switch flushroutes to get_sysctl() function. OK benno
2018-04-30* simplify code by no longer calling getnetbyname(3)Ingo Schwarze
* avoid double lookups for unresolvable names without -net * more fitting error message for unresolvable names after -net OK florian@
2018-04-30tableid is either initialized to the current routing table or to theFlorian Obser
one specified by the T flag. No need to pass a flag around if the tableid is valid. It always is. This code is now in sync between flushroutes() and p_rttables(). OK benno, no objection claudio
2018-04-30No need to get the whole routing table from the kernel if we areFlorian Obser
filtering by address family and / or priority; similar to what p_rttables() is doing. (At the time of writing we need to copy about 150MB for the whole table on a router that is in the default free zone). OK benno
2018-04-30Fix route monitor -AF filter.Florian Obser
While here make and to see that this is correct and not touching any global state make af a local variable and pass it around. Input & OK benno
2018-04-28remove references to /etc/networks; reminded by jmc@Ingo Schwarze
2018-04-28Improve / simplify pledges.Florian Obser
1) after schwarze@'s rampage (thanks!) we can drop rpath since asr is no longer opening /etc/networks behind our back 2) we have the "route" pledge for the NET_RT_DUMP sysctl so we can pledge earlier in main; flushroutes() and p_rttables() now tighten the pledge instead of being the first pledge 3) the pledge in monitor() was just a repeat of the main() pledge, it can go. OK schwarze, deraadt
2018-04-28Ignore SIGPIPE in case a TCP client resets the connectPhilip Guenther
ok otto@
2018-04-27Add getnumber() to extract simple deciaml values from theKenneth R Westerback
user. Doesn't handle units, '*', etc. Replace the more complex getuint64 when getting things like the number of tracks per cylinder. ok otto@
2018-04-27Create and use a couple of #defines for the magic returnKenneth R Westerback
values of getuint64 that indicate errors. Suggested by & ok otto@
2018-04-27Restore mode on symlinksPhilip Guenther
ok deraadt@
2018-04-26Cast a multiplicand to ino_t to avoid overflow in 32*32=64 calculationsPhilip Guenther
ok pirofti@ krw@
2018-04-26Add error handling to unconfuse myself when playing with pledgepath().Florian Obser
2018-04-26The frontend tells the main process when the startup is finished soFlorian Obser
that we can drop the sendfd pledge.
2018-04-26Hoist initialisations up; while here tighten not yet working pledge.Florian Obser
2018-04-26Prefer <fcntl.h> over <sys/fcntl.h> in userlandPhilip Guenther
While here, delete some extra #includes and apply style(9) sort rules. ok deraadt@ krw@ mpi@
2018-04-26No need for two copies of tricky user input gathering code. Just useKenneth R Westerback
getstring() to get the string and then parse that in getuint64(). Fix a mis-use of %lld and some whitespace while passing. ok otto@
2018-04-26Add some range checks to make sure we don't attempt to store valuesKenneth R Westerback
too large for the receiving fields. Change a couple of do{}while() to for(;;) for consistancy. Tweaks & ok otto@
2018-04-26Plug leak in error case of the common 'varset' implementations.Kenneth R Westerback
ok benno@
2018-04-26Fix previous. Adding "offset" to "maxval" was required.YASUOKA Masahiko
ok otto krw
2018-04-26net80211: stub SIOCS80211SCAN, make ifconfig scan instant.Paul Irofti
The following removes the functionality of the SIOCS80211SCAN ioctl. After long discussions with stps@, mpi@, and deraadt@ we decided that this was the correct way of fixing ifconfig scan from blocking the network stack. The kernel will continue scanning in the background and filling the nodes array, but ifconfig scan commands will now basically do just a SIOCG80211ALLNODES and pretty print the array. So the output stays the same but is instant. In fact, when the interface is freshly brought up, if you type fast enough, you can see the array being filled by running multiple ifconfig scans in sequence. The SIOCS80211SCAN ioctl stays for now as wi(4), pgt(4) and malo(4) still need it around. But not for long... Another change that this introduces is the fact that ifconfig scan no longer plays with UP and DOWN. If the interface is down it complains and exits. This is needed in order to maintain the nodes list. Works on iwm(4), iwn(4), urtwn(4), run(4) and athn(4). Tested by mpi@, landry@, florian@, thanks! OK mpi@.
2018-04-26Do not try getnetbyname(3) if gethostbyname(3) returns no result.Ingo Schwarze
This is part of the project to delete /etc/networks support. OK deraadt@
2018-04-26Consolidate duplicate error messages, 'return' is not a function soKenneth R Westerback
space before '(', eliminate extraneous '{}'. Start of cleaning up user input processing. No intentional functional change. ok otto@ give or take a few '{}' removals.
2018-04-26Add a '-tunneldomain' ifconfig(8) option as shorthand for 'tunneldomain 0'akoshibe
to be consistent with the '-rdomain' option. Suggested by dlg OK benno, jca, kn, phessler, jmc
2018-04-24Make dhclient show imsg pipe poll error messages in debug output only.Stefan Sperling
ok krw@