[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAHA+R7OKfg5C2dEz2JuxWncoo8gBX=r2MuHUdsGvALNXRSQoiQ@mail.gmail.com>
Date: Wed, 20 Aug 2014 20:05:46 -0700
From: Cong Wang <cwang@...pensource.com>
To: Ben Greear <greearb@...delatech.com>
Cc: "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: pktgen and tos
On Wed, Aug 20, 2014 at 2:52 PM, Ben Greear <greearb@...delatech.com> wrote:
> Here's a half-arsed bug report, in case someone is bored.
>
> At least in my hacked up pktgen, you cannot set a one-digit tos,
> because the parser fails if length is not 2 digits.
>
> echo tos 4 > /proc/net/pktgen/rddVR2 && cat /proc/net/pktgen/rddVR2
>
> ...
> Result: ERROR: tos must be 00-ff
>
> If you use '04' instead, it works. In my case, it will be easier to hack
> user-space
> to deal with this than fix pktgen, but I thought someone might want to fix
> it proper.
>
> Also, could be that upstream code doesn't have this limitation...
We need something like this:
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 8b849dd..f8cb428 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -1674,7 +1674,7 @@ static ssize_t pktgen_if_write(struct file *file,
return len;
i += len;
- if (len == 2) {
+ if (len <= 2) {
pkt_dev->tos = tmp_value;
sprintf(pg_result, "OK: tos=0x%02x", pkt_dev->tos);
} else {
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists