NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/57645: bridge does not work on raspberry pi



The following reply was made to PR kern/57645; it has been noted by GNATS.

From: Taylor R Campbell <riastradh%NetBSD.org@localhost>
To: sc.dying%gmail.com@localhost
Cc: gnats-bugs%NetBSD.org@localhost, Martin Husemann <martin%duskware.de@localhost>,
	Michael van Elst <mlelstv%serpens.de@localhost>
Subject: Re: kern/57645: bridge does not work on raspberry pi
Date: Sat, 7 Oct 2023 23:12:34 +0000

 This is a multi-part message in MIME format.
 --=_UO/DuVWULAgwAF6z8mwyycn6j85jhood
 
 Can you please try the attached patch and see if it makes a
 difference?
 
 --=_UO/DuVWULAgwAF6z8mwyycn6j85jhood
 Content-Type: text/plain; charset="ISO-8859-1"; name="pr57646-usbnet-reinit"
 Content-Transfer-Encoding: quoted-printable
 Content-Disposition: attachment; filename="pr57646-usbnet-reinit.patch"
 
 From c3072c8e296617eb7b6f9ebcec48bfd5f5bab02a Mon Sep 17 00:00:00 2001
 From: Taylor R Campbell <riastradh%NetBSD.org@localhost>
 Date: Sat, 7 Oct 2023 23:09:16 +0000
 Subject: [PATCH] usbnet(4): On if_init, stop/init if IFF_RUNNING -- not noo=
 p.
 
 ether_ioctl(9) relies on this to reinitialize an interface when a
 flags change returns ENETRESET.
 
 PR kern/57645
 
 XXX pullup-10
 ---
  sys/dev/usb/usbnet.c | 11 ++++++-----
  1 file changed, 6 insertions(+), 5 deletions(-)
 
 diff --git a/sys/dev/usb/usbnet.c b/sys/dev/usb/usbnet.c
 index c77e08e07f7e..cdf52af9de08 100644
 --- a/sys/dev/usb/usbnet.c
 +++ b/sys/dev/usb/usbnet.c
 @@ -1300,14 +1300,15 @@ usbnet_if_init(struct ifnet *ifp)
  		return EIO;
 =20
  	/*
 -	 * If we're already running, nothing to do.
 +	 * If we're already running, stop the interface first -- we're
 +	 * reinitializing it.
  	 *
 -	 * XXX This should be an assertion, but it may require some
 -	 * analysis -- and possibly some tweaking -- of sys/net to
 -	 * ensure.
 +	 * XXX Grody for sys/net to call if_init to reinitialize.  This
 +	 * should be an assertion, not a branch, but it will require
 +	 * some tweaking of sys/net to avoid.
  	 */
  	if (ifp->if_flags & IFF_RUNNING)
 -		return 0;
 +		uno_stop(un, ifp, /*disable*/1/*XXX???*/);
 =20
  	error =3D uno_init(un, ifp);
  	if (error)
 
 --=_UO/DuVWULAgwAF6z8mwyycn6j85jhood--
 


Home | Main Index | Thread Index | Old Index