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: <CAG=2xmN+fp5B_b1KQq2T9DKrTQ_+Kqr6WbmrY0Gk1j3zZnY1YA@mail.gmail.com>
Date: Tue, 11 Jun 2024 15:03:45 +0000
From: Adrián Moreno <amorenoz@...hat.com>
To: Aaron Conole <aconole@...hat.com>
Cc: netdev@...r.kernel.org, Pravin B Shelar <pshelar@....org>, 
	"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, 
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, Shuah Khan <shuah@...nel.org>, 
	dev@...nvswitch.org, linux-kselftest@...r.kernel.org, 
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next 2/2] selftests: openvswitch: set value to nla flags

On Mon, Jun 03, 2024 at 03:02:46PM GMT, Aaron Conole wrote:
> Adrian Moreno <amorenoz@...hat.com> writes:
>
> > Netlink flags, although they don't have payload at the netlink level,
> > are represented as having a "True" value in pyroute2.
> >
> > Without it, trying to add a flow with a flag-type action (e.g: pop_vlan)
> > fails with the following traceback:
> >
> > Traceback (most recent call last):
> >   File "[...]/ovs-dpctl.py", line 2498, in <module>
> >     sys.exit(main(sys.argv))
> >              ^^^^^^^^^^^^^^
> >   File "[...]/ovs-dpctl.py", line 2487, in main
> >     ovsflow.add_flow(rep["dpifindex"], flow)
> >   File "[...]/ovs-dpctl.py", line 2136, in add_flow
> >     reply = self.nlm_request(
> >             ^^^^^^^^^^^^^^^^^
> >   File "[...]/pyroute2/netlink/nlsocket.py", line 822, in nlm_request
> >     return tuple(self._genlm_request(*argv, **kwarg))
> >                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> >   File "[...]/pyroute2/netlink/generic/__init__.py", line 126, in
> > nlm_request
> >     return tuple(super().nlm_request(*argv, **kwarg))
> >            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> >   File "[...]/pyroute2/netlink/nlsocket.py", line 1124, in nlm_request
> >     self.put(msg, msg_type, msg_flags, msg_seq=msg_seq)
> >   File "[...]/pyroute2/netlink/nlsocket.py", line 389, in put
> >     self.sendto_gate(msg, addr)
> >   File "[...]/pyroute2/netlink/nlsocket.py", line 1056, in sendto_gate
> >     msg.encode()
> >   File "[...]/pyroute2/netlink/__init__.py", line 1245, in encode
> >     offset = self.encode_nlas(offset)
> >              ^^^^^^^^^^^^^^^^^^^^^^^^
> >   File "[...]/pyroute2/netlink/__init__.py", line 1560, in encode_nlas
> >     nla_instance.setvalue(cell[1])
> >   File "[...]/pyroute2/netlink/__init__.py", line 1265, in setvalue
> >     nlv.setvalue(nla_tuple[1])
> >                  ~~~~~~~~~^^^
> > IndexError: list index out of range
> >
> > Signed-off-by: Adrian Moreno <amorenoz@...hat.com>
> > ---
>
> Acked-by: Aaron Conole <aconole@...hat.com>
>
> I don't know which pyroute2 version I had used when I tested this
> previously, but even on my current system I get this error now.  Thanks
> for the fix.
>

Thanks Aaron. I'll resend as v2 with your ack as a stand-alone patch
since the other patch of this series will be fixed by your soon-to-come
series.

> >  tools/testing/selftests/net/openvswitch/ovs-dpctl.py | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/tools/testing/selftests/net/openvswitch/ovs-dpctl.py b/tools/testing/selftests/net/openvswitch/ovs-dpctl.py
> > index b76907ac0092..a2395c3f37a1 100644
> > --- a/tools/testing/selftests/net/openvswitch/ovs-dpctl.py
> > +++ b/tools/testing/selftests/net/openvswitch/ovs-dpctl.py
> > @@ -537,7 +537,7 @@ class ovsactions(nla):
> >              for flat_act in parse_flat_map:
> >                  if parse_starts_block(actstr, flat_act[0], False):
> >                      actstr = actstr[len(flat_act[0]):]
> > -                    self["attrs"].append([flat_act[1]])
> > +                    self["attrs"].append([flat_act[1], True])
> >                      actstr = actstr[strspn(actstr, ", ") :]
> >                      parsed = True
>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ