Re: Calculation of IPv6 fragmented part length
Ryota Ozaki <[email protected]>
| Newsgroups | gmane.os.netbsd.devel.network |
|---|---|
| Message-ID | <CAKrYomjrUWgk4fKhNC16GCYYoxf+DFCcrWi07s8nXqY-c6kXhA@mail.gmail.com> |
On Mon, Apr 15, 2024 at 4:01 PM Ryota Ozaki <[email protected]> wrote: > > Hi, > > On Mon, Apr 15, 2024 at 12:24 AM Yasuyuki KOZAKAI > <[email protected]> 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