diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-09-25 08:41:33 -0400 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-09-25 08:41:33 -0400 |
| commit | fd289fc83e15a64a6c97aa2fc21168c21b0d40ee (patch) | |
| tree | 9ff047972c00f63ed21738167e85dae70e6ab477 | |
| parent | 25715c7e50a9fe62370694a5c0f74cc6026d0b75 (diff) | |
zebra: Make admin distance a uint8_t
While u_char is technically a uint8_t in size I would
like to treat and think about the admin distance
as an actual integer value from 0-255, instead
of a char.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
| -rw-r--r-- | zebra/rib.h | 6 | ||||
| -rw-r--r-- | zebra/zebra_rib.c | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/zebra/rib.h b/zebra/rib.h index 4cc69377d8..88f6b3094d 100644 --- a/zebra/rib.h +++ b/zebra/rib.h @@ -71,7 +71,7 @@ struct route_entry { u_int32_t nexthop_mtu; /* Distance. */ - u_char distance; + uint8_t distance; /* Flags of this route. * This flag's definition is in lib/zebra.h ZEBRA_FLAG_* and is exposed @@ -294,7 +294,7 @@ extern int rib_add(afi_t afi, safi_t safi, vrf_id_t vrf_id, int type, u_short instance, int flags, struct prefix *p, struct prefix_ipv6 *src_p, const struct nexthop *nh, u_int32_t table_id, u_int32_t metric, u_int32_t mtu, - u_char distance); + uint8_t distance); extern int rib_add_multipath(afi_t afi, safi_t safi, struct prefix *, struct prefix_ipv6 *src_p, struct route_entry *); @@ -328,7 +328,7 @@ extern void rib_unlink(struct route_node *, struct route_entry *); extern int rib_gc_dest(struct route_node *rn); extern struct route_table *rib_tables_iter_next(rib_tables_iter_t *iter); -extern u_char route_distance(int type); +extern uint8_t route_distance(int type); /* * Inline functions. diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index bb49663319..0279c321a0 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -129,9 +129,9 @@ _rnode_zlog(const char *_func, vrf_id_t vrf_id, struct route_node *rn, #define rnode_info(node, ...) \ _rnode_zlog(__func__, vrf_id, node, LOG_INFO, __VA_ARGS__) -u_char route_distance(int type) +uint8_t route_distance(int type) { - u_char distance; + uint8_t distance; if ((unsigned)type >= array_size(route_info)) distance = 150; @@ -2434,7 +2434,7 @@ void rib_delete(afi_t afi, safi_t safi, vrf_id_t vrf_id, int type, int rib_add(afi_t afi, safi_t safi, vrf_id_t vrf_id, int type, u_short instance, int flags, struct prefix *p, struct prefix_ipv6 *src_p, const struct nexthop *nh, u_int32_t table_id, u_int32_t metric, - u_int32_t mtu, u_char distance) + u_int32_t mtu, uint8_t distance) { struct route_entry *re; struct route_entry *same = NULL; |
