summaryrefslogtreecommitdiffstats
path: root/zebra
diff options
context:
space:
mode:
Diffstat (limited to 'zebra')
-rw-r--r--zebra/irdp_interface.c3
-rw-r--r--zebra/router-id.c33
-rw-r--r--zebra/rt_netlink.c8
-rw-r--r--zebra/rt_netlink.h4
4 files changed, 25 insertions, 23 deletions
diff --git a/zebra/irdp_interface.c b/zebra/irdp_interface.c
index 6403830b..43c63a83 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/router-id.c b/zebra/router-id.c
index b738027e..94a29419 100644
--- a/zebra/router-id.c
+++ b/zebra/router-id.c
@@ -41,8 +41,13 @@
#include "zebra/router-id.h"
#include "zebra/redistribute.h"
-static struct list rid_all_sorted_list;
-static struct list rid_lo_sorted_list;
+/* 2nd pointer type used primarily to quell a warning on
+ * ALL_LIST_ELEMENTS_RO
+ */
+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 +91,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 +136,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 +169,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 +245,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 f3cdcdc3..12dbd1ad 100644
--- a/zebra/rt_netlink.c
+++ b/zebra/rt_netlink.c
@@ -1246,9 +1246,9 @@ 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, size_t maxlen, int type, void *data, int alen)
{
- int len;
+ size_t len;
struct rtattr *rta;
len = RTA_LENGTH (alen);
@@ -1288,9 +1288,9 @@ 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, size_t maxlen, int type, int data)
{
- int len;
+ size_t len;
struct rtattr *rta;
len = RTA_LENGTH (4);
diff --git a/zebra/rt_netlink.h b/zebra/rt_netlink.h
index 452b3974..0facd49e 100644
--- a/zebra/rt_netlink.h
+++ b/zebra/rt_netlink.h
@@ -27,9 +27,9 @@
#define NL_PKT_BUF_SIZE 8192
extern int
-addattr32 (struct nlmsghdr *n, int maxlen, int type, int data);
+addattr32 (struct nlmsghdr *n, size_t 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, size_t maxlen, int type, void *data, int alen);
extern int
rta_addattr_l (struct rtattr *rta, int maxlen, int type, void *data, int alen);