diff options
Diffstat (limited to 'ospf6d')
-rw-r--r-- | ospf6d/ospf6_asbr.c | 5 | ||||
-rw-r--r-- | ospf6d/ospf6_asbr.h | 6 | ||||
-rw-r--r-- | ospf6d/ospf6_interface.c | 2 | ||||
-rw-r--r-- | ospf6d/ospf6_message.c | 2 | ||||
-rw-r--r-- | ospf6d/ospf6_neighbor.h | 2 | ||||
-rw-r--r-- | ospf6d/ospf6_network.c | 6 | ||||
-rw-r--r-- | ospf6d/ospf6_network.h | 6 | ||||
-rw-r--r-- | ospf6d/ospf6_route.h | 2 | ||||
-rw-r--r-- | ospf6d/ospf6_snmp.c | 12 | ||||
-rw-r--r-- | ospf6d/ospf6_spf.c | 8 | ||||
-rw-r--r-- | ospf6d/ospf6_zebra.c | 2 |
11 files changed, 29 insertions, 24 deletions
diff --git a/ospf6d/ospf6_asbr.c b/ospf6d/ospf6_asbr.c index b1620d4a..6eca142d 100644 --- a/ospf6d/ospf6_asbr.c +++ b/ospf6d/ospf6_asbr.c @@ -411,7 +411,7 @@ ospf6_asbr_redistribute_unset (int type) } void -ospf6_asbr_redistribute_add (int type, int ifindex, struct prefix *prefix, +ospf6_asbr_redistribute_add (int type, ifindex_t ifindex, struct prefix *prefix, u_int nexthop_num, struct in6_addr *nexthop) { int ret; @@ -557,7 +557,8 @@ ospf6_asbr_redistribute_add (int type, int ifindex, struct prefix *prefix, } void -ospf6_asbr_redistribute_remove (int type, int ifindex, struct prefix *prefix) +ospf6_asbr_redistribute_remove (int type, ifindex_t ifindex, + struct prefix *prefix) { struct ospf6_route *match; struct ospf6_external_info *info = NULL; diff --git a/ospf6d/ospf6_asbr.h b/ospf6d/ospf6_asbr.h index 73770cc0..f3df90b1 100644 --- a/ospf6d/ospf6_asbr.h +++ b/ospf6d/ospf6_asbr.h @@ -49,7 +49,7 @@ struct ospf6_external_info struct in6_addr forwarding; /* u_int32_t tag; */ - unsigned int ifindex; + ifindex_t ifindex; }; /* AS-External-LSA */ @@ -79,11 +79,11 @@ extern void ospf6_asbr_lsentry_add (struct ospf6_route *asbr_entry); extern void ospf6_asbr_lsentry_remove (struct ospf6_route *asbr_entry); extern int ospf6_asbr_is_asbr (struct ospf6 *o); -extern void ospf6_asbr_redistribute_add (int type, int ifindex, +extern void ospf6_asbr_redistribute_add (int type, ifindex_t ifindex, struct prefix *prefix, u_int nexthop_num, struct in6_addr *nexthop); -extern void ospf6_asbr_redistribute_remove (int type, int ifindex, +extern void ospf6_asbr_redistribute_remove (int type, ifindex_t ifindex, struct prefix *prefix); extern int ospf6_redistribute_config_write (struct vty *vty); diff --git a/ospf6d/ospf6_interface.c b/ospf6d/ospf6_interface.c index c9c90117..26f68ac5 100644 --- a/ospf6d/ospf6_interface.c +++ b/ospf6d/ospf6_interface.c @@ -59,7 +59,7 @@ const char *ospf6_interface_state_str[] = }; struct ospf6_interface * -ospf6_interface_lookup_by_ifindex (int ifindex) +ospf6_interface_lookup_by_ifindex (ifindex_t ifindex) { struct ospf6_interface *oi; struct interface *ifp; diff --git a/ospf6d/ospf6_message.c b/ospf6d/ospf6_message.c index e71b4101..d382f038 100644 --- a/ospf6d/ospf6_message.c +++ b/ospf6d/ospf6_message.c @@ -1515,7 +1515,7 @@ ospf6_receive (struct thread *thread) unsigned int len; char srcname[64], dstname[64]; struct in6_addr src, dst; - unsigned int ifindex; + ifindex_t ifindex; struct iovec iovector[2]; struct ospf6_interface *oi; struct ospf6_header *oh; diff --git a/ospf6d/ospf6_neighbor.h b/ospf6d/ospf6_neighbor.h index 93ffa289..54b7ffe0 100644 --- a/ospf6d/ospf6_neighbor.h +++ b/ospf6d/ospf6_neighbor.h @@ -53,7 +53,7 @@ struct ospf6_neighbor u_int32_t router_id; /* Neighbor Interface ID */ - u_int32_t ifindex; + ifindex_t ifindex; /* Router Priority of this neighbor */ u_char priority; diff --git a/ospf6d/ospf6_network.c b/ospf6d/ospf6_network.c index e0be38b3..a7737502 100644 --- a/ospf6d/ospf6_network.c +++ b/ospf6d/ospf6_network.c @@ -113,7 +113,7 @@ ospf6_serv_sock (void) /* ospf6 set socket option */ void -ospf6_sso (u_int ifindex, struct in6_addr *group, int option) +ospf6_sso (ifindex_t ifindex, struct in6_addr *group, int option) { struct ipv6_mreq mreq6; int ret; @@ -150,7 +150,7 @@ iov_totallen (struct iovec *iov) int ospf6_sendmsg (struct in6_addr *src, struct in6_addr *dst, - unsigned int *ifindex, struct iovec *message) + ifindex_t *ifindex, struct iovec *message) { int retval; struct msghdr smsghdr; @@ -208,7 +208,7 @@ ospf6_sendmsg (struct in6_addr *src, struct in6_addr *dst, int ospf6_recvmsg (struct in6_addr *src, struct in6_addr *dst, - unsigned int *ifindex, struct iovec *message) + ifindex_t *ifindex, struct iovec *message) { int retval; struct msghdr rmsghdr; diff --git a/ospf6d/ospf6_network.h b/ospf6d/ospf6_network.h index 127bf45c..f4b74faa 100644 --- a/ospf6d/ospf6_network.h +++ b/ospf6d/ospf6_network.h @@ -29,12 +29,12 @@ extern struct in6_addr allspfrouters6; extern struct in6_addr alldrouters6; extern int ospf6_serv_sock (void); -extern void ospf6_sso (u_int ifindex, struct in6_addr *group, int option); +extern void ospf6_sso (ifindex_t ifindex, struct in6_addr *group, int option); extern int ospf6_sendmsg (struct in6_addr *, struct in6_addr *, - unsigned int *, struct iovec *); + ifindex_t *, struct iovec *); extern int ospf6_recvmsg (struct in6_addr *, struct in6_addr *, - unsigned int *, struct iovec *); + ifindex_t *, struct iovec *); #endif /* OSPF6_NETWORK_H */ diff --git a/ospf6d/ospf6_route.h b/ospf6d/ospf6_route.h index 42eb69ea..2fb2c1d7 100644 --- a/ospf6d/ospf6_route.h +++ b/ospf6d/ospf6_route.h @@ -41,7 +41,7 @@ extern unsigned char conf_debug_ospf6_route; struct ospf6_nexthop { /* Interface index */ - unsigned int ifindex; + ifindex_t ifindex; /* IP address, if any */ struct in6_addr address; diff --git a/ospf6d/ospf6_snmp.c b/ospf6d/ospf6_snmp.c index 307d420e..266031e7 100644 --- a/ospf6d/ospf6_snmp.c +++ b/ospf6d/ospf6_snmp.c @@ -623,7 +623,7 @@ ospfv3WwLsdbEntry (struct variable *v, oid *name, size_t *length, int exact, size_t *var_len, WriteMethod **write_method) { struct ospf6_lsa *lsa = NULL; - u_int32_t ifindex, area_id, id, instid, adv_router; + ifindex_t ifindex, area_id, id, instid, adv_router; u_int16_t type; int len; oid *offset; @@ -835,7 +835,8 @@ static u_char * ospfv3IfEntry (struct variable *v, oid *name, size_t *length, int exact, size_t *var_len, WriteMethod **write_method) { - unsigned int ifindex, instid; + ifindex_t ifindex = 0; + unsigned int instid = 0; struct ospf6_interface *oi = NULL; struct ospf6_lsa *lsa = NULL; struct interface *iif; @@ -849,8 +850,6 @@ ospfv3IfEntry (struct variable *v, oid *name, size_t *length, == MATCH_FAILED) return NULL; - ifindex = instid = 0; - /* Check OSPFv3 instance. */ if (ospf6 == NULL) return NULL; @@ -988,7 +987,8 @@ static u_char * ospfv3NbrEntry (struct variable *v, oid *name, size_t *length, int exact, size_t *var_len, WriteMethod **write_method) { - unsigned int ifindex, instid, rtrid; + ifindex_t ifindex = 0; + unsigned int instid, rtrid; struct ospf6_interface *oi = NULL; struct ospf6_neighbor *on = NULL; struct interface *iif; @@ -1001,7 +1001,7 @@ ospfv3NbrEntry (struct variable *v, oid *name, size_t *length, == MATCH_FAILED) return NULL; - ifindex = instid = rtrid = 0; + instid = rtrid = 0; /* Check OSPFv3 instance. */ if (ospf6 == NULL) diff --git a/ospf6d/ospf6_spf.c b/ospf6d/ospf6_spf.c index 88e12853..858398eb 100644 --- a/ospf6d/ospf6_spf.c +++ b/ospf6d/ospf6_spf.c @@ -225,7 +225,8 @@ static void ospf6_nexthop_calc (struct ospf6_vertex *w, struct ospf6_vertex *v, caddr_t lsdesc) { - int i, ifindex; + int i; + ifindex_t ifindex; struct ospf6_interface *oi; u_int16_t type; u_int32_t adv_router; @@ -235,7 +236,10 @@ ospf6_nexthop_calc (struct ospf6_vertex *w, struct ospf6_vertex *v, assert (VERTEX_IS_TYPE (ROUTER, w)); ifindex = (VERTEX_IS_TYPE (NETWORK, v) ? v->nexthop[0].ifindex : - ROUTER_LSDESC_GET_IFID (lsdesc)); + /* v is the local router & the interface_id is a local ifindex */ + (ifindex_t) ROUTER_LSDESC_GET_IFID (lsdesc)); + assert (ifindex >= 0); + oi = ospf6_interface_lookup_by_ifindex (ifindex); if (oi == NULL) { diff --git a/ospf6d/ospf6_zebra.c b/ospf6d/ospf6_zebra.c index d37e5089..30b6fc6f 100644 --- a/ospf6d/ospf6_zebra.c +++ b/ospf6d/ospf6_zebra.c @@ -368,7 +368,7 @@ ospf6_zebra_route_update (int type, struct ospf6_route *request) char buf[64]; int nhcount; struct in6_addr **nexthops; - unsigned int *ifindexes; + ifindex_t *ifindexes; int i, ret = 0; struct prefix_ipv6 *dest; |