]> git.baikalelectronics.ru Git - kernel.git/commit
netdevsim: Only use sampling truncation length when valid
authorIdo Schimmel <idosch@nvidia.com>
Thu, 22 Apr 2021 13:50:50 +0000 (16:50 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 22 Apr 2021 20:23:56 +0000 (13:23 -0700)
commit3b1b607d108b36adbe3ce64981497a74e4d2d286
tree7e1298192b2b6629b6ababc7ffa72d16be0853ed
parent5c291328cb8d9f30e35a61c10cf2501da6fba2aa
netdevsim: Only use sampling truncation length when valid

When the sampling truncation length is invalid (zero), pass the length
of the packet. Without the fix, no payload is reported to user space
when the truncation length is zero.

Fixes: 43439df2da45 ("netdevsim: Add dummy psample implementation")
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Acked-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/netdevsim/psample.c