]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: pktgen: enable 'param=value' parsing
authorPeter Seiderer <ps.report@gmx.net>
Wed, 19 Feb 2025 08:45:22 +0000 (09:45 +0100)
committerJakub Kicinski <kuba@kernel.org>
Fri, 21 Feb 2025 01:24:55 +0000 (17:24 -0800)
Enable more flexible parameters syntax, allowing 'param=value' in
addition to the already supported 'param value' pattern (additional
this gives the skipping '=' in count_trail_chars() a purpose).

Tested with:

$ echo "min_pkt_size 999" > /proc/net/pktgen/lo\@0
$ echo "min_pkt_size=999" > /proc/net/pktgen/lo\@0
$ echo "min_pkt_size =999" > /proc/net/pktgen/lo\@0
$ echo "min_pkt_size= 999" > /proc/net/pktgen/lo\@0
$ echo "min_pkt_size = 999" > /proc/net/pktgen/lo\@0

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250219084527.20488-3-ps.report@gmx.net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/core/pktgen.c

index 496aa16773e787919a3877f00c644dcb77c9ce02..4f8ec6c9bed4a3eec7dfc42cb51dc7fe54c8f0c6 100644 (file)
@@ -823,6 +823,7 @@ static int strn_len(const char __user * user_buffer, unsigned int maxlen)
                case '\r':
                case '\t':
                case ' ':
+               case '=':
                        goto done_str;
                default:
                        break;