Date: Tue, 25 Aug 2020 11:12:31 +0000 (UTC) From: Vincenzo Maffione <vmaffione@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r364756 - stable/11/sys/dev/netmap Message-ID: <202008251112.07PBCVdY072253@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: vmaffione Date: Tue Aug 25 11:12:30 2020 New Revision: 364756 URL: https://svnweb.freebsd.org/changeset/base/364756 Log: MFC r364341 netmap: fix parsing of legacy nmr->nr_ringid Code was checking for NETMAP_{SW,HW}_RING in req->nr_ringid which had already been masked by NETMAP_RING_MASK. Therefore, the comparisons always failed and set NR_REG_ALL_NIC. Check against the original nmr structure. Submitted by: bpoole@packetforensics.com Reported by: bpoole@packetforensics.com Reviewed by: giuseppe.lettieri@unipi.it Approved by: vmaffione Modified: stable/11/sys/dev/netmap/netmap_legacy.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/netmap/netmap_legacy.c ============================================================================== --- stable/11/sys/dev/netmap/netmap_legacy.c Tue Aug 25 11:10:37 2020 (r364755) +++ stable/11/sys/dev/netmap/netmap_legacy.c Tue Aug 25 11:12:30 2020 (r364756) @@ -71,9 +71,9 @@ nmreq_register_from_legacy(struct nmreq *nmr, struct n /* Convert the older nmr->nr_ringid (original * netmap control API) to nmr->nr_flags. */ u_int regmode = NR_REG_DEFAULT; - if (req->nr_ringid & NETMAP_SW_RING) { + if (nmr->nr_ringid & NETMAP_SW_RING) { regmode = NR_REG_SW; - } else if (req->nr_ringid & NETMAP_HW_RING) { + } else if (nmr->nr_ringid & NETMAP_HW_RING) { regmode = NR_REG_ONE_NIC; } else { regmode = NR_REG_ALL_NIC;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202008251112.07PBCVdY072253>