All of lore.kernel.org
 help / color / mirror / Atom feed
* [ynl] how to fix the order of selector and `_decode_sub_msg`
@ 2026-08-25 12:48 Hangbin Liu
  2026-08-27 17:14 ` Jakub Kicinski
  0 siblings, 1 reply; 3+ messages in thread
From: Hangbin Liu @ 2026-08-25 12:48 UTC (permalink / raw)
  To: Donald Hunter, Jakub Kicinski; +Cc: netdev

Hi Donald, Jakub,

Recently I have been trying to add encap decoding support for `rt‑route.yaml`,
with formats similar to:

      -
        name: encap-type
        type: u16
        enum: encap-type
      -
        name: encap
        type: sub-message
        sub-message: encap-data
        selector: encap-type

However, sub‑message decoding is broken inside `ynl.py`. The root cause is
that `lwtunnel_fill_encap()` sets the encap‑type *after* the encap payload
data.

In iproute2, `parse_rtattr()` extracts all attributes together. In contrast,
`ynl.py` stores attributes one‑by‑one into `search_attrs` after they get
decoded (_decode() -> self._rsp_add()). As a result, we cannot locate the
`selector` while decoding the "encap" payload.

Should we decode sub‑messages after finishing first‑level attribute decoding?
Do you have any suggestions on how we can fix this?

Thanks
Hangbin

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-08-28  1:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-25 12:48 [ynl] how to fix the order of selector and `_decode_sub_msg` Hangbin Liu
2026-08-27 17:14 ` Jakub Kicinski
2026-08-28  1:41   ` Hangbin Liu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.