Commit bc8035ad authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Add channel information to update_route.

parent fadd362d
......@@ -355,7 +355,7 @@ parse_packet(const unsigned char *from, struct network *net,
}
update_route(router_id, prefix, plen, seqno, metric, interval,
neigh, nh);
neigh, nh, NULL, 0);
} else if(type == MESSAGE_REQUEST) {
unsigned char prefix[16], plen;
int rc;
......
......@@ -428,7 +428,8 @@ struct route *
update_route(const unsigned char *a, const unsigned char *p, unsigned char plen,
unsigned short seqno, unsigned short refmetric,
unsigned short interval,
struct neighbour *neigh, const unsigned char *nexthop)
struct neighbour *neigh, const unsigned char *nexthop,
const unsigned char *channels, int channels_len)
{
struct route *route;
struct source *src;
......@@ -528,6 +529,9 @@ update_route(const unsigned char *a, const unsigned char *p, unsigned char plen,
route->hold_time = hold_time;
route->installed = 0;
memset(&route->channels, 0, sizeof(route->channels));
if(channels_len > 0)
memcpy(&route->channels, channels,
MIN(channels_len, DIVERSITY_HOPS));
numroutes++;
local_notify_route(route, LOCAL_ADD);
consider_route(route);
......
......@@ -80,7 +80,8 @@ struct route *update_route(const unsigned char *a,
const unsigned char *p, unsigned char plen,
unsigned short seqno, unsigned short refmetric,
unsigned short interval, struct neighbour *neigh,
const unsigned char *nexthop);
const unsigned char *nexthop,
const unsigned char *channels, int channels_len);
void retract_neighbour_routes(struct neighbour *neigh);
void send_unfeasible_request(struct neighbour *neigh, int force,
unsigned short seqno, unsigned short metric,
......
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