Practically all interfaces pull itself up when IPs get assigned, but
vport(4) does not.
This broke IPv4 networking for me on a router I switched from bridge(4)
to veb(4) because hostname.vport0 only contained the equivalent of
descr LAN
inet 192.0.2.1
inet6 2001:db8::1
e.g. the explicit "up" was missing.
dhcpd(8) only considers UP interfaces to listen on during start;
being the only interface it could potentially listen on, dhcpd thus
ignored vport0 and failed to start.
`ifconfig vport0 up && rcctl restart dhcpd' fixed this.
Adding "up" to hostname.vport0 also fixed it.
Nonetheless, vport should UP itself as the rest does.
OK?
Index: net/if_veb.c
===================================================================
RCS file: /cvs/src/sys/net/if_veb.c,v
retrieving revision 1.21
diff -u -p -r1.21 if_veb.c
--- net/if_veb.c 8 Nov 2021 04:15:46 -0000 1.21
+++ net/if_veb.c 13 Nov 2021 23:47:58 -0000
@@ -2122,6 +2122,10 @@ vport_ioctl(struct ifnet *ifp, u_long cm
return (ENXIO);
switch (cmd) {
+ case SIOCSIFADDR:
+ ifp->if_flags |= IFF_UP;
+ /* FALLTHROUGH */
+
case SIOCSIFFLAGS:
if (ISSET(ifp->if_flags, IFF_UP)) {
if (!ISSET(ifp->if_flags, IFF_RUNNING))