Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 3 Sep 2025 17:20:16 GMT
From:      Zhenlei Huang <zlei@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: e921d2842ee8 - main - umb: Fix setting the input routine
Message-ID:  <202509031720.583HKGPY019582@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by zlei:

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

commit e921d2842ee8ca9e3dae8952e1cf2645cee785aa
Author:     Zhenlei Huang <zlei@FreeBSD.org>
AuthorDate: 2025-09-03 17:19:37 +0000
Commit:     Zhenlei Huang <zlei@FreeBSD.org>
CommitDate: 2025-09-03 17:19:37 +0000

    umb: Fix setting the input routine
    
    This driver does not depend on netmap, and umb_input() works greatly
    without netmap.
    
    Remove the #ifdef DEV_NETMAP so that when "device netmap" is not
    configured this driver can still correctly pass the inbound packets to
    the net stack. Otherwise the input routine will be if_input_default()
    which will silently drop all inbound packets.
    
    PR:             263783
    Reported by:    Andre Albsmeier <mail@fbsd2.e4m.org>
    Tested by:      Andre Albsmeier <mail@fbsd2.e4m.org>
    Differential Revision:  https://reviews.freebsd.org/D52182
---
 sys/dev/usb/net/if_umb.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/sys/dev/usb/net/if_umb.c b/sys/dev/usb/net/if_umb.c
index f640b4224aad..b1082b117259 100644
--- a/sys/dev/usb/net/if_umb.c
+++ b/sys/dev/usb/net/if_umb.c
@@ -177,9 +177,7 @@ static void	 umb_ncm_setup(struct umb_softc *, struct usb_config *);
 static void	 umb_close_bulkpipes(struct umb_softc *);
 static int	 umb_ioctl(if_t , u_long, caddr_t);
 static void	 umb_init(void *);
-#ifdef DEV_NETMAP
 static void	 umb_input(if_t , struct mbuf *);
-#endif
 static int	 umb_output(if_t , struct mbuf *,
 		    const struct sockaddr *, struct route *);
 static void	 umb_start(if_t );
@@ -585,9 +583,7 @@ umb_attach_task(struct usb_proc_msg *msg)
 	if_setsoftc(ifp, sc);
 	if_setflags(ifp, IFF_SIMPLEX | IFF_MULTICAST | IFF_POINTOPOINT);
 	if_setioctlfn(ifp, umb_ioctl);
-#ifdef DEV_NETMAP
 	if_setinputfn(ifp, umb_input);
-#endif
 	if_setoutputfn(ifp, umb_output);
 	if_setstartfn(ifp, umb_start);
 	if_setinitfn(ifp, umb_init);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202509031720.583HKGPY019582>