svn commit: r364755 - stable/12/sys/dev/netmap

Vincenzo Maffione vmaffione at FreeBSD.org
Tue Aug 25 11:10:38 UTC 2020


Author: vmaffione
Date: Tue Aug 25 11:10:37 2020
New Revision: 364755
URL: https://svnweb.freebsd.org/changeset/base/364755

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 at packetforensics.com
  Reported by:    bpoole at packetforensics.com
  Reviewed by:    giuseppe.lettieri at unipi.it
  Approved by:    vmaffione
  
  This line, and those below, will be ignored--
  > Description of fields to fill in above:                     76 columns --|
  > PR:                       If and which Problem Report is related.
  > Submitted by:             If someone else sent in the change.
  > Reported by:              If someone else reported the issue.
  > Reviewed by:              If someone else reviewed your modification.
  > Approved by:              If you needed approval for this commit.
  > Obtained from:            If the change is from a third party.
  > MFC after:                N [day[s]|week[s]|month[s]].  Request a reminder email.
  > MFH:                      Ports tree branch name.  Request approval for merge.
  > Relnotes:                 Set to 'yes' for mention in release notes.
  > Security:                 Vulnerability reference (one per line) or description.
  > Sponsored by:             If the change was sponsored by an organization.
  > Pull Request:             https://github.com/freebsd/freebsd/pull/### (*full* GitHub URL needed).
  > Differential Revision:    https://reviews.freebsd.org/D### (*full* phabric URL needed).
  > Empty fields above will be automatically removed.
  
  _M   .
  M    sys/dev/netmap/netmap_legacy.c

Modified:
  stable/12/sys/dev/netmap/netmap_legacy.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/netmap/netmap_legacy.c
==============================================================================
--- stable/12/sys/dev/netmap/netmap_legacy.c	Tue Aug 25 09:42:03 2020	(r364754)
+++ stable/12/sys/dev/netmap/netmap_legacy.c	Tue Aug 25 11:10:37 2020	(r364755)
@@ -76,9 +76,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;


More information about the svn-src-all mailing list