Re: if_tap unaligned access problem

From: John-Mark Gurney (gurney_j_at_resnet.uoregon.edu)
Date: 04/29/05

  • Next message: Maksim Yevmenkin: "Re: if_tap unaligned access problem"
    Date: Fri, 29 Apr 2005 11:28:19 -0700
    To: Maksim Yevmenkin <maksim.yevmenkin@savvis.net>
    
    

    Maksim Yevmenkin wrote this message on Fri, Apr 29, 2005 at 10:51 -0700:
    > [...]
    >
    > >>>>i think we have few options here:
    > >>>>
    > >>>>1) revert back original tapwrite function that was changed in v.
    > >>>>1.48 and set offset to 2 bytes in top mbuf
    > >>>>
    > >>>>2) change current version of tapwrite so it would m_prepend and
    > >>>>m_pullup mbuf after m_uiotombuf
    > >>>>
    > >>>>3) change m_uiotombuf to accept one more parameter - mbuf offset at
    > >>>>which data should be copied. there are not that many users of
    > >>>>m_uiotombuf
    >
    > please find and review the attached patch (untested) that implements
    > option (3) above.
    >
    > >I could try to port the changes netbsd made using m_copyup and
    > >send you the resulting patchfile. IPv4 has already been serviced by
    > >John-Mark Gurney in perforce.
    >
    > having these changes in the tree is a good thing, but it will require
    > more testing. maybe for now we could get away with simpler changes?

    > @@ -1342,12 +1342,15 @@
    > total = min(uio->uio_resid, len);
    > else
    > total = uio->uio_resid;
    > + if (align >= MHLEN)
    > + goto nospace;
    > if (total > MHLEN)

    Shouldn't this check be total + align > MHLEN?

    > m_final = m_getcl(how, MT_DATA, M_PKTHDR);
    > else
    > m_final = m_gethdr(how, MT_DATA);
    > if (m_final == NULL)
    > goto nospace;
    > + m_adj(m_final, align);
    > m_new = m_final;
    > while (progress < total) {
    > length = total - progress;

    -- 
      John-Mark Gurney				Voice: +1 415 225 5579
         "All that I will do, has been done, All that I have, has not."
    _______________________________________________
    freebsd-net@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-net
    To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"
    

  • Next message: Maksim Yevmenkin: "Re: if_tap unaligned access problem"

    Relevant Pages

    • Re: [ofa-general] Further 2.6.23 merge plans...
      ... Write a patch to add P_Key handling to user_mad in the way we ... I'll mostly just be able to review it. ... Any opinions about merging, for or against, would be ... the tree I asked Linus to pull, ...
      (Linux-Kernel)
    • Re: [PATCH] 64bit resources start end value fix
      ... you don't have to apply this patch. ... Just few days back Greg consolidated ... There were few review comments regarding kconfig options. ... Now Greg's tree and your tree are not exact replica when it comes to ...
      (Linux-Kernel)
    • Re: [PATCH 0/9] Kconfig: cleanup s390 v2.
      ... I've added the results of the review to the Kconfig cleanup patches ... be missing in the tree is the patch that disables wireless for s390. ... Heaven knows how many more serious problems are being snuck into the tree ...
      (Linux-Kernel)
    • Re: Giantless VFS.
      ... On Tuesday 23 November 2004 03:38 am, Peter Holm wrote: ... >> I have a patch that I would like people to test and review. ... To unsubscribe, ...
      (freebsd-current)
    • Re: Giantless VFS.
      ... On Tuesday 23 November 2004 03:38 am, Peter Holm wrote: ... >> I have a patch that I would like people to test and review. ... To unsubscribe, ...
      (freebsd-current)