This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
maybe a flaw in tcp_output() in ecos
- From: 张 亮 <johnsonest at hotmail dot com>
- To: ecos-discuss at sources dot redhat dot com
- Date: Wed, 26 Feb 2003 16:54:52 +0800
- Subject: [ECOS] maybe a flaw in tcp_output() in ecos
- Bcc:
Hi,
I feel another strange point(maybe a flaw) in tcp_output() function:
when we send a SYN message with MSS option,we will call tcp_mss()to
calculate mss of this connection,in this function,tp->maxopt will be set as
ifp->mtu-sizeof(struct tcpiphdr):(in tcp_input.c and tcp_mss())
mss = rt->rt_rmx.rmx_mtu - sizeof(struct tcpiphdr);
....
tp->t_maxopd = mss;
after call of tcp_mss(),and in tcp_output(),we will calculate length of
data which will be sent like this:
if (len > tp->t_maxopd - optlen) {
len = tp->t_maxopd - optlen;
...
the FLAW is that:
if in ip_output(),we insert IP options into packet,whole
packet length will larger than MTU of selected interface,so fragment will
be needed in IP layer in itself host,but as we know,tcp always trys to
avoid frangmenting!
I am afraid that it's a flaw,maybe two familar functions should be writen
to meet tcp_output() and tcp_input(),right?
BRS/johnsonest
_________________________________________________________________
与联机的朋友进行交流,请使用 MSN Messenger: http://messenger.msn.com/cn
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss