Commit Graph

7073 Commits

Author SHA1 Message Date
roy
2b94ade947 route(8): print RTM_CHANGE messages
XXX Pullup -9
2019-08-22 16:10:48 +00:00
perseant
f5654bbebe Clean up debugging cruft that somehow made it into my previous commit. 2019-08-20 21:18:10 +00:00
wiz
27a1bb09f8 Sort options in usage.
filesystem -> file system
2019-08-20 21:07:21 +00:00
perseant
473107ea62 Allow the user to specify the filesystem ID for umapfs at mount time,
allowing a consistent filesystem ID across reboots.  Closes PR #54471.
2019-08-20 20:18:54 +00:00
perseant
7aae290207 Add -D flag to allow the user to specify an alternate dumpdates file.
Closes PR #54469.
2019-08-19 18:12:50 +00:00
martin
21c20a3068 Properly release the disk properties dictionary we received via
ioctl.
Detected by leak sanitizer when building with MKSANITIZER=yes.
2019-08-18 11:08:56 +00:00
kamil
997c4cdc97 sysctl: Add indirection of symbols to remove clash with sanitizers
Add indirection and symbol renaming under MKSANITIZER for the linked in
version of sysctlbyname and sysctlgetmibinfo.
2019-08-18 04:10:22 +00:00
msaitoh
5ae436aa7e Whitespace fix. 2019-08-16 10:33:17 +00:00
kamil
1f7b844ec7 fsck: Stop defining the same variable concurrently in bss and data
returntosingle was defined in multiple places:

 - fsck_lfs/main.c
 - fsck_ffs/main.c
 - fsck_ext2fs/main.c
 - fsck/fsutil.c

Keep the fsutil.c definition as the only one.

Detected during the build of telned with Address Sanitizer (MKSANITIZER).
2019-08-15 03:10:42 +00:00
roy
85f97b7a69 reboot: fix arg order for logwtmpx(3)
Matches the correct order from init(1).

Thanks to Sascha Wildner <swildner@dragonflybsd.org>
2019-08-08 21:14:12 +00:00
wiz
1100063163 Remove superfluous Pp. 2019-08-07 19:08:10 +00:00
mrg
1eef670a51 add an example about reattaching USB devices 2019-08-06 10:45:14 +00:00
isaki
002042ffe7 Fix a trivial wrong comment. x68k's arch is not m68010. 2019-08-03 04:21:37 +00:00
martin
8e17bc1a27 Remove outdated note about sysinst restrictions 2019-07-26 07:22:05 +00:00
msaitoh
eea2ee1212 Implement VLAN hardware filter function(ETHERCAP_VLAN_HWFILTER).
First proposed by jmcneill in 2017 and modified by me.

How to use:

 - Set callback function:

	ether_set_vlan_cb(struct ethercom *, ether_vlancb_t)

 - Callback. This function is called when a vlan is attached/detached to the
   parent interface:

	int (*ether_vlancb_t)(struct ethercom *ec, uint16_t vlanid, bool set);

 - ifconfig(8)

	ifconfig ixg0 [-]vlan-hwfilter

 Note that ETHERCAP_VLAN_HWFILTER is set by default on ixg(4) because
the PF driver usually enable "all block" filter by default.
2019-07-17 03:26:24 +00:00
msaitoh
cb1ccde89c KNF. No functional change. 2019-07-17 03:09:16 +00:00
msaitoh
83631b96b8 Add "ifconfig [-]vlan-hwtagging" to enable/disable VLAN hardware tagging
offload function. It's useful to see Ethernet frame's VLAN tag by
disabling with "ifconfig fooX -vlan-hwtagging" and "tcpdump -e -i fooX".
2019-07-08 03:04:15 +00:00
wiz
4785fe6db5 Formatting nit. 2019-07-04 13:55:31 +00:00
ozaki-r
86e9de9cad Add descr,description/-descr,-description commands to ifconfig(8) to handle a description.
From t-kusaba@IIJ
2019-07-04 02:45:45 +00:00
mlelstv
45a6f3d566 Fix NATIVELABEL_ONLY build. 2019-07-03 07:05:27 +00:00
wiz
400b2bc13c Sort and unify a bit. Add more macros. 2019-07-02 16:47:19 +00:00
mlelstv
1b979fcca7 Add options to define labelsector and -offset and number of slices.
Make options to chose alternate label position for systems using MBR
more intuitive. -m now selects mode with MBR, -n selects mode without,
independent of the machine defaults.
2019-07-02 16:23:47 +00:00
sevan
edae29ee93 Add rcsid 2019-06-30 11:38:16 +00:00
jnemeth
7d442200ff Add an "uuid" command to generate a new UUID for a portion. The
primary intention is for use for after cloning disks to prevent
collisions.
2019-06-25 04:53:40 +00:00
jnemeth
acc2b630b1 adjust gpt_uuid_generate() to accept gpt==NULL 2019-06-25 04:25:11 +00:00
jnemeth
46e7349176 Add gpt_change_hdr() similar to gpt_change_ent() for changing
arbitrary header fields.
2019-06-25 03:42:45 +00:00
jnemeth
e003a26f4c Add a third argument to the "cfn" function that is an argument to
gpt_change_ent().  The purpose of the third argument is to specify
whether the entry to be changed is a primary GPT entry or a secondary
GPT entry.  It is assumed that a secondary GPT entry will always
follow a corresponding primary entry.

This is in preparation for an upcoming change that will require it.
2019-06-21 02:14:59 +00:00
martin
cad3861523 When biosboot is used on an existing wedge and we are switching to
the gpt of the parent device, do not pass the size of the wedge to
gpt_open, it certainly is smaller than the whole device.
Fixes bin/54312.
2019-06-20 10:56:38 +00:00
martin
08878476cc Do not try to close a NULL gpt. Fixes the core dump part of PR bin/54312 2019-06-20 10:41:58 +00:00
kre
1d7ccd04d7 Delete a redundant (useless) assignment. NFCI. 2019-06-04 11:59:05 +00:00
kre
43729d11af PR toolchain/54269
Make a SMALL dmesg even smaller.

When compiled -DSMALL, dmesg does nothing at all with the kernel
timestamps (it processes no options to be told what would be the
user's desire) so make it truly do (almost) nothing, rather than
some botched partial processing of them.

The "almost" is that a SMALL dmesg will now ignore spaces at the
beginning of each new message line ... those are (vanishingly)
unlikely to occur, as the kernel puts the timestamp (which starts
with '[' there) - fixing this would have meant even more #ifdef's
as the code that ignores that leading space is the only remaining
thing that (in a SMALL) dmesg looks at the value of the "tstamp"
variable, and if we don't keep some use of it, gcc complains...

These changes affect only SMALL dmesg (as installed on boot
floppies, etc) and have no intended effect on the version that's
installed on a normal (full size) running system.
2019-06-04 11:37:39 +00:00
christos
7031824410 We already incremented cl; fix indexing. Noticed by Xin Li @FreeBSD. 2019-06-04 00:08:00 +00:00
wiz
3969855bdf New sentence, new line. 2019-05-31 16:38:27 +00:00
mlelstv
8ba9fb4d1c Mention SATL support. 2019-05-31 05:47:22 +00:00
mlelstv
c2d06938d9 Add support for ATA command pass-through to SCSI devices. 2019-05-30 21:32:08 +00:00
kre
fe6f1f01c1 PR bin/54222
Don't use portal_node_reclaim() inappropriately.   It frees data we
did not allocate, but which might have been allocated by someone else.

While here, various other cleanups (avoid losing fd's if fork fails,
don't compose mangled st_mode S_IFMT values - puffs or's in what it
thinks is correct to the value we set, one case I saw was producing
0110600 for the mode, the 011 isn't any defined type at all - I'd
never seen ls print a '?' as the first char of ls -l output before!

This is still not really correct, but is I believe, better than before.
2019-05-23 11:13:17 +00:00
wiz
7a2e675187 Remove superfluous Pp. 2019-05-23 09:15:45 +00:00
kre
4ab11b0d22 Better handling of comments in portal.conf ... # now only introduces
a comment at beginning of line, or after whitespace.   This allows #
to be used as data otherwhere in the line (there is no escape mechanism).
2019-05-23 04:34:25 +00:00
kre
de0c485250 KNF: blank lines after declarations, return (x) -> return x, and
eliminate spaces between cast and value being cast (most were OK already)
NFCI.
2019-05-23 02:39:06 +00:00
wiz
3a5a3e206b Sort SEE ALSO. 2019-05-08 06:10:30 +00:00
cnst
f11bc4e580 bioctl(8): Xr ataraid(4), mpii(4) && mfii(4); 2019-05-08 03:29:59 +00:00
christos
dfb7cec746 Add a -z flag to zero out the up to 4 bytes of padding in directory entry
names (including the terminating NUL), as well as directory entries with
extra free space (d->d_reclen > UFS_DIRSIZ(d)).

Inspired from FreeBSD:
    https://svnweb.freebsd.org/base?view=revision&revision=347066

While the kernel has been fixed to deal with the padding bytes (new
kernels will correctly zero out all the padding after the name), it
appears that there is still an issue with directory entries with extra
free space, since a newly created and populated filesystem gets modified
with "fsck_ffs -z".
2019-05-05 14:59:06 +00:00
christos
b131cb44b1 simplify the endian byte-swapping code. 2019-05-05 13:24:19 +00:00
msaitoh
1ad0ba196b Suggested by Christos:
- Dont' cast malloc()'s return value.
 - Use calloc() instead of malloc().
2019-04-22 10:44:55 +00:00
maya
f93d65267a wether -> whether 2019-04-21 11:45:08 +00:00
maya
2c4214cba2 Omit mention of old vnd(4) bug, now resolved.
Via elge, thanks.
2019-04-13 19:29:27 +00:00
pgoyette
a398332c7f Add missing space in "quotas disabled" output from tunefs -N 2019-04-12 01:14:37 +00:00
kre
84b2b98300 KNF, 80 column police, a few other tidy ups (use if (ret == 0) rather
than if (!ret) when ret is not a boolean, and test fopen result against
NULL, for example).

NFCI.
2019-04-10 06:11:37 +00:00
kre
c2cf8ad6d4 PR bin/53999 from rudolf (eq.cz)
Fix cgdconfig to report verification failures with gpt and mbr
verification methods (and not treat them as silent hard errors).
This also causes the cgd to be unconfigured when one of those
verification methods fails.

Add ATF tests to check that bad verification is reported, and
does not leave the cgd configured.

Patches from the PR applied.
2019-04-10 06:09:39 +00:00
tnn
3fe2f616e7 mention that -B is used to set the timeout for mbr_bootsel 2019-04-09 09:03:41 +00:00
martin
5bb85d19b9 PR bin/54088: make "destroy" remove the protective MBR too.
We could make this optional if someone comes up with a good reason
to leave it intact.
2019-04-04 14:03:40 +00:00
martin
920f8d883d Ignore -f with the "destroy" command completely (it was effectively
ignored already, so no functional change). Leave it as valid option
for compatibility.
2019-04-04 13:58:20 +00:00
martin
f63c9f4407 Allow specifying the partition via -b startsec for the biosboot cmd. 2019-04-04 13:55:40 +00:00
mlelstv
da22d85db7 Ignore EXT4 'kbytes written' field when validating alternate superblock. 2019-03-31 13:16:52 +00:00
mlelstv
25aaa28e7c No longer rely on data in disklabel to deduce alternate superblock
positions from block size. Instead use the same defaults as newfs_ext2fs.

Side effect is that fsck_ext2fs now works with wedges.
2019-03-31 10:55:58 +00:00
mlelstv
fcaa2faa3e remove debug printfs from last commit. 2019-03-31 10:52:00 +00:00
mlelstv
bbddb1419d Ignore recorded last mount point when validating alternate superblocks.
Compute log_bsize correctly. This fixes computation of alternate
superblock addresses.
2019-03-30 17:32:40 +00:00
martin
d48fad1d9d Allow -b to specify a partition for "gpt unset" as well. 2019-03-26 14:55:02 +00:00
martin
d0774e18ba When displaying a single partition (gpt show -i ...) display offset
and size in sectors (instead of the totally confusing bytes),
followed by the humanized byte offset/size.

This makes the numbers match the "gpt show" or "gpt show -a"
output.
2019-03-26 11:23:55 +00:00
martin
1756583860 Allow -b startsec to specify the partition to change for the set subcommand
as well.
Add another option, -N, as a quick way to remove all attributes.
2019-03-25 20:15:49 +00:00
wiz
d774658d68 Bump date for previous. 2019-03-25 07:03:17 +00:00
manu
eeb96f8c80 Add -U flag to dump(8) and dump_lfs(8) to specify dumpdates entry
This address situations where dump(8) cannot figure out the device being
dumped. It also allows tracking of subvolume dumps by using virtual
device as dumpdates entry.
2019-03-25 02:13:01 +00:00
martin
2ee402b3d0 Make the "show" subcommand accept -b startsec to identify a partition
(very usefull for scripts and other robotic callers).
2019-03-24 13:45:35 +00:00
martin
f2b09ed0f6 Add support for specifying the partition to resize via -b startsec
(similar to label and other subcommands). Do not fully add gpt_find
functionality here, as resizing multiple partitions in one go does not
make sense.
2019-03-24 13:31:00 +00:00
mlelstv
5ca1f5a8c5 print little-endian header fields correctly. 2019-03-14 10:26:10 +00:00
mrg
6a0755298a make ext2fs rev1 the default. this enables LARGEFILES support. 2019-03-06 05:11:13 +00:00
mrg
51102cfc35 - smart vendor support now does try to guess the vendor,
adjust the BUGS to suit
- claim some copyright
2019-03-03 04:51:57 +00:00
mrg
37b18b6d27 add a samsung specific SMART table with:
235 - POR Recovery Count
	243 - SATA Downshift Count
	244 - Thermal Throttle Status
	245 - Timed Workload Media Wear
	251 - NAND Writes

all 5 turn up on newer samsung SSDs, though 3 of them all
read 65535 for me across muliplte devices.
2019-03-03 04:48:19 +00:00
jnemeth
487d107169 Make it clear when displaying data from the MBR. 2019-03-03 03:20:42 +00:00
jnemeth
f23b40fcf3 add some more FAT file system types 2019-03-03 02:28:14 +00:00
christos
c8d11eb8cc Use getfsspecname() to fill the filesystem argument in dumpdates.
While here, make sure that the error strings terminate with newline
consistently, and add a function that adds the system error string.
2019-03-01 16:42:11 +00:00
mrg
7aa75b6a2f add some intel specific smart values, and be more specific for
a bunch of micron/crucial values.
2019-03-01 02:33:43 +00:00
martin
8010630c8f Make "gpt migrate" work for disks with FAT32 and NTFS partitions 2019-02-10 10:35:51 +00:00
oster
6b6fd5e205 Correct printed IOCTL name that was incorrect since rev 1.5. 2019-02-06 22:38:10 +00:00
mrg
7b743cfc69 - add the string length as an explicit parameter to get_time_string()
- remove casts when the same type is used on both sides
- expand hours_buffer[] to fit the range of hours in an 'int'
- add a work around for the sprintf() truncation checker that fails
  to detect that 'minutes' and 'seconds' have a small range
2019-02-04 09:31:22 +00:00
mrg
82974f2217 check for snprintf() truncation and fail sanely if so, rather than
attempting to use a file that won't exist or isn't secure.
2019-02-04 08:21:11 +00:00
mrg
f0885992ce - bump buffer sizes to avoid potential truncation issues 2019-02-04 04:36:41 +00:00
mrg
272df19f70 - mark Exit() __dead
- bump a buffer size to avoid possible truncation
- adding missing fallthru comment
2019-02-03 12:17:14 +00:00
mrg
fbffadb9f8 - add or adjust /* FALLTHROUGH */ where appropriate
- add __unreachable() after functions that can return but won't in
  this case, and thus can't be marked __dead easily
2019-02-03 03:19:25 +00:00
martin
be31cead4d Fix three MBR extended partition related bugs:
1) when walking an extended MBR chain, do not assign duplicate indices
 2) the pointer to the next MBR may be any of the MBR_PTYPE_EXT* variants
 3) the ext MBR chain links are relative to the primary extended partition,
    unlike the contained partitions which are relative to the extended MBR
    block address.
2019-01-27 13:16:05 +00:00
pgoyette
d91f98a871 Merge the [pgoyette-compat] branch 2019-01-27 02:08:33 +00:00
mlelstv
e93ebd453a Avoid crash when no algorithm is specified in parameter file. 2018-12-30 12:05:48 +00:00
wiz
e63c9a2484 Sort SEE ALSO. 2018-12-29 18:34:01 +00:00
alnsn
7f3a8bf678 s/Dec/December/. 2018-12-28 18:33:54 +00:00
mrg
926d7d66f0 avoid infinite loop in kmem_check(). fixes bug introduced in previous. 2018-12-27 21:25:46 +00:00
alnsn
4b140abf1c Document that cgd.conf supports NAME=label and ROOT.<suffix> targets.
XXX Default paramsfile for NAME=label is /etc/cgd/dkNN (resolved wedge
partition) and /etc/cgd/ROOT.<suffix> for ROOT.<suffix>. This isn't yet
documented. IMO, it should be the other way around: /etc/cgd/label
for the former and /et/cgd/[root-device] for the latter.
2018-12-27 21:17:08 +00:00
msaitoh
7b54e0066d Add SIOCSETHERCAP. It's used to change ec_capenable. 2018-12-21 08:58:08 +00:00
martin
2e2c571302 Add a query function (for external code) to enumerate the know guids.
Add recently added VMware GUIDs to the internal enum type.
Fix some short names (bogus + duplicate).
2018-12-20 14:58:10 +00:00
christos
f5cba070b3 Address of packed member might not be aligned. 2018-12-09 17:52:48 +00:00
wiz
122244022d Remove trailing whitespace. 2018-12-05 14:45:59 +00:00
mrg
3d07a0370e "smart status" already obtains the ata parameters to check if smart
is actually supported, so we can attempt to guess a vendor smart
table from the model name.  add basic support for all the micron /
crucial disk names i could find, and add a couple more micron
specific values.

XXX: probably should add regex support for matching, and probably
     should be more restrictive with the current matches.
2018-12-05 06:49:54 +00:00
jdolecek
b066f5eebd since NVMe 1.2 (which defined the ONCS bit), the bit (4) is whether controller
supports 'Save' field in Set Features, and 'Select' field for Get Features,
not the support for the 'Set Features' command itself
2018-12-01 18:29:19 +00:00
mlelstv
71e18f4b60 When merging entries with the keyboard map, print only the resulting changes.
While here, replace bcopy with standad memcpy.
2018-11-23 06:31:57 +00:00
ozaki-r
75d57a2a1e Fix the format of ifconfig linkstr; it takes an argument 2018-11-15 04:37:20 +00:00
ozaki-r
bd3e222d34 ifconfig: add linkstr/-linkstr to the help message 2018-11-15 04:36:46 +00:00
mlelstv
51aec893ad In validate_bootsel, the code assumed that arr[j][i] can be accessed
with something like arr[0][j*ARRAYWIDTH+i]. gcc no longer allows such
hacks and discards the code silently because of undefined behaviour.
2018-11-14 12:05:29 +00:00
christos
2888de0106 Improve examples and netmask information (from Dan Plassche) 2018-11-12 00:56:26 +00:00
msaitoh
54c9821e53 "s/ are are / are /" in comment. No functional change. 2018-11-08 06:34:40 +00:00
mrg
d482d53137 put a bunch of the kvm_read + warn on failure code into a macro that
describes more about what failed.  now errors tell you which actual
variable was being requested instead of simply saying "not yours".

tested on amd64 as working.  written for arm64 testing.
2018-11-06 04:07:22 +00:00
mrg
f5f53dd6ab add support to detect the 3 vmware GPT partition types:
- VMKcore (dump partition)
- VMFS
- VMware reserved

this enables vmkcore partitions for netbsd swap or dump, as well
as naming all of them.
2018-11-06 04:04:33 +00:00
wiz
233a76a940 Use more appropriate macros. Make a sentence easier to read. 2018-11-03 10:51:14 +00:00
mrg
ca08a0c2e1 extend "smart status" command to "smart status [vendor]", and supply a
"Micron" (for Micron/Crucial) list with their documented values.

this allows the vendor-specific data to be used.

there appears to be no simple way to automatically determine the right
vendor to use -- identify data seems to be the only obvious way and
that data can be and is changed by OEMs.  (eg, a disk may be listed as
being "dell", but dell don't make disks.)  as such, no attempt is made
to automatically determine if a vendor list should be used.
2018-10-31 20:00:56 +00:00
kre
c576beb79a kern.boottime was changed from a struct timeval to a struct timespec
in January 2009 (the Christos' time merge, when time_t went to 64 bits).

sysctl needs to catch up.   (So do other progs, which will happen, eventually,
but most of them are unaffected in any practical way.)

If you are running a system (NetBSD 6 or later) without this change, try
	sysctl -nn kern.boottime
and marvel at the result (in theory, seconds.microseconds) most
probably being something like:
	jinx$ sysctl -nn kern.boottime
	1540801874.999995564
(There is a 1 in 1000 chance your system will have booted
in the interval [0 , 999999] nanoseconds after some second,
in which case this will not be observed.   You should get
(almost) the same value after this change - just now it is as
it should be (there should now always be 9 digits after the '.').

On the other hand, if you're on a big-endian 64 bit host (running
64 bit sysctl) you would have always seen 0 for the microseconds field.
That should be fixed by this.

In sysctl(7) also document what we mean by "the time the system booted".

XXX Pullup -8
XXX Pullup -7
XXX Pullup -6 (oops, missed that one...)
2018-10-30 19:41:21 +00:00
kre
7008793d77 Correct the 6 second offset issue between the time reported by
dmesg -T and the actual time a message was produced, noted on
current-users by Geoff Wing (Oct 27, 2018).

The size of the offset would depend upon architecture, and processor,
but was the delay from starting the clocks to initialising the time
of day (after mounting root, in case that is needed).

Change the kernel to set boottime to be the time at which the
clocks were started, rather than the time at which it is init'd
(by subtracting the interval between).

Correct dmesg to properly compute the ToD based upon the
boottime (which is a timespec, not a timeval, and has been
since Jan 2009) and the time logged in the message.

Note that this can (rarely) be 1 second earlier than date reports.
This occurs  when the time when the message was logged was actually
in the next second, but the timecounters have not yet processed
the tick, and so the time of the last tick, near the end of the
previous second, is reported instead.   Since times are always
truncated, rather than rounded, it is occasionally possible to
observe that disparity (if you try hard enough).

IOW: sys/kern/subr_prf.c:addtstamp() uses getnanouptime() rather
than nanouptime().

Note in dmesg(8) that -T conversions are gibberish other than
when the message comes from current the running kernel.  (It
could be fixed when -M is used, for messages generated by the
kernel whose corpse is being observed.   But hasn't been...)
2018-10-30 19:40:35 +00:00
mlelstv
a66cbab44c When changing entries skip those that do not match the -L option.
Should fix PR 53668.
2018-10-14 20:10:49 +00:00
hannken
74ee23a34f Add a test for duplicate inodes on the persistent snapshot list. 2018-10-05 09:49:23 +00:00
jmcneill
c2d1c4cbdd Add libpuffs (fixes sun2 build) 2018-10-03 13:34:44 +00:00
jmcneill
3bd68f4ea1 Install mount_qemufwcfg everywhere instead of just x86. 2018-09-30 15:56:46 +00:00
wiz
dccb361dc8 Fix wrong macro, use An. 2018-09-25 09:55:41 +00:00
maxv
6049b090a1 Remove the userland part of ISDN. The kernel part is untouched for now.
ipppctl was actually an exact copy of pppoectl; there is no functional
change in pppoectl in this commit.
2018-09-23 07:24:19 +00:00
kre
bbc0ac65c7 Whitespace. NFC. 2018-09-20 23:46:42 +00:00
kre
4cf82913ec Use the locale's numeric radix character ("decimal point") more generally
(in !SMALL versions of dmesg).
2018-09-20 19:50:42 +00:00
kre
ff30845eba s/or/of/ (a common typo of mine) and s/or// (too many of them.) 2018-09-20 10:03:31 +00:00
kre
3d4a88b591 Remove #if 0'd code that somehow got mangled in the (somewhat messy)
commit process and ended up being a syntax error...
2018-09-20 06:06:06 +00:00
wiz
604e240dd5 Remove a comma and some trailing whitespace. 2018-09-20 01:11:19 +00:00
christos
9f61665baf changes from kre@
- pass intmax to fmtydhmsf instead of time_t to avoid extra conversions.
- make -TTT mean "always keep 3 decimal digits of duration precision" (ie:
  always print ms)  (including trailing 0's, even .000 if it happens)
- make -T (all forms) be subject to the locale (obey the radix character)
- don't print ymd, since that would require calendar calculations to get
  right.
2018-09-19 23:02:14 +00:00
kre
2f9f119b68 Allow a third use of -T to force .NNN (always three digits) in -TT
(ISO8601 durations) format for timestamps - that is,not dropping trailing 0's.
2018-09-19 22:58:03 +00:00
kre
0d9f7721aa In -TT mode (ISO8601 duration timestamps) print milliseconds as
decimal fractions of a second (as they should be) rather than integer
milliseconds (ie nnn.1means nnn seconds and 1/10 of a second, not
nnn seconds, and 1 millisecond).   While here convert some inappropriate
time_t usage to intmax_t which works better (int, or long, would probably
work just as well).
2018-09-19 22:55:12 +00:00
christos
a1d2abcab8 add -TT printing ISO 8601 duration 2018-09-19 00:15:05 +00:00
kre
bf1152873a Remove uses of test -o 2018-09-16 22:37:24 +00:00
prlw1
30eeab08c0 typo 2018-09-01 11:46:52 +00:00
sevan
0a08194f8e Add the -T flag to usage() 2018-08-27 15:50:39 +00:00
sevan
697ce8551e Remove references to -c flag which was never included. 2018-08-27 15:16:49 +00:00
sevan
ae1f9ce6c8 Add missing -z flag to usage() 2018-08-27 14:55:46 +00:00
sevan
3a6f34847d Remove reference to -c flag which was never implemented. 2018-08-27 00:36:03 +00:00
roy
5d499f6897 Resolve every route(4) message type before printing anything more about it
other than the type and length.

This solves the issue where RTM_ONEWADDR is received and it tries to
parse route information from it.
2018-08-14 20:53:07 +00:00
roy
76fcbe2e7c Mark _error() as printflikee 2018-08-02 03:40:51 +00:00
wiz
b277a5a934 Various improvements to the man page. 2018-08-01 17:26:30 +00:00
sevan
162b461b88 Remove references to XNS 2018-07-31 21:22:09 +00:00
sevan
6733b800d4 Remove ISO & XNS references which are now long gone. 2018-07-31 20:54:18 +00:00
khorben
d7f036be09 Add a port of the umb(4) driver from OpenBSD
The umb(4) driver provides support for USB MBIM (Mobile Broadband
Interface Model) devices.

MBIM devices establish connections via cellular networks such as GPRS,
UMTS, and LTE. They appear as a regular point-to-point network interface, transporting raw IP frames.

Required configuration parameters like PIN and APN have to be set with
umbctl(8), a new tool specific to this driver. The IP address is configured
automatically; the default route and DNS server information have to be set
separately.

The driver is not fully functional yet, it is therefore still marked as
experimental and disabled by default. Any help welcome to complete it!

Tested on NetBSD/amd64, with a Sierra Wireless EM7345 LTE modem on a Lenovo
ThinkPad T440s. No functional change expected otherwise.
2018-07-31 16:44:28 +00:00
wiz
75bef1827d Remove superfluous macro. 2018-07-18 17:57:00 +00:00
dholland
be73ca0156 Document what rrestore is (was once) for. PR 53442.
CVS: ----------------------------------------------------------------------
2018-07-15 06:16:12 +00:00
dholland
c0640bfe41 Document what rdump is (was once) for. PR 53442. 2018-07-15 06:14:13 +00:00
jnemeth
aa3b5bb2ee Not all things that write to the disk do something that dk(4) will
be interested in.  Let individual commands decide if ioctl(DIOCMWEDGES)
should be done.  I was conservative and set the flag on any command
that might create/modify/delete partitions in any way.
2018-07-03 03:41:23 +00:00
sevan
ab8dd17d7b vnconfig name is retained for backwards compatibility. Use vndconfig.
Heads up by <tsutsui>
2018-06-30 09:27:41 +00:00
sevan
8ec25d68b5 Note vnconfig(8) may be of interest, especially when looking to mount an iso via
loopback.
2018-06-29 19:13:19 +00:00
kamil
bd8efe16d3 Avoid misaligned access in disklabel(8) in find_label()
Introduce a new helper variable tlp and use it for memory access.

Detected with MKSANITIZER/UBSan

A patch by <christos>
2018-06-27 01:14:48 +00:00
zafer
c3796b42cb Remove duplicate assignments.
Fixes PR bin/51512 by Jose Luis Rodriguez Garcia
2018-06-12 20:12:21 +00:00
kamil
5f51a87ea5 Correct Undefined Behavior in ifconfig(8)
Unportable left shift reported with MKSANITIZER=yes USE_SANITIZER=undefined:

# ifconfig
alc0: flags=0x8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        ec_capabilities=3<VLAN_MTU,VLAN_HWTAGGING>
        ec_enabled=0
        address: xx:xx:xx:xx:xx:xx
/public/src.git/sbin/ifconfig/af_inet.c:102:34: runtime error: left shift of 16777215 by 8 places cannot be represented in type 'int'
        inet 192.168.0.38/24 broadcast 192.168.0.255 flags 0x0
        inet6 xxxx::xxxx:xxxx:xxxx:xxx%alc0/64 flags 0x0 scopeid 0x1
lo0: flags=0x8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 33624
        inet 127.0.0.1/8 flags 0x0
        inet6 ::1/128 flags 0x20<NODAD>
        inet6 fe80::1%lo0/64 flags 0x0 scopeid 0x2

Change shifting left 1 to shifting 1U. This corrects the issue.

        if (cidr < 32) {                /* more than 1 bit in mask */
                /* check for non-contig netmask */
                if ((mask ^ (((1 << cidr) - 1) << (32 - cidr))) != 0) // <- here
                        return -1;      /* noncontig, no pfxlen */
        }

Solution suggested by <uwe>

Sponsored by <The NetBSD Foundation>
2018-06-11 17:45:50 +00:00
kamil
1c426e1841 Restore the MKGROFF=bo MKCXX=yes build
Mark the documentation in dc(1), gprof(1), rogue(6) and fsck_ffs(8) with
the .roff flag in SUBDIR.

Sponsored by <The NetBSD Foundation>
2018-06-11 14:18:16 +00:00
wiz
36ad4ce7a8 Remove Tn for standard abbreviations. 2018-05-17 06:37:06 +00:00
thorpej
e832c294bb Default NFS mounts to using TCP transport instead of UDP.
PR kern/53166
2018-05-17 02:34:31 +00:00
kre
0efffb3e4f With the change to use getpass_r the 128 byte passphrase limit no
longer applies, so update the BUGS section here to reflect that change.
The limit now is 1023 whichever method is used to fetch the passphrase.
2018-05-09 20:23:35 +00:00
alnsn
265610788f use explicit_memset(3) 2018-05-09 19:38:46 +00:00
alnsn
98def45107 Missed one change when doing a manual merge of my patch with kre's commit. 2018-05-09 18:18:11 +00:00
alnsn
bf3984213d Add '-e' option (echo the passphrase) and wipe the passphrase after use.
XXX Using memset for wiping isn't a good idea because memset is likely
optimised away by gcc. This should be revisited.
2018-05-09 18:11:56 +00:00
wiz
9f41709322 Add commas in enumeration. 2018-05-09 17:35:03 +00:00
kre
2d50dc8f17 Fix missing -p in usage message (noted by Christoph Badura, thanks),
and update -l usage as well.

While here fix man page synopses and a few other odds and ends.
2018-05-09 14:27:41 +00:00
kre
99316b228e Check arg count in configure() at entry, rather than later.
This avoids the stupid null deref I added a couple of commits
ago (on bad usage) and also simplifies the rest of the routine
which no longer needs to check the arg count nearly as much.

Thanks to Alexander Nasonov for finding the null deref bug.
2018-05-09 13:19:33 +00:00