--- embedaddon/quagga/lib/table.c 2013/07/21 23:54:39 1.1.1.2 +++ embedaddon/quagga/lib/table.c 2016/11/02 10:09:10 1.1.1.3 @@ -29,8 +29,8 @@ static void route_node_delete (struct route_node *); static void route_table_free (struct route_table *); - + /* * route_table_init_with_delegate */ @@ -59,7 +59,7 @@ route_node_new (struct route_table *table) /* Allocate new route node with prefix set. */ static struct route_node * -route_node_set (struct route_table *table, struct prefix *prefix) +route_node_set (struct route_table *table, const struct prefix *prefix) { struct route_node *node; @@ -141,14 +141,14 @@ static const u_char maskbit[] = /* Common prefix route genaration. */ static void -route_common (struct prefix *n, struct prefix *p, struct prefix *new) +route_common (const struct prefix *n, const struct prefix *p, struct prefix *new) { int i; u_char diff; u_char mask; - u_char *np = (u_char *)&n->u.prefix; - u_char *pp = (u_char *)&p->u.prefix; + const u_char *np = (const u_char *)&n->u.prefix; + const u_char *pp = (const u_char *)&p->u.prefix; u_char *newp = (u_char *)&new->u.prefix; for (i = 0; i < p->prefixlen / 8; i++) @@ -265,7 +265,7 @@ route_node_match_ipv6 (const struct route_table *table /* Lookup same prefix node. Return NULL when we can't find route. */ struct route_node * -route_node_lookup (const struct route_table *table, struct prefix *p) +route_node_lookup (const struct route_table *table, const struct prefix *p) { struct route_node *node; u_char prefixlen = p->prefixlen; @@ -287,7 +287,7 @@ route_node_lookup (const struct route_table *table, st /* Add node to routing table. */ struct route_node * -route_node_get (struct route_table *const table, struct prefix *p) +route_node_get (struct route_table *const table, const struct prefix *p) { struct route_node *new; struct route_node *node; @@ -626,10 +626,7 @@ route_table_get_next_internal (const struct route_tabl struct prefix *p) { struct route_node *node, *tmp_node; - u_char prefixlen; int cmp; - - prefixlen = p->prefixlen; node = table->top;