Re: [PATCH net-next v4 02/15] net: build socket infrastructure for QUIC protocol

Xin Long <[email protected]> Wed, 29 Oct 2025 15:57:25 -0400
Newsgroups dev.linux.lists.quic,dev.linux.lists.kernel-tls-handshake,org.kernel.vger.linux-cifs,org.kernel.vger.netdev
Message-ID <CADvbK_f4rN-7bvvwWDVm-B+h6QiSwQbK7EKsWh5kTuHJjuGjTA@mail.gmail.com>
On Wed, Oct 29, 2025 at 12:22 PM Stefan Metzmacher <[email protected]> wrote:
>
> Hi Xin,
>
> > This patch lays the groundwork for QUIC socket support in the kernel.
> > It defines the core structures and protocol hooks needed to create
> > QUIC sockets, without implementing any protocol behavior at this stage.
> >
> > Basic integration is included to allow building the module via
> > CONFIG_IP_QUIC=m.
> >
> > This provides the scaffolding necessary for adding actual QUIC socket
> > behavior in follow-up patches.
> >
> > Signed-off-by: Pengtao He <[email protected]>
> > Signed-off-by: Xin Long <[email protected]>
>
> ...
>
> > +module_init(quic_init);
> > +module_exit(quic_exit);
> > +
> > +MODULE_ALIAS("net-pf-" __stringify(PF_INET) "-proto-261");
> > +MODULE_ALIAS("net-pf-" __stringify(PF_INET6) "-proto-261");
>
> Shouldn't this use MODULE_ALIAS_NET_PF_PROTO(PF_INET, IPPROTO_QUIC)
> instead?
>
Hi, Stefan,

If we switch to using MODULE_ALIAS_NET_PF_PROTO(), we still need to
keep using the numeric value 261:

  MODULE_ALIAS_NET_PF_PROTO(PF_INET, 261);
  MODULE_ALIAS_NET_PF_PROTO(PF_INET6, 261);

IPPROTO_QUIC is defined as an enum, not a macro. Since
MODULE_ALIAS_NET_PF_PROTO() relies on __stringify(proto), it can’t
stringify enum values correctly, and it would generate:

  alias:          net-pf-10-proto-IPPROTO_QUIC
  alias:          net-pf-2-proto-IPPROTO_QUIC

instead of:

  alias:          net-pf-10-proto-261
  alias:          net-pf-2-proto-261

Thanks.