[PATCH v2] pktgen: Fix invalid clone_skb override
From: Nicholas Richardson
Date: Mon Aug 02 2021 - 13:12:27 EST
From: Nick Richardson <richardsonnick@xxxxxxxxxx>
When the netif_receive xmit_mode is set, a line is supposed to set
clone_skb to a default 0 value. This line is not reached due to a line
that checks if clone_skb is more than zero and returns -ENOTSUPP.
Removes line that defaults clone_skb to zero. -ENOTSUPP is returned
if clone_skb is more than zero. If clone_skb is equal to zero then the
xmit_mode is set to netif_receive as usual and no error is returned.
Signed-off-by: Nick Richardson <richardsonnick@xxxxxxxxxx>
---
net/core/pktgen.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 7e258d255e90..314f97acf39d 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -1190,11 +1190,6 @@ static ssize_t pktgen_if_write(struct file *file,
* pktgen_xmit() is called
*/
pkt_dev->last_ok = 1;
-
- /* override clone_skb if user passed default value
- * at module loading time
- */
- pkt_dev->clone_skb = 0;
} else if (strcmp(f, "queue_xmit") == 0) {
pkt_dev->xmit_mode = M_QUEUE_XMIT;
pkt_dev->last_ok = 1;
--
2.32.0.554.ge1b32706d8-goog