summaryrefslogtreecommitdiff
path: root/sbin
AgeCommit message (Collapse)Author
2018-07-24Move duplicate code into new helper print_addr_str()kn
This simply puts the wiggle around inet_ntop() from four into one location. OK benno
2018-07-24Simplify getaddrinfo() error handlingkn
`error' is not used so drop it and jump to the end. OK sashan
2018-07-23When moving between networks slaacd configures new addresses butFlorian Obser
leaves old ones behind. The IPv6 RFCs don't seem to offer guidance on what to do in this case. (RFC 5220 discusses related issues, but not exactly this.) It seems a bit harsh to just delete old addresses - a naive implementation can easily lead to flip-flopping between two prefixes. Instead set the preferred lifetime to 0 for all addresses on an interface when the link goes down, thus marking addresses as deprecated but still usable. When the link comes back send a router solicitation. If we are still on the old network and receive a router advertisement the preferred lifetime will increase and the addresses will no longer be deprecated. If we moved to a new network we will get new router advertisements and form new addresses. The old ones will stay deprecated and the address selection algorithm will prefer new addresses. Problem reported by many. testing & OK phessler
2018-07-23replace references to rtadvd(8) with rad(8)Florian Obser
OK deraadt, phessler, jmc
2018-07-23Handle duplicate address detection failures.Florian Obser
We get notified when duplication is detected on the route socket. For privacy addresses simply generate a new random address. If we have soii enabled increase the dad counter on the prefix and generate a new address. For eui64 addresses nothing can be done.
2018-07-22No need to re-implement realloc(). Just use itKenneth R Westerback
the way the man page says. ok tb@
2018-07-22Tweak comment about truncating NULs to reflect newKenneth R Westerback
reality.
2018-07-22When finished pulling an option out of a buffer, skip directly to theKenneth R Westerback
next option. Don't rely on truncated NULs being ignored because NUL == DHO_PAD. ok tb@
2018-07-21Reading past the end of a buffer is bad, Even if theKenneth R Westerback
extra byte is always there. Even if the byte contains innocuous data that isn't used. Eeven if a particular level of optimization of a particular compiler avoids it by processing things backwards. Bad. So simplify and correct logic. Perhaps even proof the code against future generations of clever compilers. Pointed out by Brandon Falk. Thanks! ok millert@ tb@
2018-07-21There is no need to initialise global and static local variables to zero,Claudio Jeker
they are like that by default. OK florian@
2018-07-20Stop checking table commands for `create'kn
Tiny left over from 2003 when it was removed. Twist the logic by checking for `show' and `test' to make it even simpler. OK sashan henning
2018-07-19i found a nicer way to describe -join;Jason McIntyre
2018-07-18replace manual zero initialization of various fields with memset;Florian Obser
makes the code shorter and easier to read. suggested by & OK claudio
2018-07-18When running flood ping with count packets (-c) set an alarm afterFlorian Obser
sending all packets otherwise ping will wait forever to see all answers - which might not arrive on lossy links. Problem pointed out by, input & OK claudio
2018-07-17stop assuming prefix lengths, remove inet6_makenetandmask()kn
This removes any logic that implies IPv6 destination host addresses to be /64 subnets so they are taken as is. RFC 3587 deprecated this in 2003 and our manual page actually states: The route is assumed to be to a network if any of the following apply to destination: * [...] * it is an IPv6 address with a “/XX” suffix (where XX is the number of bits in the network portion of the address and is less than 128) * [...] If destination is a valid IP address or host name, it is presumed to be a route to a host. Stripping relevant code from `inet6_makenetandmask()' left the function as dummy wrapper around `prefixlen()', so zap it completely. Discussed with and positive feedback from many, OK benno henning
2018-07-16use ANSI C function declaration; no binary changeJasper Lievisse Adriaanse
2018-07-16reduce duplicate code, fix typo/free correct bufferkn
In filteropts_to_rule(): * Merge `once' handling from `anchorrule' and `pfrule' * Remove/shorten duplicate code block * Fix typo I introduced with r1.678 that frees the wrong buffer (twice) OK sashan
2018-07-14Document that route monitor also takes -T rtable as an argument.Sebastian Benoit
2018-07-14Make route monitor display changes in all routing domains by forcingSebastian Benoit
the route filter to set RTABLE_ANY. Previously only the routing table/rdomain of the route process was displayed (that being the kernel default). ok kn@ claudio@ and henning@
2018-07-13no longer interpret 0.192.168.4 in hosts(5) as 192.168.4/24Ingo Schwarze
OK phessler@ claudio@ benno@ kn@ "steh' nicht rum, committe das" henning@
2018-07-13Use "rtable" not "tableid" as argument name for rtablekn
Make rtable(4) usage documentation consistent with other programs. This is to have `man -k ar~rtable' show the full list without having to look for other variations of the same argument type. OK bluhm
2018-07-13Unused variables.Kenneth R Westerback
ok henning@ phessler@
2018-07-13Fix regression on child queue definitionskn
I comitted the wrong diff in 1.680 which turned `queue cq parent pq ...' into invalid syntax by changing `interface' to `ON if_item'. Found by bket, thanks!
2018-07-13- differentiate between join and nwidJason McIntyre
- remove some duplication between them - document -join - sort ok phessler
2018-07-12Cleanup and clarify getuint64() by using theKenneth R Westerback
same functions as auto-allocation. parse_sizespec() and apply_unit(). No intentional functional change. Looked good to tb@
2018-07-12Cleanup and clarify the has_overlap() logic so it can be read byKenneth R Westerback
normal people and is more efficient to boot. The only intentional functional change was to use mergesort() instead of heapsort() so that partitions with the same offset retain their order in the emitted verbiage. Looked good to tb@, ok kn@
2018-07-12RTM_CHGADDRATTR for route monitorFlorian Obser
OK phessler, benno, claudio
2018-07-11Introduce 'auto-join' to the wifi 802.11 stack.Peter Hessler
This allows a system to remember which ESSIDs it wants to connect to, any relevant security configuration, and switch to it when the network we are currently connected to is no longer available. Works when connecting and switching between WPA2/WPA1/WEP/clear encryptions. example hostname.if: join home wpakey password join work wpakey mekmitasdigoat join open-lounge join cafe wpakey cafe2018 join "wepnetwork" nwkey "12345" dhcp inet6 autoconf up OK stsp@ reyk@ and enthusiasm from every hackroom I've been in for the last 3 years
2018-07-11Prevent invalid interface specifiers on queue ruleskn
pf.conf(5) states that queues attach to actual interfaces only, yet the following parses: # echo queue eq on egress bandwidth 1G default | pfctl -f- # pfctl -sq pfctl: DIOCGETQSTATS: Bad file descriptor # echo queue rq on rdomain 0 bandwidth 1G default | pfctl -vf- queue rq bandwidth 1G default # pfctl -sq pfctl: DIOCGETQSTATS: Bad file descriptor On rdomains, ifa_exists() returns NULL. On interface groups, ifa_exists() returns non-NULL but af is never set to AF_LINK. OK henning sashan
2018-07-11Use AF_UNSPEC not 0kn
2018-07-11Do for most running out of memory err() what was done for most runningKenneth R Westerback
out of memory log_warn(). i.e. ("%s", __func__) instead of manual function names and redundant verbiage about which wrapper detected the out of memory condition. ok henning@
2018-07-11Using resolved after realpath(3) has failed is dangerous. Don't do it!Martijn van Duren
Minor tweak and OK jca@ OK beck@ deraadt@
2018-07-10Error out if -netmask/-prefixlen does not follow the destination parameterkn
Since the address string comes last, `-prefixlen 56 2001:db8::' silently installs a route for /64 since that's the currently implied prefix length. The manual page already states that these options must follow the destination parameter in order to have any effect. Discussed at length with many OK benno sthen bluhm jca
2018-07-10Include <sys/queue.h> instead of relying on kernel headers to includeMartin Pieuchot
it. ok markus@ as part of a larger diff
2018-07-10'set delay' for the generic packet delay mechanism, ok benno sashanHenning Brauer
2018-07-10Add "listenrepv2" for MLDv2 Listener Reports from RFC3810Jeremie Courreges-Anglas
ok benno@
2018-07-10fix anchor rules with filter opts, introduce filteropts_to_rule()kn
Some filter options were parsed but not set on anchor rules due to missing copies of the respective struct members: $ cat pf.conf queue rq on trunk0 bandwidth 1G queue dq parent rq bandwidth 1G default anchor a set queue dq $ pfctl -vnf pf.conf | fgrep queue anchor "a" all Fix this by moving common code from `anchorrule' and `pfrule' into a new helper filteropts_to_rule(). Input from henning and benno OK henning sashan jca
2018-07-09Zap dead codekn
Commented since r1.465 (2004). OK deraadt benno jca sashan
2018-07-09Kill fluff about how route(8) is of limited usefulnessJeremie Courreges-Anglas
Don't say that route(8) is mostly useful to set up a default route, which is almost a lie. What's more, I'm not sure new users struggling with route(8) should be pointed to ripd(8) (sic) or bgpd(8) as a solution to their problems. ok benno@ kn@
2018-07-09Unify and disambiguate various aspects of the terminology, clarifyIngo Schwarze
that there is only one softraid(4) controller (called softraid0), and clarify that you cannot add or delete chunks, but merely replace them. Tweaks and OK jsing@, and OK henning@ on a previous version.
2018-07-09No need to mention which memory allocation entry point failed (malloc,Kenneth R Westerback
calloc or strdup), we just need to log that we ran out of memory in a particular function. Recommended by florian@ and deraadt@ ok benno@ henning@ tb@
2018-07-09Remove array of IMSG type names.Florian Obser
It was helpfull in the beginning to know which IMSG are flying around but unusable (and unsused) since slaacd(8) is on the ramdisk.
2018-07-08Be consistent in warn() and log_warn() usage whenKenneth R Westerback
running out of memory. Next step, be correct *and* consistent. ok dennis@ tb@ benno@ schwarze@
2018-07-07slaacd is not interested in v4-related route messages so set the addressStuart Henderson
family on the two socket() calls to open the routing socket, so that only v6-related and af-unspecific messages are seen. One of the sockets is only used for sending not receiving messages; shutdown the receive side to avoid receiving messages as suggested by claudio@. slaacd is run by default (watching for interface changes to add the "autoconf" flag), so has to process route messages even where IPv6 autoconf isn't used - these changes reduce CPU use on machines processing large numbers of route updates (in particular full-table BGP routers). ok florian@ claudio@ benno@
2018-07-07Add recommended error checks around the use of strtod() inKenneth R Westerback
parse_sizespec(). ok otto@
2018-07-04Print the amount of bytes written, as intended, instead of -1 whenMartin Pieuchot
an error occurs. ok krw@
2018-07-03Rephrase a misleading sentence in iked(8), and add a missingStefan Sperling
reference to RFC 7359. Patch by David Dahlberg
2018-07-03Reduce display_edit() parameter list by one. Just callKenneth R Westerback
editor_countfree() in the function body rather than in the invocation. ok millert@
2018-07-03Nuke some leading spaces and mis-indentations that crept in over theKenneth R Westerback
years. ok otto@
2018-07-03No need for print_unit to be a global.Kenneth R Westerback
ok otto@