Commit 4a0308bf authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Rename parameters of update_prefix.

parent 08dc83bd
...@@ -653,7 +653,8 @@ update_interface_metric(struct interface *ifp) ...@@ -653,7 +653,8 @@ update_interface_metric(struct interface *ifp)
/* This is called whenever we receive an update. */ /* This is called whenever we receive an update. */
struct route * struct route *
update_route(const unsigned char *a, const unsigned char *p, unsigned char plen, update_route(const unsigned char *id,
const unsigned char *prefix, unsigned char plen,
unsigned short seqno, unsigned short refmetric, unsigned short seqno, unsigned short refmetric,
unsigned short interval, unsigned short interval,
struct neighbour *neigh, const unsigned char *nexthop, struct neighbour *neigh, const unsigned char *nexthop,
...@@ -665,26 +666,26 @@ update_route(const unsigned char *a, const unsigned char *p, unsigned char plen, ...@@ -665,26 +666,26 @@ update_route(const unsigned char *a, const unsigned char *p, unsigned char plen,
int add_metric; int add_metric;
int hold_time = MAX((4 * interval) / 100 + interval / 50, 15); int hold_time = MAX((4 * interval) / 100 + interval / 50, 15);
if(memcmp(a, myid, 8) == 0) if(memcmp(id, myid, 8) == 0)
return NULL; return NULL;
if(martian_prefix(p, plen)) { if(martian_prefix(prefix, plen)) {
fprintf(stderr, "Rejecting martian route to %s through %s.\n", fprintf(stderr, "Rejecting martian route to %s through %s.\n",
format_prefix(p, plen), format_address(a)); format_prefix(prefix, plen), format_address(id));
return NULL; return NULL;
} }
add_metric = input_filter(a, p, plen, add_metric = input_filter(id, prefix, plen,
neigh->address, neigh->ifp->ifindex); neigh->address, neigh->ifp->ifindex);
if(add_metric >= INFINITY) if(add_metric >= INFINITY)
return NULL; return NULL;
src = find_source(a, p, plen, 1, seqno); src = find_source(id, prefix, plen, 1, seqno);
if(src == NULL) if(src == NULL)
return NULL; return NULL;
feasible = update_feasible(src, seqno, refmetric); feasible = update_feasible(src, seqno, refmetric);
route = find_route(p, plen, neigh, nexthop); route = find_route(prefix, plen, neigh, nexthop);
metric = MIN((int)refmetric + neighbour_cost(neigh) + add_metric, INFINITY); metric = MIN((int)refmetric + neighbour_cost(neigh) + add_metric, INFINITY);
if(route) { if(route) {
struct source *oldsrc; struct source *oldsrc;
......
...@@ -91,8 +91,8 @@ struct route *install_best_route(const unsigned char prefix[16], ...@@ -91,8 +91,8 @@ struct route *install_best_route(const unsigned char prefix[16],
void update_neighbour_metric(struct neighbour *neigh, int changed); void update_neighbour_metric(struct neighbour *neigh, int changed);
void update_interface_metric(struct interface *ifp); void update_interface_metric(struct interface *ifp);
void update_route_metric(struct route *route); void update_route_metric(struct route *route);
struct route *update_route(const unsigned char *a, struct route *update_route(const unsigned char *id,
const unsigned char *p, unsigned char plen, const unsigned char *prefix, unsigned char plen,
unsigned short seqno, unsigned short refmetric, unsigned short seqno, unsigned short refmetric,
unsigned short interval, struct neighbour *neigh, unsigned short interval, struct neighbour *neigh,
const unsigned char *nexthop, const unsigned char *nexthop,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment