PERFORCE change 143797 for review
Rui Paulo
rpaulo at FreeBSD.org
Thu Jun 19 23:59:33 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=143797
Change 143797 by rpaulo at rpaulo_epsilon on 2008/06/19 23:59:29
Fix the CLOSING case.
Affected files ...
.. //depot/projects/soc2008/rpaulo-tcpad/handler.c#11 edit
Differences ...
==== //depot/projects/soc2008/rpaulo-tcpad/handler.c#11 (text+ko) ====
@@ -23,7 +23,7 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- * $P4: //depot/projects/soc2008/rpaulo-tcpad/handler.c#10 $
+ * $P4: //depot/projects/soc2008/rpaulo-tcpad/handler.c#11 $
*/
#include <stdio.h>
@@ -142,14 +142,15 @@
}
if (cp->t_state == TCPS_ESTABLISHED &&
rcp->t_state == TCPS_FIN_WAIT_1) {
- printf("first ack\n");
+ DPRINTF("first ack\n");
cp->t_state = TCPS_CLOSE_WAIT;
rcp->t_state = TCPS_FIN_WAIT_2;
}
if (cp->t_state == TCPS_LAST_ACK ||
cp->t_state == TCPS_CLOSING) {
cp->t_state = TCPS_TIME_WAIT;
- printf("connection down\n");
+ DPRINTF("connection down\n");
+ dumper_error(p, "a.cap", cp->pktshead);
}
} else if ((tcp->th_flags & TH_FLAGS) == (TH_FIN|TH_ACK)) {
if (cp == NULL || rcp == NULL)
@@ -163,11 +164,12 @@
}
if (cp->t_state == TCPS_CLOSE_WAIT &&
rcp->t_state == TCPS_FIN_WAIT_2) {
- printf("last_ack\n");
+ DPRINTF("last_ack\n");
cp->t_state = TCPS_TIME_WAIT;
rcp->t_state = TCPS_LAST_ACK;
}
- if (cp->t_state == TCPS_FIN_WAIT_1) {
+ if (rcp->t_state == TCPS_FIN_WAIT_1) {
+ DPRINTF("closing\n");
cp->t_state = TCPS_CLOSING;
}
} else if ((tcp->th_flags & TH_FLAGS) == (TH_RST|TH_ACK)) {
More information about the p4-projects
mailing list