From 6057d302ab6f5ed2d0a21b32c4545f6d9bcb5c50 Mon Sep 17 00:00:00 2001 From: Stefan Sperling Date: Sat, 8 May 2010 11:07:21 +0000 Subject: While handling SIOCSIFLLADDR, after adjusting the MAC of the interface, call the interface-specific ioctl handler as well in case the driver needs to do something special. E.g. if_trunk expects this in order to update MAC addresses of its trunk ports. If you now see "Inappropriate ioctl for device" errors after running "ifconfig $if lladdr random" please let me know. Most likely the ioctl handler of the driver needs fixing. ok claudio@, "I only count half an ok for networking" tedu@ --- sys/net/if.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/net/if.c b/sys/net/if.c index 2a8fe3c5268..a2551c31fa5 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if.c,v 1.214 2010/04/25 17:38:53 mpf Exp $ */ +/* $OpenBSD: if.c,v 1.215 2010/05/08 11:07:20 stsp Exp $ */ /* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */ /* @@ -1557,6 +1557,9 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, struct proc *p) ETHER_ADDR_LEN); bcopy((caddr_t)ifr->ifr_addr.sa_data, LLADDR(sdl), ETHER_ADDR_LEN); + error = (*ifp->if_ioctl)(ifp, cmd, data); + if (error == ENOTTY) + error = 0; break; default: return (ENODEV); -- cgit v1.2.3