1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-08 13:28:05 +00:00

fix a bug in the computation of the userspace offset for a give netmap buffer.

Submitted by: Hugh Nhan
This commit is contained in:
Luigi Rizzo 2013-04-15 11:49:16 +00:00
parent a08f2cf69e
commit aa76317cfc
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=249504

View File

@ -278,7 +278,7 @@ netmap_obj_offset(struct netmap_obj_pool *p, const void *vaddr)
const char *base = p->lut[i].vaddr;
ssize_t relofs = (const char *) vaddr - base;
if (relofs < 0 || relofs > p->_clustsize)
if (relofs < 0 || relofs >= p->_clustsize)
continue;
ofs = ofs + relofs;