Re: [PATCH net] ipv6: validate extension header length before copying to cmsg

From: Qi Tang

Date: Thu Apr 23 2026 - 05:58:32 EST


On Thu, Apr 23, 2026, Paolo Abeni <pabeni@xxxxxxxxxx> wrote:
> The patch looks functionally correct to me, but the above 3 statements
> are repeated multiple times. You can put them in a local helper and
> avoud a lot of duplicate code.

I actually considered that first, but went with per-site
replication in v1 to keep the diff minimal for backporting.
A local helper is definitely the better approach though.
Will do that for v2.

> The packet is corrupted, allowing processing of later rxopt requires the
> IMHO not nice empty label. I think it would be better just returning
> from this function.

Makes sense. Will return directly in v2.

Thanks for the review.

Qi