Re: [PATCH v4] net: ipv6: seg6: report lwtunnel setup errors via extack

From: Andrea Mayer

Date: Tue Oct 06 2026 - 11:44:42 EST


On Mon, 5 Oct 2026 16:06:34 +0200
Gabriel Goller <g.goller@xxxxxxxxxxx> wrote:

Hi Gabriel,

thanks for the v4. +1 to Jakub on _MISS. I also have two comments on
the message text.

> [snip]
> switch (tuninfo->mode) {
> case SEG6_IPTUN_MODE_INLINE:
> - if (family != AF_INET6)
> + if (family != AF_INET6) {
> + NL_SET_ERR_MSG_ATTR(extack, tb[SEG6_IPTUNNEL_SRH],
> + "inline mode requires an IPv6 route");
> return -EINVAL;
> + }

This message is also returned for an IPv4 nexthop object, where there
is no route, for example:

ip -4 nexthop add id 1 encap seg6 mode inline segs fc00::1 dev dummy0

What about "inline mode requires the IPv6 address family"?

> [snip]
> /* verify that SRH is consistent */
> - if (!seg6_validate_srh(tuninfo->srh, tuninfo_len - sizeof(*tuninfo), false))
> + if (!seg6_validate_srh(tuninfo->srh, tuninfo_len - sizeof(*tuninfo),
> + false)) {
> + NL_SET_ERR_MSG_ATTR(extack, tb[SEG6_IPTUNNEL_SRH],
> + "invalid SRv6 segment routing header");
> return -EINVAL;
> + }

A nit: the same header is "SRv6 segment routing header" here and
"SRv6 SRH" in the other messages of seg6_build_state(). What about
using the name from the title of RFC 8754 in the extack messages,
for example:

"invalid SRv6 segment routing header"
-> "invalid IPv6 Segment Routing Header"

Thanks,
Andrea