aboutsummaryrefslogtreecommitdiffstats
path: root/gtk
diff options
context:
space:
mode:
authorMichael Tüxen <tuexen@fh-muenster.de>2006-04-21 15:48:43 +0000
committerMichael Tüxen <tuexen@fh-muenster.de>2006-04-21 15:48:43 +0000
commite0e4f2d53205201cf09adc663c2301be0762cd25 (patch)
treefe55162224f07babb29d5ffb82dab38232bc0343 /gtk
parent65ab879c00b3529c720cd92803592b89f777cbd2 (diff)
From Irene: Fix a bug when searching for an assoc.
svn path=/trunk/; revision=17944
Diffstat (limited to 'gtk')
-rw-r--r--gtk/sctp_stat.c14
1 files changed, 8 insertions, 6 deletions
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;