Date: Tue, 30 Jan 2007 01:18:33 GMT From: Paolo Pisati <piso@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 113684 for review Message-ID: <200701300118.l0U1IX16086621@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=113684 Change 113684 by piso@piso_newluxor on 2007/01/30 01:17:55 Remove another usage of ip_next(): pass down the tcp seq field, and avoid to use ptrs to the ip and tcp headers in GetDeltaSeqOut(). Affected files ... .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias.c#38 edit .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_db.c#20 edit .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_ftp.c#14 edit .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_irc.c#15 edit .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_local.h#15 edit .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_proxy.c#16 edit .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_smedia.c#15 edit Differences ... ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias.c#38 (text+ko) ==== @@ -1055,7 +1055,7 @@ if (GetAckModified(lnk) == 1) { int delta; - delta = GetDeltaSeqOut(pip, lnk); + delta = GetDeltaSeqOut(lnk, tc->th_seq); if (delta != 0) { accumulate += twowords(&tc->th_seq); tc->th_seq = htonl(ntohl(tc->th_seq) + delta); ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_db.c#20 (text+ko) ==== @@ -2046,7 +2046,7 @@ int -GetDeltaSeqOut(struct ip *pip, struct alias_link *lnk) +GetDeltaSeqOut(struct alias_link *lnk, u_long seq) { /* Find out how much the sequence number has been altered for an outgoing @@ -2055,12 +2055,7 @@ */ int i; - struct tcphdr *tc; int delta, seq_diff_min; - u_long seq; - - tc = ip_next(pip); - seq = tc->th_seq; delta = 0; seq_diff_min = -1; ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_ftp.c#14 (text+ko) ==== @@ -733,7 +733,7 @@ int delta; SetAckModified(lnk); - delta = GetDeltaSeqOut(pip, lnk); + delta = GetDeltaSeqOut(lnk, tc->th_seq); AddSeq(pip, lnk, delta + slen - dlen); } ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_irc.c#15 (text+ko) ==== @@ -431,7 +431,7 @@ int delta; SetAckModified(lnk); - delta = GetDeltaSeqOut(pip, lnk); + delta = GetDeltaSeqOut(lnk, tc->th_seq); AddSeq(pip, lnk, delta + copyat + iCopy - dlen); } ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_local.h#15 (text+ko) ==== @@ -299,7 +299,7 @@ void SetAckModified(struct alias_link *_lnk); int GetAckModified(struct alias_link *_lnk); int GetDeltaAckIn(struct alias_link *_lnk, u_long ack); -int GetDeltaSeqOut(struct ip *_pip, struct alias_link *_lnk); +int GetDeltaSeqOut(struct alias_link *_lnk, u_long seq); void AddSeq (struct ip *_pip, struct alias_link *_lnk, int _delta); void SetExpire (struct alias_link *_lnk, int _expire); void ClearCheckNewLink(struct libalias *la); ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_proxy.c#16 (text+ko) ==== @@ -453,7 +453,7 @@ int delta; SetAckModified(lnk); - delta = GetDeltaSeqOut(pip, lnk); + delta = GetDeltaSeqOut(lnk, tc->th_seq); AddSeq(pip, lnk, delta + slen); } ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_smedia.c#15 (text+ko) ==== @@ -404,7 +404,7 @@ memcpy(data, newdata, new_dlen); SetAckModified(lnk); - delta = GetDeltaSeqOut(pip, lnk); + delta = GetDeltaSeqOut(lnk, tc->th_seq); AddSeq(pip, lnk, delta + new_dlen - dlen); new_len = htons(hlen + new_dlen);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200701300118.l0U1IX16086621>