bug-hurd
[Top][All Lists]
Advanced

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

Re: [PATCH] About the bug that makes pfinet crash


From: Thomas Schwinge
Subject: Re: [PATCH] About the bug that makes pfinet crash
Date: Mon, 24 Nov 2008 11:43:58 +0100
User-agent: Mutt/1.5.11

Hello!

On Mon, Nov 24, 2008 at 12:06:07AM +0100, Samuel Thibault wrote:
> Thomas Schwinge, le Sat 22 Nov 2008 22:54:21 +0100, a écrit :
> > > believing
> > > that the IP stack wouldn't overcome the typical 1500B MTU anyway.
> > 
> > It will, because you told it can do so, allowing for a PAGE_SIZE MTU.
> > But: The MTU is defined to be without the ethernet headers, thus pfinet
> > can create ethernet frames that are bigger than a page.
> 
> Ah, ok.

And of course that problem only appeared when sending packets between
domUs / dom0 running on the same dom0, connected over a virtual bridge in
the dom0, as otherwise the path MTU discovery would have lowered the MTU
to the typical value you gave above anyway, and thus hiding the problem.

> > -           ifp->if_mtu = PAGE_SIZE;
> >             ifp->if_header_size = 14;
> >             ifp->if_header_format = HDR_ETHERNET;
> > +           /* Set to the maximum that we can handle in device_write.  */
> > +           ifp->if_mtu = PAGE_SIZE - ifp->if_header_size;
> 
> That's fine yes.

Committed.


> > -   if (count == 0 || count > PAGE_SIZE)
> > +   if (count < ifp->if_header_size ||
> > +       count > ifp->if_header_size + ifp->if_mtu)
> >             return D_INVALID_SIZE;
> >  
> >     assert(copy->type == VM_MAP_COPY_PAGE_LIST);
> 
> Mmm, the < should be fine, but I'd rather see the > still use PAGE_SIZE,
> or perhaps replace these PAGE_SIZE occurrences with a macro defed to
> PAGE_SIZE.

Or what about installing my change as given above, but also adding an
``assert (ifp->if_header_size + ifp->if_mtu <= PAGE_SIZE)''?  Just
another idea; you decide.


Regards,
 Thomas

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]