diff options
author | paul <paul> | 2004-07-17 11:51:29 +0000 |
---|---|---|
committer | paul <paul> | 2004-07-17 11:51:29 +0000 |
commit | 7cb4149aff7f9b82485a05ad825d1fd57d3f512f (patch) | |
tree | 5cf4d50b06959195c9bf1a6642af6f9bf7e54bd4 /lib/if.c | |
parent | a9d03ad13d1ad0bb5a88a31a5d1647eeea60b61e (diff) | |
download | quagga-7cb4149aff7f9b82485a05ad825d1fd57d3f512f.tar.bz2 quagga-7cb4149aff7f9b82485a05ad825d1fd57d3f512f.tar.xz |
2004-07-17 Paul Jakma <paul@dishone.st>
* if.c: (if_cmp_func) Add comment suggested by Greg Troxel.
Diffstat (limited to 'lib/if.c')
-rw-r--r-- | lib/if.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -46,7 +46,14 @@ struct if_master int (*if_delete_hook) (struct interface *); } if_master; -/* Compare interface names */ +/* Compare interface names, returning an integer greater than, equal to, or + * less than 0, (following the strcmp convention), according to the + * relationship between ifp1 and ifp2. Interface names consist of an + * alphabetic prefix and a numeric suffix. The primary sort key is + * lexicographic by name, and then numeric by number. No number sorts + * before all numbers. Examples: de0 < de1, de100 < fxp0 < xl0, devpty < + * devpty0, de0 < del0 + */ int if_cmp_func (struct interface *ifp1, struct interface *ifp2) { @@ -67,6 +74,9 @@ if_cmp_func (struct interface *ifp1, struct interface *ifp2) if (l1 != l2) return (strcmp(p1, p2)); + /* Note that this relies on all numbers being less than all letters, so + * that de0 < del0. + */ res = strncmp(p1, p2, l1); /* names are different -> compare them */ |