This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
RE: bug in ip_input.c?
- To: andrew dot lunn at ascom dot ch
- Subject: RE: [ECOS] bug in ip_input.c?
- From: Andreas dot Karlsson at combitechsystems dot com
- Date: Tue, 26 Sep 2000 14:38:30 +0200
- Cc: ecos-discuss at sourceware dot cygnus dot com
Just before entering the reass function m->m_hdr->mh_data and ip have the
same addresses. Then ip gets a new when a new concatened packet is created.
I suppose that the mh_data pointer should be updated to this new address.
But dtom() doesn't make this.
ip = ip_reass(ipqe, fp);
if (ip == 0) {
ipq_unlock();
return;
}
ipstat.ips_reassembled++;
m = dtom(ip);
} else
if (fp)
ip_freef(fp);
ipq_unlock();
} else
ip->ip_len -= hlen;
/*
* Switch out to protocol's input routine.
*/
ipstat.ips_delivered++;
(*inetsw[ip_protox[ip->ip_p]].pr_input)(m, hlen, NULL, 0);
return;
*******************************
When the first packet arrives fp=0 (2:nd argument to ip_reass) to indicate
that this is the first packet of a fragmentated packet. BUT too often this
happens with the second packet too and the program hang.
Its this block (shown below) above that one pasted above that fails, maybe
there is some connection. I'm not running the stack with any hardware just a
dummy-variant that loops around. Its like any other program not in the
sources of eCos.
/*
* Look for queue of fragments
* of this datagram.
*/
ipq_lock();
for (fp = ipq.lh_first; fp != NULL; fp = fp->ipq_q.le_next)
if (ip->ip_id == fp->ipq_id &&
ip->ip_src.s_addr == fp->ipq_src.s_addr &&
ip->ip_dst.s_addr == fp->ipq_dst.s_addr &&
ip->ip_p == fp->ipq_p)
goto found;
fp = 0;
found: