summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorpaul <paul>2004-07-09 12:24:42 +0000
committerpaul <paul>2004-07-09 12:24:42 +0000
commitb06c14f2e7cac5a2170f9d64182a99dbbc413674 (patch)
treee162fe01afcd24250a24d83f96e025eb76f7877b /lib
parentf5ba387492ec163f1200d949a984f12ef88538ba (diff)
2004-07-09 Juris Kalnins <juris@mt.lv>
* if.c: (if_cmp_func) fix for interface names where name is same, but one has no number, eg "devtyp" and "devtyp0".
Diffstat (limited to 'lib')
-rw-r--r--lib/ChangeLog5
-rw-r--r--lib/if.c6
2 files changed, 10 insertions, 1 deletions
diff --git a/lib/ChangeLog b/lib/ChangeLog
index 8cd79e36..4ec441ae 100644
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -1,3 +1,8 @@
+2004-07-09 Juris Kalnins <juris@mt.lv>
+
+ * if.c: (if_cmp_func) fix for interface names where name is same,
+ but one has no number, eg "devtyp" and "devtyp0".
+
2004-06-30 Greg Troxel <gdt@poblano.ir.bbn.com>
* Makefile.am: Make libzebra shared.
diff --git a/lib/if.c b/lib/if.c
index ff5ec50a..2e36eff3 100644
--- a/lib/if.c
+++ b/lib/if.c
@@ -74,10 +74,14 @@ if_cmp_func (struct interface *ifp1, struct interface *ifp2)
return res;
/* with identical name part, go to numeric part */
-
p1 += l1;
p2 += l1;
+ if (!*p1)
+ return -1;
+ if (!*p2)
+ return 1;
+
x1 = strtol(p1, &p1, 10);
x2 = strtol(p2, &p2, 10);