Re: git: kernel - network protocol thread routing
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
>
> ꀠ溆ernel - network protocol thread routing
>
> ꀠꀪ ip_input() now calls ip_mport() unconditionally and physically compares
> ꀠꀠ濳he port to &curthread->td_msgport. 啱f they do not match the packet
> ꀠꀠ烀ill 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
討論串 (同標題文章)
完整討論串 (本文為第 2 之 3 篇):