diff --git a/soft_bfddpd/session.c b/soft_bfddpd/session.c index 78853b4..79cd3c4 100644 --- a/soft_bfddpd/session.c +++ b/soft_bfddpd/session.c @@ -38,7 +38,18 @@ static int bsessions_cmp(const struct bfd_session_data *bsda, const struct bfd_session_data *bsdb) { - return (int)(bsda->bsd_bs->bs_lid - bsdb->bsd_bs->bs_lid); + if (bsda->bsd_bs->bs_lid > bsdb->bsd_bs->bs_lid) + { + return 1; + } + else if(bsda->bsd_bs->bs_lid < bsd->bsd_bs->bs_lid) + { + return -1; + } + else + { + return 0; + } } RBT_HEAD(bsessionst, bfd_session_data) bsessionst;