[Devel] [ openser-Bugs-1720478 ] Bad Sort lcr records by prefix_len and priority

SourceForge.net noreply at sourceforge.net
Thu May 17 14:31:38 CEST 2007


Bugs item #1720478, was opened at 2007-05-17 07:11
Message generated for change (Comment added) made by juhe
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=743020&aid=1720478&group_id=139143

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: modules
Group: ver 1.2.x
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Angel Carpintero (sackrtp)
Assigned to: Nobody/Anonymous (nobody)
Summary: Bad Sort lcr records by prefix_len and priority

Initial Comment:
I guess that comp_lcrs() function in modules/lcr/lcr_mod.c is not ordering correctly by priority.

if (lcr_record1.priority < lcr_record2.priority) {
   result = 1;
}
else if (lcr_record1.priority == lcr_record2.priority) {
 /* Nothing to do. */
 result = 0;
}

Higher priority should return 1.

So a simple change to fix that issue will be :


if (lcr_record1.priority > lcr_record2.priority) {

* svn diff

 Index: modules/lcr/lcr_mod.c
===================================================================
--- modules/lcr/lcr_mod.c       (revisión: 2220)
+++ modules/lcr/lcr_mod.c       (copia de trabajo)
@@ -592,7 +592,7 @@
        }
        else if (lcr_record1.prefix_len == lcr_record2.prefix_len) {
                /* Sort by priority. */
-               if (lcr_record1.priority < lcr_record2.priority) {
+               if (lcr_record1.priority > lcr_record2.priority) {
                        result = 1;
                }
                else if (lcr_record1.priority == lcr_record2.priority) {

----------------------------------------------------------------------

>Comment By: Juha Heinanen (juhe)
Date: 2007-05-17 15:31

Message:
Logged In: YES 
user_id=1332122
Originator: NO

This part of lcr code was written by Ovidiu Sas.  I'll let him comment on
this ticket.

// Juha


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=743020&aid=1720478&group_id=139143



More information about the Devel mailing list