summaryrefslogtreecommitdiff
path: root/sbin
AgeCommit message (Collapse)Author
2018-09-13Avoid unneeded variable in gen_dynnode()kn
OK bluhm
2018-09-11Fix netmask regression in get_dynnode()kn
I introduced this error with r1.330 while removing the af parameter from unmask(). `pass inet from (lo0)/24' would result in `pass inet from (lo0)', sorry.
2018-09-11Tighten validation tests on an obscure corner case ofKenneth R Westerback
trying to align partitions to size <= 0 or past the end of the disk. Emit error message in this case as in other align errors. Looks good to otto@.
2018-09-11Remove unused buffer from host()kn
Left-over from pre-host_ip() times. While here, use __func__. OK henning benno
2018-09-10Merge host_v{4,6}() into simpler host_ip()kn
Except for networks such as "10/8" host_ip() now handles addresses in an AF-agnostic way with more duplicate code removed/merged. OK sashan (as for earlier copy_satopfaddr() diff) henning
2018-09-10Introduce copy_satopfaddr()kn
Move the same dance around v4/v6 for copying IP addresses from sockaddr into pf_addr to avoid duplicate code and improve readability. Feedback and OK bluhm
2018-09-09convert the things we save in 'join' into a single ioctl. mixing relatedPeter Hessler
settings over multiple calls was risky and racy. Pass essid, wpa, and wep paramaters in a single ioctl and process it atomically. no change for 'nwid' users OK stsp@ benno@
2018-09-08Enforce that "join" and "nwid" may not be used at the same time.Peter Hessler
OK stsp@
2018-09-08Allocate path only when needed, use __func__kn
2018-09-08Error out early on bad anchor usagekn
`pfctl -a foo' would do nothing with the non-existent anchor and exit 0. This implements behaviour as documented in pfctl(8): -a anchor Apply flags -f, -F, and -s only to the rules in the specified anchor. While here, hoist a duplicate "_" check by using the more mnemonic `mode'. OK henning sashan
2018-09-07More __func__ to fix error messageskn
2018-09-07Fix function name in error messages by using __func__kn
2018-09-07Remove wildcard address on loopack remnantskn
henning@ removed this functionality years ago, see the share/man/man4/lo.4 revision 1.27. OK jca claudio
2018-09-07Remove unnused af argument from unmask(), sync with pfctlkn
Noted by jca, thanks. OK jca claudio
2018-09-07Make print_hostname() less AF-specifickn
Reduce differences address families and replace strlcpy() with simpler if/else logic as done in print_addr_str(). OK sashan
2018-09-06Remove unused af argument from unmask()kn
This has been unused for years. While here, zap the duplicate function signature from pfctl.h (already present in pfctl_parser.h); spotted by sashan, thanks. OK sashan
2018-09-06Fill netmask AF-independently in print_host()kn
Instead of masking the host address in two different ways, just fill it no matter the address family. In case of AF_INET, setting the extra 96 bit does not hurt. While here, stop resetting `af' for no reason and move up the variable declaration. OK benno sashan
2018-09-05Move AF-specific mask logic from callers into set_ipmask()kn
Instead of doing the same dance with every caller, check for user provided mask or address familiy specific maximum inside the function itself. Feedback and OK claudio
2018-09-05Use error label in host_if()kn
This brings it in line with host() and host_dns(). OK sashan miko
2018-08-31Dont print "default" for "0.0.0.0" if it is a host route.YASUOKA Masahiko
diff from asou at soum.co.jp ok claudio kn
2018-08-30Practice safe free()'ing by setting alloc to NULL toKenneth R Westerback
prevent double free. Spotted by jsg@, simpler fix by myself and miko@. ok jsg@
2018-08-30Never let FS_RAID partition be named, a.k.a. given a mount point.Kenneth R Westerback
Nuke pointless and inconsistant error message before one get_mp() invocation. ok otto@
2018-08-30Fix "route add 0.0.0.0/0 <gateway>" to work properly. Shift countYASUOKA Masahiko
beyonds the integer width results undefined behavior in C spec. Actually the count is masked by 0x1f on amd64. Found by asou at soum.co.jp ok claudio kn schwarze
2018-08-29Better description for inet6 eui64, plus consistency tweaksJeremie Courreges-Anglas
from Callum R. Davies, ok jmc@
2018-08-28Display per-TDB counters in verbose mode.Martin Pieuchot
ok sthen@
2018-08-28Tweak messages emitted by editor_resize() so "Partition x shrunk ..."Kenneth R Westerback
is only printed if the disklabel gets modified. Also, include the new size. On failure just report "Amount too big.".
2018-08-27disklabel(8) no longer touches bootstrap code so stop mentioning it.Kenneth R Westerback
The MD writedisklabel() function ensures the disklabel does not intrude on bootstraps. Add a Xr to installboot(8), which does bootstrappy stuff these days. ok jmc@
2018-08-26disklabel(8) has not used the primary/secondary boot filesKenneth R Westerback
for years. Remove mention of same from 'FILES' section.
2018-08-26Unveil pflogd(8). Similiar to florian@'s recent changes to ifconfig(8),Bryan Steele
the priviledged parent cannot be pledged due to certain ioctls, but we can use unveil(2) to lock down its access to the filesystem. To be able to use hostnames/dns in tcpdump-like filter expressions, we unveil /etc/{resolv.conf,hosts,services} "r", kept in sync with the kernel bypass for pledge("dns") Additionally, we need to unveil /dev/bpf "r" and the output log file "rwc". The unpriviledged child is pledged "stdio recvfd" and thus does not need any unveils. With feedback/testing from florian@, deraadt@ ok florian@ deraadt@
2018-08-26pflogd(8): don't try to rename(2) broken/invalid pflog files, instead,Bryan Steele
suspend logging until the log file has been moved out of the way, and we have received either SIGHUP or SIGALRM. ok florian@ deraadt@
2018-08-26The three -B forms of disklabel(8) were nuked years ago. So removeKenneth R Westerback
stray reference to them.
2018-08-24Drop special handling of SIGSYS.cheloha
Tolerance for up to 25 SIGSYS deliveries was added to init(8) soon after the addition of sysctl(2) at CSRG, presumably to ease the transition to the new ABI. After 25 years of work the ABI transition is finally complete and we can now safely remove this splint. In general, we now have better practices and methods for helping userspace across kernel ABI breaks. ok deraadt@
2018-08-24display CPU_CPUID / machdep.cpuid in hex not decimalJonathan Gray
2018-08-23Always check the return values of get_[fsize|bsize|cpg].Kenneth R Westerback
Accept partition changes only if all succeed. ok tb@ deraadt@
2018-08-21Unbreak 'R'esize.Kenneth R Westerback
Problem noted and fix tested by jcs@. ok otto@
2018-08-19Call daemon with 0 as first argument so that it changes the cwd to /Florian Obser
otherwise the main process will keep sitting in the directory from where slaacd was started which might for example prevent an unmount. Problem first observed by dlg in ntpd(8). Discussed with deraadt@
2018-08-15Restore ability to use hostnames to configure ip addresses.Florian Obser
Unveil /etc/{resolv.conf,hosts,services} which keeps it in sync with the kernel bypass for pledge("dns"). OK deraadt pointed out by & OK stsp
2018-08-14unveil(2) /etc/nologin.txt for readingcheloha
ok deraadt
2018-08-13The iterator i is not the option code, but simply the index for thePatrick Wildt
array that stores the option codes. Fixes the issue where it named an incorrect option on error. Found by Florian Kaiser ok krw@
2018-08-13consistent macros;Jason McIntyre
2018-08-12Add administrative options to LACP trunk implementation.ccardenas
The trunk driver now has a new ioctl (SIOCxTRUNKOPTS), which for now only has options for LACP: * Mode - Active or Passive (default Active) * Timeout - Fast or Slow (default Slow) * System Priority - 1(high) to 65535(low) (default 32768/0x8000) * Port Priority - 1(high) to 65535(low) (default 32768/0x8000) * IFQ Priority - 0 to NUM_QUEUES (default 6) At the moment, ifconfig only has options for lacpmode and lacptimeout plumbed as those are the immediate need. The approach taken for the options was to make them on a "trunk" vs a "port" as what's typically seen on various NOSes (JunOS, NXOS, etc...) as it's uncommon for a host to have one link "Passive" and the other "Active" in a given trunk. Just like on a NOS, when applying lacpmode or lacptimeout, the settings are immediately applied to all existing ports in the trunk and to all future ports brought into the trunk. Tested by many on a plethora of NIC drivers and switches. Ok remi@
2018-08-12Make ifconfig's -joinlist command work as advertised.Stefan Sperling
ok deraadt phessler
2018-08-12add missing markup;Jason McIntyre
2018-08-11Nuke stray/pointless 'volatile' for local var.Kenneth R Westerback
2018-08-11Fix problems ofthe ifconfig argument parser with "ifconfig <if> join".Sebastian Benoit
Due to the way the parsing works, you cannot have an option that accepts strings as argument or no argument, without side effects: for example "join <nwid>" could only join networks that did not have a nwid identical to another ifconfig option, i.e. "join mtu" or "join join" would not work. Solve this by making join always require an nwid. Listing all the configured nwids for auto-join is moved to the new option "joinlist". Removing _all_ auto-join configuration is moved to "-joinlist". deraadt@ likes it and ok phessler@ stsp@
2018-08-10Zap bits in host_v4(), use mask parameterkn
This avoids a duplicate strrchr() call and makes the function consistent with host_v6() regarding mask handling. While here, use the destination's size in memcpy instead of hardcoding its type. OK sashan
2018-08-09Drop support for guessing an old-style class A, B, or C netmask fromIngo Schwarze
a bare dot-notation IP address by counting trailing zero octets. Instead, assume -host when neither -net nor -netmask nor -prefixlen is given. Error out when -net is requested but no netmask is specified. This removes the last use of the IN_CLASS* macros from this program. OK claudio@ kn@, and many agreed with the general direction during g2k18.
2018-08-08ifconfig cannot be pledged because of its overwhelming amount ofFlorian Obser
used ioctls. Furthermore due to the way the command line parser is written it is difficult to apply the traditional first initialize then pledge pattern. unveil(2) gives us a different approach: By veiling everything with unveil("/", "") and then locking down unveil with unveil(NULL, NULL) we remove all filesystem access from ifconfig kind of like giving a regular user a chroot without any files. OK deraadt
2018-08-08tabs are ok at start of line, but internally space seperation is the normTheo de Raadt
2018-08-06make ifconfig <if> join display the list of networks configured forSebastian Benoit
auto-join with feedback from florian and stsp ok florian@ phessler@ (on previous versions of the diff) stsp@