Page MenuHomeFreeBSD

D45585.diff
No OneTemporary

D45585.diff

diff --git a/UPDATING b/UPDATING
--- a/UPDATING
+++ b/UPDATING
@@ -27,6 +27,11 @@
world, or to merely disable the most expensive debugging functionality
at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".)
+20240617:
+ ifconfig now treats IPv4 addresses without a width or mask as an error.
+ Specify the desired mask or width along with the IP address on the
+ ifconfig command line and in rc.conf.
+
20240428:
OpenBSM auditing runtime (auditd, etc.) has been moved into the new
package FreeBSD-audit. If you use OpenBSM auditing and pkgbase, you
diff --git a/sbin/ifconfig/af_inet.c b/sbin/ifconfig/af_inet.c
--- a/sbin/ifconfig/af_inet.c
+++ b/sbin/ifconfig/af_inet.c
@@ -436,36 +436,13 @@
return (e.error);
}
-
-static void
-in_setdefaultmask_nl(void)
-{
- struct in_px *px = sintab_nl[ADDR];
-
- in_addr_t i = ntohl(px->addr.s_addr);
-
- /*
- * If netmask isn't supplied, use historical default.
- * This is deprecated for interfaces other than loopback
- * or point-to-point; warn in other cases. In the future
- * we should return an error rather than warning.
- */
- if (IN_CLASSA(i))
- px->plen = 32 - IN_CLASSA_NSHIFT;
- else if (IN_CLASSB(i))
- px->plen = 32 - IN_CLASSB_NSHIFT;
- else
- px->plen = 32 - IN_CLASSC_NSHIFT;
- px->maskset = true;
-}
#endif
static void
-warn_nomask(int ifflags)
+err_nomask(int ifflags)
{
if ((ifflags & (IFF_POINTOPOINT | IFF_LOOPBACK)) == 0) {
- warnx("WARNING: setting interface address without mask "
- "is deprecated,\ndefault mask may not be correct.");
+ errx(1, "ERROR: setting interface address without mask is no longer supported.");
}
}
@@ -474,12 +451,11 @@
{
#ifdef WITHOUT_NETLINK
if (sintab[ADDR]->sin_len != 0 && sintab[MASK]->sin_len == 0 && newaddr) {
- warn_nomask(ifflags);
+ err_nomask(ifflags);
}
#else
if (sintab_nl[ADDR]->addrset && !sintab_nl[ADDR]->maskset && newaddr) {
- warn_nomask(ifflags);
- in_setdefaultmask_nl();
+ err_nomask(ifflags);
}
#endif
}

File Metadata

Mime Type
text/plain
Expires
Wed, Apr 30, 10:52 PM (9 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
17866894
Default Alt Text
D45585.diff (1 KB)

Event Timeline