diff options
-rw-r--r-- | zebra/connected.c | 24 | ||||
-rw-r--r-- | zebra/if_netlink.c | 3 | ||||
-rw-r--r-- | zebra/if_proc.c | 2 | ||||
-rw-r--r-- | zebra/irdp_interface.c | 3 | ||||
-rw-r--r-- | zebra/misc_null.c | 2 | ||||
-rw-r--r-- | zebra/redistribute.c | 4 | ||||
-rw-r--r-- | zebra/rib.h | 2 | ||||
-rw-r--r-- | zebra/router-id.c | 30 | ||||
-rw-r--r-- | zebra/rt_netlink.c | 4 | ||||
-rw-r--r-- | zebra/rt_netlink.h | 6 | ||||
-rw-r--r-- | zebra/rtadv.c | 2 | ||||
-rw-r--r-- | zebra/rtread_netlink.c | 3 | ||||
-rw-r--r-- | zebra/zebra_ptm.c | 18 | ||||
-rw-r--r-- | zebra/zebra_rib.c | 4 | ||||
-rw-r--r-- | zebra/zebra_routemap.c | 8 | ||||
-rw-r--r-- | zebra/zebra_vty.c | 4 | ||||
-rw-r--r-- | zebra/zserv.c | 5 | ||||
-rw-r--r-- | zebra/zserv.h | 3 |
18 files changed, 63 insertions, 64 deletions
diff --git a/zebra/connected.c b/zebra/connected.c index 0c9221da4..b891f9e56 100644 --- a/zebra/connected.c +++ b/zebra/connected.c @@ -80,18 +80,18 @@ connected_announce (struct interface *ifp, struct connected *ifc) if (ifc->address->family == AF_INET) { - if (ifc->anchor = if_anchor_lookup_by_address(ifc->address->u.prefix4)) - { - /* found an anchor, so I'm unnumbered */ - SET_FLAG (ifc->flags, ZEBRA_IFA_UNNUMBERED); - listnode_add (ifc->anchor->unnumbered, ifc); - } - else - { - /* I'm numbered */ - UNSET_FLAG (ifc->flags, ZEBRA_IFA_UNNUMBERED); - ifc->unnumbered = list_new(); - } + if ((ifc->anchor = if_anchor_lookup_by_address(ifc->address->u.prefix4))) + { + /* found an anchor, so I'm unnumbered */ + SET_FLAG (ifc->flags, ZEBRA_IFA_UNNUMBERED); + listnode_add (ifc->anchor->unnumbered, ifc); + } + else + { + /* I'm numbered */ + UNSET_FLAG (ifc->flags, ZEBRA_IFA_UNNUMBERED); + ifc->unnumbered = list_new(); + } } listnode_add (ifp->connected, ifc); diff --git a/zebra/if_netlink.c b/zebra/if_netlink.c index 86bd8ffe4..2016986cb 100644 --- a/zebra/if_netlink.c +++ b/zebra/if_netlink.c @@ -23,8 +23,7 @@ #include <zebra.h> #include "zebra/zserv.h" - -extern int interface_lookup_netlink (void); +#include "zebra/rt_netlink.h" /* Interface information read by netlink. */ void diff --git a/zebra/if_proc.c b/zebra/if_proc.c index 2dbc47261..eab511c84 100644 --- a/zebra/if_proc.c +++ b/zebra/if_proc.c @@ -123,7 +123,7 @@ ifstat_dev_fields (int version, char *buf, struct interface *ifp) } /* Update interface's statistics. */ -void +static void ifstat_update_proc (void) { FILE *fp; diff --git a/zebra/irdp_interface.c b/zebra/irdp_interface.c index 6403830b9..43c63a83f 100644 --- a/zebra/irdp_interface.c +++ b/zebra/irdp_interface.c @@ -638,7 +638,6 @@ DEFUN (no_ip_irdp_address_preference, { struct listnode *node, *nnode; struct in_addr ip; - int pref; int ret; struct interface *ifp; struct zebra_if *zi; @@ -657,8 +656,6 @@ DEFUN (no_ip_irdp_address_preference, if (!ret) return CMD_WARNING; - pref = atoi(argv[1]); - for (ALL_LIST_ELEMENTS (irdp->AdvPrefList, node, nnode, adv)) { if(adv->ip.s_addr == ip.s_addr ) diff --git a/zebra/misc_null.c b/zebra/misc_null.c index 06807267e..6cdfb0f54 100644 --- a/zebra/misc_null.c +++ b/zebra/misc_null.c @@ -6,7 +6,7 @@ #include "zebra/interface.h" #include "zebra/zebra_fpm.h" -void ifstat_update_proc (void) { return; } +static void ifstat_update_proc (void) { return; } #ifdef HAVE_SYS_WEAK_ALIAS_PRAGMA #pragma weak rtadv_config_write = ifstat_update_proc #pragma weak irdp_config_write = ifstat_update_proc diff --git a/zebra/redistribute.c b/zebra/redistribute.c index 2ee5da5d9..843f5ad4b 100644 --- a/zebra/redistribute.c +++ b/zebra/redistribute.c @@ -626,8 +626,8 @@ zebra_import_table (afi_t afi, u_int32_t table_id, u_int32_t distance, int add) if (!rib) continue; - if ((afi == AFI_IP) && (rn->p.family == AF_INET) || - (afi == AFI_IP6) && (rn->p.family == AF_INET6)) + if (((afi == AFI_IP) && (rn->p.family == AF_INET)) || + ((afi == AFI_IP6) && (rn->p.family == AF_INET6))) { if (add) zebra_add_import_table_entry (rn, rib); diff --git a/zebra/rib.h b/zebra/rib.h index 038fe4475..a05bd8c19 100644 --- a/zebra/rib.h +++ b/zebra/rib.h @@ -53,7 +53,7 @@ struct rib u_short instance; /* Which routing table */ - int table; + uint32_t table; /* Metric */ u_int32_t metric; diff --git a/zebra/router-id.c b/zebra/router-id.c index b738027ec..ae52b5ea6 100644 --- a/zebra/router-id.c +++ b/zebra/router-id.c @@ -41,8 +41,10 @@ #include "zebra/router-id.h" #include "zebra/redistribute.h" -static struct list rid_all_sorted_list; -static struct list rid_lo_sorted_list; +static struct list _rid_all_sorted_list; +static struct list _rid_lo_sorted_list; +static struct list *rid_all_sorted_list = &_rid_all_sorted_list; +static struct list *rid_lo_sorted_list = &_rid_lo_sorted_list; static struct prefix rid_user_assigned; /* master zebra server structure */ @@ -86,15 +88,15 @@ router_id_get (struct prefix *p) if (rid_user_assigned.u.prefix4.s_addr) p->u.prefix4.s_addr = rid_user_assigned.u.prefix4.s_addr; - else if (!list_isempty (&rid_lo_sorted_list)) + else if (!list_isempty (rid_lo_sorted_list)) { - node = listtail (&rid_lo_sorted_list); + node = listtail (rid_lo_sorted_list); c = listgetdata (node); p->u.prefix4.s_addr = c->address->u.prefix4.s_addr; } - else if (!list_isempty (&rid_all_sorted_list)) + else if (!list_isempty (rid_all_sorted_list)) { - node = listtail (&rid_all_sorted_list); + node = listtail (rid_all_sorted_list); c = listgetdata (node); p->u.prefix4.s_addr = c->address->u.prefix4.s_addr; } @@ -131,9 +133,9 @@ router_id_add_address (struct connected *ifc) if (!strncmp (ifc->ifp->name, "lo", 2) || !strncmp (ifc->ifp->name, "dummy", 5)) - l = &rid_lo_sorted_list; + l = rid_lo_sorted_list; else - l = &rid_all_sorted_list; + l = rid_all_sorted_list; if (!router_id_find_node (l, ifc)) listnode_add_sort (l, ifc); @@ -164,9 +166,9 @@ router_id_del_address (struct connected *ifc) if (!strncmp (ifc->ifp->name, "lo", 2) || !strncmp (ifc->ifp->name, "dummy", 5)) - l = &rid_lo_sorted_list; + l = rid_lo_sorted_list; else - l = &rid_all_sorted_list; + l = rid_all_sorted_list; if ((c = router_id_find_node (l, ifc))) listnode_delete (l, c); @@ -240,12 +242,12 @@ router_id_init (void) install_element (CONFIG_NODE, &router_id_cmd); install_element (CONFIG_NODE, &no_router_id_cmd); - memset (&rid_all_sorted_list, 0, sizeof (rid_all_sorted_list)); - memset (&rid_lo_sorted_list, 0, sizeof (rid_lo_sorted_list)); + memset (rid_all_sorted_list, 0, sizeof (rid_all_sorted_list)); + memset (rid_lo_sorted_list, 0, sizeof (rid_lo_sorted_list)); memset (&rid_user_assigned, 0, sizeof (rid_user_assigned)); - rid_all_sorted_list.cmp = router_id_cmp; - rid_lo_sorted_list.cmp = router_id_cmp; + rid_all_sorted_list->cmp = router_id_cmp; + rid_lo_sorted_list->cmp = router_id_cmp; rid_user_assigned.family = AF_INET; rid_user_assigned.prefixlen = 32; diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c index 3410e4e1e..0de024ce1 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@ -1247,7 +1247,7 @@ netlink_route_read (void) /* Utility function comes from iproute2. Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> */ int -addattr_l (struct nlmsghdr *n, int maxlen, int type, void *data, int alen) +addattr_l (struct nlmsghdr *n, unsigned int maxlen, int type, void *data, int alen) { int len; struct rtattr *rta; @@ -1289,7 +1289,7 @@ rta_addattr_l (struct rtattr *rta, int maxlen, int type, void *data, int alen) /* Utility function comes from iproute2. Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> */ int -addattr32 (struct nlmsghdr *n, int maxlen, int type, int data) +addattr32 (struct nlmsghdr *n, unsigned int maxlen, int type, int data) { int len; struct rtattr *rta; diff --git a/zebra/rt_netlink.h b/zebra/rt_netlink.h index 2a4ce0161..14e811db3 100644 --- a/zebra/rt_netlink.h +++ b/zebra/rt_netlink.h @@ -28,9 +28,9 @@ #define NL_DEFAULT_ROUTE_METRIC 20 extern int -addattr32 (struct nlmsghdr *n, int maxlen, int type, int data); +addattr32 (struct nlmsghdr *n, unsigned int maxlen, int type, int data); extern int -addattr_l (struct nlmsghdr *n, int maxlen, int type, void *data, int alen); +addattr_l (struct nlmsghdr *n, unsigned int maxlen, int type, void *data, int alen); extern int rta_addattr_l (struct rtattr *rta, int maxlen, int type, void *data, int alen); @@ -41,6 +41,8 @@ nl_msg_type_to_str (uint16_t msg_type); extern const char * nl_rtproto_to_str (u_char rtproto); +extern int netlink_route_read(void); +extern int interface_lookup_netlink(void); #endif /* HAVE_NETLINK */ diff --git a/zebra/rtadv.c b/zebra/rtadv.c index 766a2184b..67f6ddb4e 100644 --- a/zebra/rtadv.c +++ b/zebra/rtadv.c @@ -493,7 +493,7 @@ rtadv_process_advert (u_char *msg, unsigned int len, struct interface *ifp, } if ((radvert->nd_ra_retransmit && zif->rtadv.AdvRetransTimer) && - (ntohl(radvert->nd_ra_retransmit) != zif->rtadv.AdvRetransTimer)) + (ntohl(radvert->nd_ra_retransmit) != (unsigned int)zif->rtadv.AdvRetransTimer)) { zlog_warn("our AdvRetransTimer on %s doesn't agree with %s", ifp->name, addr_str); diff --git a/zebra/rtread_netlink.c b/zebra/rtread_netlink.c index 066e84433..09191d517 100644 --- a/zebra/rtread_netlink.c +++ b/zebra/rtread_netlink.c @@ -23,8 +23,7 @@ #include <zebra.h> #include "zebra/zserv.h" - -extern void netlink_route_read (void); +#include "zebra/rt_netlink.h" void route_read (void) { diff --git a/zebra/zebra_ptm.c b/zebra/zebra_ptm.c index 176e3e4dd..fc0a2d43f 100644 --- a/zebra/zebra_ptm.c +++ b/zebra/zebra_ptm.c @@ -34,13 +34,13 @@ #define PTM_MSG_LEN 4 #define PTM_HEADER_LEN 37 -char *ZEBRA_PTM_GET_STATUS_CMD = "get-status"; -char *ZEBRA_PTM_PORT_STR = "port"; -char *ZEBRA_PTM_CBL_STR = "cbl status"; -char *ZEBRA_PTM_PASS_STR = "pass"; -char *ZEBRA_PTM_FAIL_STR = "fail"; -char *ZEBRA_PTM_BFDSTATUS_STR = "BFD status"; -char *ZEBRA_PTM_BFDDEST_STR = "BFD peer"; +const char *ZEBRA_PTM_GET_STATUS_CMD = "get-status"; +const char *ZEBRA_PTM_PORT_STR = "port"; +const char *ZEBRA_PTM_CBL_STR = "cbl status"; +const char *ZEBRA_PTM_PASS_STR = "pass"; +const char *ZEBRA_PTM_FAIL_STR = "fail"; +const char *ZEBRA_PTM_BFDSTATUS_STR = "BFD status"; +const char *ZEBRA_PTM_BFDDEST_STR = "BFD peer"; extern struct zebra_t zebrad; int ptm_enable; @@ -204,7 +204,7 @@ zebra_ptm_install_commands (void) } static char * -zebra_ptm_find_key(char *key_arg, char *arg, int arglen) +zebra_ptm_find_key(const char *key_arg, char *arg, int arglen) { char buf[ZEBRA_PTM_MAX_SOCKBUF]; char *data, *hdr, *key, *val; @@ -287,7 +287,7 @@ zebra_ptm_handle_bfd_msg(char *buf, int buflen) if (!strcmp (bfdst_str, ZEBRA_PTM_FAIL_STR)) { if (ifp->ptm_enable && if_is_no_ptm_operative (ifp)) { if (inet_pton(AF_INET, dest_str, &dest_addr) <= 0) { - zlog_err("%s: Peer addr not found\n", __func__, + zlog_err("%s: Peer addr(%s) not found\n", __func__, dest_str); return; } diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index f1a44fdda..3886e220b 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -228,7 +228,7 @@ is_zebra_main_routing_table(u_int32_t table_id) } /* Add nexthop to the end of a nexthop list. */ -void +static void _nexthop_add (struct nexthop **target, struct nexthop *nexthop) { struct nexthop *last; @@ -3132,7 +3132,7 @@ rib_add_ipv6_multipath (struct prefix_ipv6 *p, struct rib *rib, safi_t safi, struct rib *same = NULL; struct nexthop *nexthop; int ret = 0; - int table_id = 0; + unsigned int table_id = 0; if (rib) table_id = rib->table; diff --git a/zebra/zebra_routemap.c b/zebra/zebra_routemap.c index 8ac08960a..ec8ee45cd 100644 --- a/zebra/zebra_routemap.c +++ b/zebra/zebra_routemap.c @@ -87,7 +87,7 @@ zebra_route_match_delete (struct vty *vty, struct route_map_index *index, route_map_event_t type) { int ret; - char *dep_name = (char *)arg; + char *dep_name = NULL; const char *tmpstr; char *rmap_name = NULL; @@ -99,6 +99,10 @@ zebra_route_match_delete (struct vty *vty, struct route_map_index *index, if ((tmpstr = route_map_get_match_arg(index, command)) != NULL) dep_name = XSTRDUP(MTYPE_ROUTE_MAP_RULE, tmpstr); } + else + { + dep_name = XSTRDUP(MTYPE_ROUTE_MAP_RULE, arg); + } rmap_name = XSTRDUP(MTYPE_ROUTE_MAP_NAME, index->map->name); } @@ -119,7 +123,7 @@ zebra_route_match_delete (struct vty *vty, struct route_map_index *index, if (type != RMAP_EVENT_MATCH_DELETED && dep_name) route_map_upd8_dependency(type, dep_name, rmap_name); - if (arg == NULL && dep_name) + if (dep_name) XFREE(MTYPE_ROUTE_MAP_RULE, dep_name); if (rmap_name) XFREE(MTYPE_ROUTE_MAP_NAME, rmap_name); diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c index ab6e5ec7b..a36f8600b 100644 --- a/zebra/zebra_vty.c +++ b/zebra/zebra_vty.c @@ -1289,8 +1289,7 @@ DEFUN (show_ip_route_tag, if (first) { - vty_out (vty, SHOW_ROUTE_V4_HEADER, VTY_NEWLINE, VTY_NEWLINE, - VTY_NEWLINE); + vty_out (vty, SHOW_ROUTE_V4_HEADER); first = 0; } vty_show_ip_route (vty, rn, rib); @@ -2959,7 +2958,6 @@ DEFUN (ip_zebra_import_table_distance, { u_int32_t table_id = 0; int distance = ZEBRA_TABLE_DISTANCE_DEFAULT; - char *route_map_name = NULL; if (argc) VTY_GET_INTEGER("table", table_id, argv[0]); diff --git a/zebra/zserv.c b/zebra/zserv.c index fb138c11b..79c469cfc 100644 --- a/zebra/zserv.c +++ b/zebra/zserv.c @@ -858,8 +858,6 @@ zserv_rnh_unregister (struct zserv *client, int sock, u_short length, struct stream *s; struct prefix p; u_short l = 0; - u_char flags; - u_char exact_match; if (IS_ZEBRA_DEBUG_NHT) zlog_debug("rnh_unregister msg from client %s: length=%d\n", @@ -869,7 +867,7 @@ zserv_rnh_unregister (struct zserv *client, int sock, u_short length, while (l < length) { - flags = stream_getc(s); + (void)stream_getc(s); //Connected or not. Not used in this function p.family = stream_getw(s); p.prefixlen = stream_getc(s); l += 4; @@ -1281,7 +1279,6 @@ zread_ipv6_add (struct zserv *client, u_short length) u_char nexthop_type; unsigned long ifindex; struct prefix_ipv6 p; - u_char ifname_len; safi_t safi; static struct in6_addr nexthops[MULTIPATH_NUM]; static unsigned int ifindices[MULTIPATH_NUM]; diff --git a/zebra/zserv.h b/zebra/zserv.h index 22d150083..a344cbd0c 100644 --- a/zebra/zserv.h +++ b/zebra/zserv.h @@ -26,6 +26,7 @@ #include "if.h" #include "workqueue.h" #include "routemap.h" +#include "vty.h" #include "zclient.h" /* Default port information. */ @@ -113,7 +114,7 @@ struct zebra_t struct list *client_list; /* default table */ - int rtm_table_default; + u_int32_t rtm_table_default; /* rib work queue */ struct work_queue *ribq; |