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] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZTt2o294RMW+MwKs@nanopsycho>
Date: Fri, 27 Oct 2023 10:36:51 +0200
From: Jiri Pirko <jiri@...nulli.us>
To: Jakub Kicinski <kuba@...nel.org>
Cc: netdev@...r.kernel.org, pabeni@...hat.com, davem@...emloft.net,
	edumazet@...gle.com
Subject: Re: [patch net-next v3] tools: ynl: introduce option to process
 unknown attributes or types

Thu, Oct 26, 2023 at 09:30:58PM CEST, kuba@...nel.org wrote:
>On Thu, 26 Oct 2023 18:25:14 +0200 Jiri Pirko wrote:
>> Thu, Oct 26, 2023 at 04:41:20PM CEST, kuba@...nel.org wrote:
>> >On Thu, 26 Oct 2023 07:42:33 +0200 Jiri Pirko wrote:  
>> >> {'129': {'0': [type:0 len:12] b'\x00\x00\x00\x00\x00\x00\x00\x00',
>> >>          '1': [type:1 len:12] b'\x00\x00\x00\x00\x00\x00\x00\x00',
>> >>          '2': [type:2 len:12] b'(\x00\x00\x00\x00\x00\x00\x00'},
>> >> Looks like unnecessary redundant info, I would rather stick with
>> >> "as_bin()". __repr__() is printable representation of the whole object,
>> >> we just need value here, already have that in a structured object.
>> >> 
>> >> 
>> >> What is "type" and "len" good for here?  
>> >
>> >I already gave you a longer explanation, if you don't like the
>> >duplication, how about you stop keying them on a (stringified?!) id.  
>> 
>> I don't care that much, it just looks weird :)
>
>As I said my key requirement is that the NlAttr object must still 
>be there in the result.

Yeah, that I don't how to do honestly. See below.


>
>Maybe a good compromise is to stick it into the key, instead of the
>value. Replacing the stringified type id. Then you can keep the
>value as binary.

Okay, that sounds good. But "key": \bvalue is not something to be
printed out by __repr__() as it outs string. Therefore I don't
understand how this compiles with your key requirement above.
I have to be missing something, pardon my ignorance.



>We'd need to wrap it into another class but whatever,
>compromises.

Will check on how to implement this.

>
>IDK how this works in Python exactly but to give you a rough idea
>here's pseudo code typed in the email client:
>
>class UnknownNlAttrKey:
>	def __init__(self, nlattr):
>		self.nla = nlattr
>	def __hash__(self):
>		return self.nla.type
>	def __eq__(self, other):
>		if isintance(other, Unknown...):
>			return other.nla.type == self.nla.type
>		return False
>	def __repr__():
>		return f"UnknownAttr({self.nla.type})"

I see, will check if this is needed.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ