tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Calculation of IPv6 fragmented part length



On Mon, Apr 15, 2024 at 4:01 PM Ryota Ozaki <ozaki-r%netbsd.org@localhost> wrote:
>
> Hi,
>
> On Mon, Apr 15, 2024 at 12:24 AM Yasuyuki KOZAKAI
> <yasuyuki.kozakai%gmail.com@localhost> wrote:
> >
> > Hello,
> >
> > The current kernel tries to calculate the fragmented part length by ntohs(ip6->ip6_plen) - offset) and it checks if it is zero, but the calculation is incorrect.
> >
> > Then the current kernel drops a IPv6 packet which consists of 40 octets IPv6 header, 8 octets Fragment Header, and 32 octets fragmented part.
> >
> > The following changes will resolve the problem.
> > Please review & consider to apply it.
> >
> > I did not import the code from FreeBSD to resolve it, because FreeBSD checks zero length fragment after handling atomic fragment.
> > FreeBSD would pass a zero length fragment with M flag = 0 and Fragment Offset = 0 to upper layer processing ( I did not test it, though).
> > It would be better to drop such packet without passing it to upper layer.
> >
> > Best regards,
>
> Thank you for the report. The patch looks correct to me.
> I'll commit it.

I've committed.

Thanks,
  ozaki-r


Home | Main Index | Thread Index | Old Index