lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <58173122-f31b-be9e-fffd-2d219ff53f7b@asbjorn.st>
Date:   Mon, 14 Jun 2021 22:47:08 +0000
From:   Asbjørn Sloth Tønnesen <asbjorn@...jorn.st>
To:     Stephen Hemminger <stephen@...workplumber.org>
Cc:     netdev@...r.kernel.org, Jiri Pirko <jiri@...dia.com>
Subject: Re: [PATCH iproute2] tc: pedit: add decrement operation

Hi Stephen,

On 6/14/21 9:25 PM, Stephen Hemminger wrote:
> On Mon, 14 Jun 2021 20:33:24 +0000
> Asbjørn Sloth Tønnesen         <asbjorn@...jorn.st> wrote:
> 
>> @@ -422,16 +434,21 @@ int parse_cmd(int *argc_p, char ***argv_p, __u32 len, int type, __u32 retain,
>>   		goto done;
>>   	}
>>   
>>   	return -1;
>> +
> 
> 
> Please no unnecessary whitespace changes.

No problem, I tried to give context by using format-patch -U4,
so it didn't became it's own chunk. I included it to be
consistent within the function, having a blank line above
both label.


> Also you are missing to print_pedit() to print the resulting change.

I didn't plan to since it is stored as TCA_PEDIT_KEY_EX_CMD_ADD,
hence it is printed as:

   key #0  at ipv4+8: add ff000000 mask 00ffffff
   or
   key #0  at ipv6+4: add 000000ff mask ffffff00

If really needed I could detect this, and print something else,
but that would break FP and/or JSON compatibility, which I
don't think is worth it.

print_pedit() is generally not a direct representation of it's
input parameters.

   tc filter add [...] action pedit ex \
     munge eth dst set aa:00:42:00:00:33 \
     munge eth src set aa:00:42:00:00:22 \
     munge ip6 hoplimit dec action [..]

becomes:

   key #0  at eth+0: val aa004200 mask 00000000
   key #1  at eth+4: val 00330000 mask 0000ffff
   key #2  at eth+4: val 0000aa00 mask ffff0000
   key #3  at eth+8: val 42000022 mask 00000000
   key #4  at ipv6+4: add 000000ff mask ffffff00

Note: key #1 and #2 could be consolidated.


Shortly after posting, I noticed that I forgot to amend explain(),
that will be in v2.

-- 
Best regards
Asbjørn Sloth Tønnesen

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ