summaryrefslogtreecommitdiff
path: root/sbin
AgeCommit message (Collapse)Author
2023-06-12Use stdio open_memstream(3) to build up log strings instead of trying toClaudio Jeker
abuse ibufs for that. Using stdio for this has the benefit of using any stdio function to build up strings including fprintf(). With and OK tb@
2023-06-09Readd "-wgpsk", accidentially dropped in r1.465 adding "wgdescr"Klemens Nanni
Noticed by Bradley Latus Diff from Jane Johansson OK tb
2023-06-07Rename ifconfig tcprecvoffload to tcplro. It is shorter andAlexander Bluhm
more consistent. discussed with jan@ mvs@ chris@ claudio@ dlg@
2023-06-06Use same pattern to work with offset by using a uint8_t pointer thatClaudio Jeker
is loaded with ibuf_data(). This is by no means better but allows to switch ibuf_data() to return void *. OK tb@
2023-06-06Use ibuf_seek() instead of ibuf_data() + offset constructs. Effect isClaudio Jeker
the same in these cases. OK tb@
2023-06-01Add support for wireguard peer descriptionsKlemens Nanni
"wgdescr[iption] foo" to label one peer (amongst many) on a wg(4) interface, "-wgdescr[iption]" or "wgdescr ''" to remove the label, completely analogous to existing interface discriptions. Idea/initial diff from Mikolaj Kucharski (OK sthen) Tests/prodded by Hrvoje Popovski Tweaks/manual bits from me Feedback deraadt sthen mvs claudio OK claudio
2023-05-30Replace the one use of ibuf_prepend() using a similar ibuf_new() + ibuf_cat()Claudio Jeker
method but instead of overwriting ibuf internals replace the buf a level up. Users of ikev2_msg_send() are not allowed to hold and reuse a pointer to msg_data (which is another footgun to disarm at some point). OK tb@
2023-05-23Replace ibuf_advance() with ibuf_reserve().Claudio Jeker
OK tobhe@ tb@ kn@
2023-05-23With the retirement of expert mode, get_fsize(), get_bsize() andKenneth R Westerback
get_cpt() simply set a partition's p_fragblock/p_cpg to default values. Replace them with a single function set_fragblock(). No functional change.
2023-05-23Replace ibuf_release() with ibuf_free() since the former just calls the latterClaudio Jeker
OK kn@ tb@
2023-05-23There is no need to ibuf_zero() or memset() any buffers.Claudio Jeker
More cleanup will follow. OK tobhe@
2023-05-21If an MBR partition start or end can be represented by CHS, setKenneth R Westerback
both CHS and LBA values in the MBR partition. Restores pre-7.0 initialization of MBR partition start/end, using slightly less opaque code that retains the slightly different initialization required by GPT protective MBR's. Fixes booting from disks >8G on systems where the BIOS uses CHS. Encountered by Paul de Weerd on his Alix.2 using BIOS 0.99. Much diagnosis and testing by Paul of various iterations. Thanks!
2023-05-20p_fragblock = DISKLABELV1_FFS_FRAGBLOCK(0, 0) sets p_fragblock toKenneth R Westerback
0. Just use p_fragblock = 0 as in all other initializations of p_fragblock. No functional change.
2023-05-17Implement battery management sysctl. This will provide a set of sysctlsMark Kettenis
to control the charging of laptop batteries: * hw.battery.chargemode (int) -1: force discharge 0: inhibit charge 1: auto In auto mode charging may be controlled by: * hw.battery.chargestop (int) Percentage (0-100) of last full capacity at which the battery should stop charging. * hw.battery.chargestart (int) Percentage (0-100) of last full capacity at which the battery should start charging. The idea is that with hw.battery.chargemode=1 hw.battery.chargestop=80 hw.battery.chargestart=75 the battery would be kept charged within the range between 75% and 80%. Allowable settings and some details of the behavior may differ between hardware implementations. Committing this early to easy testing of further diffs that implement this functionality in acpithinkpad(4) and aplsmc(4). ok kn@
2023-05-17Make function and symmetry obvious by renaming PRT_make() toKenneth R Westerback
PRT_prt_to_dp() and PRT_parse() to PRT_dp_to_prt(). No functional change.
2023-05-16Use separate IFCAPs for LRO and TSO.Jan Klemkow
This diff introduces separate capabilities for TCP offloading. We split this into LRO (large receive offloading) and TSO (TCP segmentation offloading). LRO can be turned on/off via tcprecvoffload option of ifconfig and is not inherited to sub interfaces. TSO is inherited by sub interfaces to signal this hardware offloading capability to the network stack. With tweaks from bluhm, claudio and dlg ok bluhm, claudio
2023-05-14Improve emulation of a disktab entry (-t) by using the typeKenneth R Westerback
specified in the disktab entry (:dt:) when setting the default disklabel's d_type. This will enable installboot(8) to know the vnd device should be treated as a floppy disk. Feedback & improved field packing from millert@
2023-05-13In the absence of the 'disktype' command line parameter alwaysKenneth R Westerback
use the d_type value provided by the kernel when creating, editing or printing a disklabel. i.e. treat d_type as disk geometry is treated, reflecting current reality as opposed to historical data.
2023-05-12Add interface names in front of error messages.Jan Klemkow
Suggested by Hrvoje Popovski. ok phessler@
2023-05-10Display correct type name for Microsoft basic data GPTKenneth R Westerback
partitions. Inadvertantly lost in transition to new menu logic.
2023-05-10Microsoft GPT partition attributes can appear on partitions otherKenneth R Westerback
than Basic Data partitions. e.g. Windows Recovery and Windows Reserved partitions. So tweak verbiage to make clear they are MS attributes by prepending 'MS' and always display them. No functional change other than modified fdisk -v output.
2023-05-09switch pflogd from using a bpf read timeout to a wait timeout.David Gwynne
a bpf read timeout means every read will end after the timeout expires. because pflogd has a half second read timeout it would sit in a loop doing reads all the time even if there were no packets to log. the wait timeout means that when bpf catches a packet, it will wait a bit for more packets to arrive before waking up the pending read. pflogd now sits in the read syscall until packets are actually available to log. found by deraadt@ and ktrace discussed with and ok sashan@
2023-05-07GPT partitions with the 'Required' attribute are not deleted by -A.Kenneth R Westerback
2023-05-06Replace pointless %d formatting of 0 values withKenneth R Westerback
literal '0's. No functional change.
2023-04-30avoid use after freeJonathan Gray
ok florian@
2023-04-30Remove artifical limit of 2 hours on a PIO lifetime, as recommended byPeter Hessler
draft-ietf-6man-slaac-renum-05 and implemented by Linux in 2020. OK florian@
2023-04-30Fix that atactl sd0 readattr didn't work for some disks. Change it toYASUOKA Masahiko
check the cksums of the attribute values instead of comparing the revisions. diff from NetBSD through naito.yuichiro at gmail.com. test by kolipe.c at exoticsilicon.com. ok kevlo miod deraadt
2023-04-28This change speeds up DIOCGETRULE ioctl(2) which pfctl(8) uses toAlexandr Nedvedicky
retrieve rules from kernel. The current implementation requires like O((n^2)/2) operation to read the complete rule set, because each DIOCGETRULE operation must iterate over previous n rules to find (n + 1)-th rule to read. To address the issue diff introduces a pf_trans structure to keep pointer to next rule to read, thus reading process does not need to iterate from beginning of rule set to reach the next rule. All transactions opened by process get closed either when process is done (reads all rules) or when /dev/pf device is closed. the diff also comes with lots of improvements from dlg@ and kn@ OK dlg@, kn@
2023-04-27Retire -E's "expert" mode. Introduced 23 years ago to avoidKenneth R Westerback
confusing users with FFS attributes that only experts should fiddle with. Actual use has withered away with functionality rendered moot or moved elsewhere. '-e' remains for the truly obscure corner cases. Simply excise the code for now to see if hidden users/uses are exposed. Further simplifications are possible if no such users/uses surface. ok with sthen@ millert@ kn@ otto@
2023-04-26Add parent to nvgre in ifconfig.8.ASOU Masato
ok david@
2023-04-25add eoip to keepalive.ASOU Masato
ok david@
2023-04-21add -pweneighbor.ASOU Masato
ok deraadt@
2023-04-19remove duplicate includesJonathan Gray
2023-04-19remove duplicate includesJonathan Gray
2023-04-18Rewrite some ugly for loopsTheo Buehler
This fixes a few KNF issues and ugly line wrapping by using a local version of nitems(); fix two bsearch() on top. ok claudio
2023-04-18If rcode is SERVFAIL, there is no need to look at the packet.Florian Obser
This pulls the check for rcode up, before we check if the answer packet has sensible length. Since we are not touching the packet at all, we don't care about the size and don't need to log if the size is wrong from a DNS perspective. With asr error reporting improved in the previous commit, this probably gets rid of all "bad packet: too short" messages. OK semarie
2023-04-18Improve asr error handling.Florian Obser
When an upstream nameserver is not available asr is not synthesizing a SERVFAIL rcode (duh), but sets ar_errno. When we need SERVFAIL further down,we need to set the rcode ourselves. While here, don't complain about a too short packet when asr already told us that resolving did not work out in check_dns64_done. OK semarie
2023-04-12Simplify code by folding uuid_attr() into PRT_protected_uuid().Kenneth R Westerback
No functional change.
2023-04-12Clarify logic in PRT_uuid_to_menudflt() by using find_gpt_menuitem().Kenneth R Westerback
No functional change.
2023-04-11Abstract find_[gpt|mbr]_menuitem() to simplify code andKenneth R Westerback
prepare for future uses. No functional change.
2023-04-11Simplify code by passing pointers to the appropriate type toKenneth R Westerback
find_gpt_desc() and find_mbr_desc(). No functional change.
2023-04-11Shuffle mbr and gpt function prototypes and declarations together.Kenneth R Westerback
No functional change.
2023-04-10Make GPT display of menu hex octet the same as the MBR display.Kenneth R Westerback
i.e. two digits.
2023-04-09Refactor and simplify GPT menu selection logic.Kenneth R Westerback
No intentional functional change.
2023-04-08A bit more guid vs uuid naming consistency.Kenneth R Westerback
No functional change.
2023-04-07Oops. Missed files in last commit.Kenneth R Westerback
2023-04-07Add helper functions find_mbr_desc() and find_gpt_desc() to allowKenneth R Westerback
checking mbr_type[N].mt_desc and gpt_type[N].gt_desc before using name on menu when printing out partition tables. Tweak logic in find_mbr_type() and find_gpt_type() to be a bit more paranoid. Tweak function/variable names to be more in line to usage. No functional change as all mt_desc and gt_desc are currently NULL.
2023-04-06Markup route flags to get tagsKlemens Nanni
":tM" to jump to the definition of RTF_MODIFIED is easier and faster than manually navigating there. OK schwarze
2023-04-05Add (inside #if 0 blocks) #define's and gpt_types[] entries forKenneth R Westerback
all the GPT partition types known to mankind. a.k.a. Wikipedia, Linux, and various BSD's. Makes it easier to discuss/add/remove/check GUID's known to fdisk(8). No functional change.
2023-04-04Adopt a more compact idiom when initializing gpt_types[]. GroupKenneth R Westerback
entries with attributes together. No intentional functional change.