Re: [PATCH net v3] ipv6: rpl: fix NULL dereference of idev in ipv6_rpl_srh_rcv()

From: Hangbin Liu

Date: Tue Sep 15 2026 - 09:25:47 EST


On Tue, Sep 15, 2026 at 02:03:12PM +0800, Hangbin Liu wrote:
> Hi Andrea,
>
> While reviewing the SRv6 code, I noticed you added an `idev` check in
> `ipv6_rthdr_rcv()`. I’m wondering whether it makes sense to also halt
> processing for `IPV6_SRCRT_TYPE_2` when `!idev`, given that IPv6 is
> disabled on that device.
>
> If so, could we drop the skb early at the entry point of `ipv6_rthdr_rcv()`?
> The downside is that subsequent processing and `__IP6_INC_STATS()` would be
> skipped.

Oh, another behavior change. At present, if !idev, we can still process the
IPV6_SRCRT_TYPE_2 message. And the process will be skipped if we return early.
I'm not sure if this kind of change is acceptable or not in kernel.

But on the other hand, is it correct to accept and forward SRCRT Type 2
packets on device that IPv6 is disabled?

Thanks
Hangbin