Thread (5 messages) 5 messages, 3 authors, 5d ago

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

flat view

From: Gabriel Goller <hidden>
Date: 2026-10-08 11:34:42
Also in: lkml

On 06.10.2026 17:43, Andrea Mayer wrote:
On Mon,  5 Oct 2026 16:06:34 +0200
Gabriel Goller [off-list ref] wrote:

Hi Gabriel,

thanks for the v4. +1 to Jakub on _MISS. I also have two comments on
the message text.
quoted
[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"?
quoted
[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
Agree with everything
Thanks for the review!

Gabriel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help