git: 0b158de11091 - stable/14 - pseries/llan: call init when ioctl sets interface UP

From: Justin Hibbits <jhibbits_at_FreeBSD.org>
Date: Wed, 20 May 2026 01:58:50 UTC
The branch stable/14 has been updated by jhibbits:

URL: https://cgit.FreeBSD.org/src/commit/?id=0b158de1109174cd5a189e244198ee02062984f0

commit 0b158de1109174cd5a189e244198ee02062984f0
Author:     Justin Hibbits <jhibbits@FreeBSD.org>
AuthorDate: 2026-04-23 03:12:37 +0000
Commit:     Justin Hibbits <jhibbits@FreeBSD.org>
CommitDate: 2026-05-20 01:55:31 +0000

    pseries/llan: call init when ioctl sets interface UP
    
    This should fix dhcp on an unitialized interface.  This solution was
    found while comparing against another driver, SIOCSIFFLAGS is used by
    dhclient to force the interface up before it has an IP address.
    However, all setup work is done in llan_init(), so the interface would
    not be enabled if configured via only the SIOCSIFFLAGS ioctl.  By
    running llan_init() when the interface is forced up via SIOCSIFFLAGS,
    the interface is initialized properly.
    
    PR:             292164
    (cherry picked from commit 74dff310698b9a4da9804ed0ded00428b0aebbe8)
---
 sys/powerpc/pseries/phyp_llan.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sys/powerpc/pseries/phyp_llan.c b/sys/powerpc/pseries/phyp_llan.c
index 26209d744101..5da5fd78fcc3 100644
--- a/sys/powerpc/pseries/phyp_llan.c
+++ b/sys/powerpc/pseries/phyp_llan.c
@@ -548,6 +548,10 @@ llan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
 		err = ifmedia_ioctl(ifp, (struct ifreq *)data, &sc->media, cmd);
 		break;
 	case SIOCSIFFLAGS:
+		if ((if_getflags(ifp) & IFF_UP) &&
+		    !(if_getdrvflags(ifp) & IFF_DRV_RUNNING))
+			llan_init(sc);
+		break;
 	default:
 		err = ether_ioctl(ifp, cmd, data);
 		break;