DragonFly BSD
DragonFly commits List (threaded) for 2010-09
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: git: kernel - network protocol thread routing


From: Sepherosa Ziehau <sepherosa@xxxxxxxxx>
Date: Thu, 9 Sep 2010 16:54:17 +0800

On Thu, Sep 9, 2010 at 4:35 PM, Matthew Dillon
<dillon@crater.dragonflybsd.org> wrote:
>
> commit 6a704092ee2b3384906df96bf4b66575a12f38e2
> Author: Matthew Dillon <dillon@apollo.backplane.com>
> Date:   Thu Sep 9 01:32:07 2010 -0700
>
>    kernel - network protocol thread routing
>
>    * ip_input() now calls ip_mport() unconditionally and physically compares
>      the port to &curthread->td_msgport.  If they do not match the packet
>      will be forwarded to the correct protocol thread.
>

@@ -610,7 +625,6 @@ iphack:
                return;
        }
        if (m->m_pkthdr.fw_flags & FW_MBUF_REDISPATCH) {
-               needredispatch = TRUE;
                m->m_pkthdr.fw_flags &= ~FW_MBUF_REDISPATCH;
        }
 pass:
@@ -866,8 +880,6 @@ ours:

                /* Get the header length of the reassembled packet */
                hlen = IP_VHL_HL(ip->ip_vhl) << 2;
-
-               needredispatch = TRUE;
        } else {
                ip->ip_len -= hlen;
        }

I think we still need the 'needredispatch' flag.  e.g. after ip defrag
(fragments are default to netisr0) and NAT.

Following code probably should be put before (port != &curthread->td_msgport):

if (needredispatch) {
    ip->ip_off = htons(ip->ip_off);
    ip->ip_len = htons(ip->ip_len + hlen);

    port = ip_mport_in(&m);
    if (port == NULL)
        return;

    ip = mtod(m, struct ip *);
    ip->ip_len = ntohs(ip->ip_len) - hlen;
    ip->ip_off = ntohs(ip->ip_off);
}

if (port != &curthread->td_msgport) {
    ...
}

Best Regards,
sephe

-- 
Live Free or Die




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