freebsd-src/sbin
Mike Karels b9e8ae1d8a route: error on IPv4 network routes with incorrect destination
Route destinations like 10/8 are most likely intended as a shorthand
for 10.0.0.0/8, but instead it means 0.0.0.10/8, which includes
only bits in the host part of the mask, and hence adds a route to
0.0.0.0/8.  In 12.x, there was code to "do what I mean", which was
removed as part of a cleanup of old network class remnants.  Given
that we have gone this long without that code, do not restore that
behavior.  Instead, detect the issue and produce an error.
Specifically, if there are no dots in a numeric IPv4 address, the
mask is specified with CIDR notation (using a slash), and there are
bits set in the host part, produce an error like this for 10/8:

    route: malformed address, bits set after mask; 10 means 0.0.0.10

PR:		258874
MFC after:	1 week
Reviewed by:	melifaro, emaste
Differential Revision:	https://reviews.freebsd.org/D43384
2024-01-15 15:14:54 -06:00
..
adjkerntz Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
bectl sbin: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
bsdlabel Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
camcontrol camcontrol: add support for Toshiba drive firmware update 2023-12-29 14:23:51 -05:00
ccdconfig sbin: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
clri Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
comcontrol sbin: Remove ancient SCCS tags. 2023-11-26 22:23:29 -07:00
conscontrol sbin: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
ddb sbin: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
decryptcore sbin: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
devd devd: Don't install autofs.conf with WITHOUT_AUTOFS 2023-12-22 15:27:50 +01:00
devfs sbin: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
devmatch sbin: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
dhclient Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
dmesg Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
dump sbin: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
dumpfs Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
dumpon Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
etherswitchcfg sbin: Remove ancient SCCS tags. 2023-11-26 22:23:29 -07:00
fdisk sbin: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
ffsinfo Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
fsck sbin: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
fsck_ffs sbin: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
fsck_msdosfs Purge more stray embedded $FreeBSD$ strings 2023-09-25 07:54:56 -07:00
fsdb sbin: Remove ancient SCCS tags. 2023-11-26 22:23:29 -07:00
fsirand Purge more stray embedded $FreeBSD$ strings 2023-09-25 07:54:56 -07:00
gbde Remove $FreeBSD$: one-line bare tag 2023-08-16 11:55:20 -06:00
geom sbin: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
ggate Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
growfs Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
gvinum gvinum(8): Fix a typo 2023-12-26 09:12:27 -07:00
hastctl sbin: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
hastd sbin: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
ifconfig net80211: adjust more VHT structures/fields 2023-12-22 00:20:19 +00:00
init Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
ipf Typos corrected; dependant, addres. 2024-01-04 19:17:24 +01:00
ipfw dummynet: add simple gilbert-elliott channel model 2023-12-17 13:20:45 +01:00
kldconfig sbin: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
kldload Add kenv .Xr in kldload(8) and loader.conf(5) 2023-12-20 21:17:38 -07:00
kldstat sbin: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
kldunload sbin: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
ldconfig Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
md5 sbin: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
mdconfig sbin: Remove ancient SCCS tags. 2023-11-26 22:23:29 -07:00
mdmfs sbin: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
mknod Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
mksnap_ffs Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
mount Fix "version introduced" in numerous manual pages 2024-01-08 11:35:16 -05:00
mount_cd9660 cd9660: Add support for mask,dirmask,uid,gid options 2024-01-12 14:51:31 -08:00
mount_fusefs sbin: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
mount_msdosfs Purge more stray embedded $FreeBSD$ strings 2023-09-25 07:54:56 -07:00
mount_nfs Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
mount_nullfs Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
mount_udf Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
mount_unionfs Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
natd Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
newfs sbin: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
newfs_msdos Purge more stray embedded $FreeBSD$ strings 2023-09-25 07:54:56 -07:00
nfsiod Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
nos-tun Purge more stray embedded $FreeBSD$ strings 2023-09-25 07:54:56 -07:00
nvmecontrol sbin: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
pfctl libpfctl: introduce pfctl_handle 2024-01-04 23:10:24 +01:00
pfilctl sbin: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
pflogd Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
ping sbin: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
quotacheck Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
rcorder sccs: Manual changes 2023-11-26 22:23:58 -07:00
reboot Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
recoverdisk Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
resolvconf Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
restore sbin: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
route route: error on IPv4 network routes with incorrect destination 2024-01-15 15:14:54 -06:00
routed sbin: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
rtsol Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
savecore sbin: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
setkey setkey(8): make the policy specification more readable 2023-10-31 06:07:10 +02:00
shutdown Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
swapon Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
sysctl sbin: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
tests Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
tunefs Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
umount Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
veriexec Add mac_grantbylabel 2023-08-24 17:42:11 -07:00
zfsbootcfg sbin: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
Makefile sbin: Remove ancient SCCS tags. 2023-11-26 22:23:29 -07:00
Makefile.amd64 Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
Makefile.arm Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
Makefile.i386 Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
Makefile.inc sbin: Remove ancient SCCS tags. 2023-11-26 22:23:29 -07:00
Makefile.powerpc64 Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00