From e0e4f2d53205201cf09adc663c2301be0762cd25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20T=C3=BCxen?= Date: Fri, 21 Apr 2006 15:48:43 +0000 Subject: From Irene: Fix a bug when searching for an assoc. svn path=/trunk/; revision=17944 --- gtk/sctp_stat.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'gtk/sctp_stat.c') diff --git a/gtk/sctp_stat.c b/gtk/sctp_stat.c index d8dba4a572..bf7b02fcf4 100644 --- a/gtk/sctp_stat.c +++ b/gtk/sctp_stat.c @@ -298,10 +298,10 @@ static gint sctp_assoc_vtag_cmp(gconstpointer aa, gconstpointer bb) const struct _sctp_assoc_info* b = bb; if (a == b) - return(0); + return(FORWARD_STREAM); if (a == NULL || b == NULL) - return(1); + return(ASSOC_NOT_FOUND); /* assoc known*/ if ((a->port1 == b->port1) && @@ -313,12 +313,14 @@ static gint sctp_assoc_vtag_cmp(gconstpointer aa, gconstpointer bb) if ((a->port1 == b->port2) && (a->port2 == b->port1) && - (a->verification_tag1 == b->verification_tag2)) + (a->verification_tag1 == b->verification_tag2) && + (a->verification_tag1 != 0)) return(BACKWARD_STREAM); if ((a->port1 == b->port2) && (a->port2 == b->port1) && - (a->verification_tag2 == b->verification_tag1)) + (a->verification_tag2 == b->verification_tag1) && + (a->verification_tag2 != 0)) return(BACKWARD_STREAM); /*forward stream verifivation tag can be added*/ @@ -584,7 +586,7 @@ static sctp_assoc_info_t * find_assoc(sctp_tmp_info_t * needle) guint8 cmp; assoc_info = &sctp_tapinfo_struct; - if ((list = g_list_first(assoc_info->assoc_info_list))!=NULL) + if ((list = g_list_last(assoc_info->assoc_info_list))!=NULL) { while (list) { @@ -648,7 +650,7 @@ static sctp_assoc_info_t * find_assoc(sctp_tmp_info_t * needle) return info; } - list = g_list_next(list); + list = g_list_previous(list); } } return NULL; -- cgit v1.2.3