Clear csum_flags after reading data from socket buffer. Otherwise,

if ksocket is connected to an interface-type node somewhere later
in the graph (e.g., ng_eiface or ng_iface), the csum_data may be
applied to a wrong packet (if we encapsulate Ethernet or IP).

MFC after:	3 days
This commit is contained in:
Ruslan Ermilov 2006-02-21 13:04:39 +00:00
parent 7bd5296d29
commit aa00bc830f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=155877

View File

@ -1120,6 +1120,7 @@ ng_ksocket_incoming2(node_p node, hook_p hook, void *arg1, int waitflag)
* Also, do not trust that soreceive() will clear m_nextpkt
* for us (e.g. kern/84952, kern/82413).
*/
m->m_pkthdr.csum_flags = 0;
for (n = m, m->m_pkthdr.len = 0; n != NULL; n = n->m_next) {
m->m_pkthdr.len += n->m_len;
n->m_nextpkt = NULL;