[<prev] [next>] [day] [month] [year] [list]
Message-ID: <6aef04e4ea98227c18328126d0a2fcedfaf362b6.camel@inf.elte.hu>
Date: Fri, 05 Apr 2024 09:12:07 +0200
From: Ferenc Fejes <fejes@....elte.hu>
To: netdev <netdev@...r.kernel.org>
Cc: andrea.mayer@...roma2.it, sr6-dev@...tes.uclouvain.be
Subject: [question] SRv6 socket API
Hi,
While experimenting with SRv6 and IPv6 sockets, I skimmed the relevant
parts of the kernel and failed to figure out how it was supposed to
work.
Two questions about the SRv6 socket API.
1. No matter what I do, the nexthdr field of ipv6_sr_hdr is completely
ignored and the field is set as if its a sticky option. For example, if
I open my socket as (AF_INET6, SOCK_RAW, IPPROTO_IPV6), nexthdr on the
wire is set to 41 (IPv6). If I open the socket as (..., ...,
IPPROTO_UDP) nexthdr will be UDP. Do I miss something?
2. Is it possible to request the SRv6 header? I see the relevant parts
in the kernel code for legacy routing headers (type2) but not for SRv6
(type4).
My test code is as follows:
socket(AF_INET6, SOCK_RAW, IPPROTO_ROUTING)
setsockopt(fd, IPPROTO_IPV6, IPV6_RECVRTHDR, &on, sizeof(on))
... allocate enough space for cmsg, prepare msghdr, etc...
recvmsg(fd, &msg, 0)
When I send an SRv6 packet with a few segments, recvmsg returns, but
there are no cmsgs.
Are these expected operations or do I need to dig deeper?
Thanks,
Ferenc
Powered by blists - more mailing lists