Commit fc88b140 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Tweak network structure.

parent daf5fa4f
......@@ -266,7 +266,7 @@ network_up(struct network *net, int up)
if(net->ll)
free(net->ll);
net->nll = 0;
net->numll = 0;
net->ll = NULL;
rc = kernel_ll_addresses(net->ifname, net->ifindex, ll, 32);
if(rc < 0) {
......@@ -276,7 +276,7 @@ network_up(struct network *net, int up)
if(net->ll == NULL) {
perror("malloc(ll)");
} else {
net->nll = rc;
net->numll = rc;
memcpy(net->ll, ll, rc * 16);
}
}
......@@ -306,7 +306,7 @@ network_up(struct network *net, int up)
if(net->ll)
free(net->ll);
net->ll = NULL;
net->nll = 0;
net->numll = 0;
}
update_network_metric(net);
......@@ -325,7 +325,7 @@ network_ll_address(struct network *net, const unsigned char *address)
if(!net->up)
return 0;
for(i = 0; i < net->nll; i++)
for(i = 0; i < net->numll; i++)
if(memcmp(net->ll[i], address, 16) == 0)
return 1;
......
......@@ -22,9 +22,9 @@ THE SOFTWARE.
struct network {
struct network *next;
int up;
char up;
char wired;
unsigned int ifindex;
int wired;
unsigned short cost;
struct timeval hello_time;
struct timeval hello_timeout;
......@@ -34,15 +34,15 @@ struct network {
struct timeval update_timeout;
char ifname[IF_NAMESIZE];
unsigned char *ipv4;
int nll;
int numll;
unsigned char (*ll)[16];
int buffered;
struct timeval flush_timeout;
int bufsize;
int have_buffered_hello;
int have_buffered_id;
int have_buffered_nh;
int have_buffered_prefix;
char have_buffered_hello;
char have_buffered_id;
char have_buffered_nh;
char have_buffered_prefix;
unsigned char buffered_id[16];
unsigned char buffered_nh[4];
unsigned char buffered_prefix[16];
......@@ -51,8 +51,8 @@ struct network {
unsigned int bucket;
time_t activity_time;
unsigned short hello_seqno;
unsigned int hello_interval;
unsigned int self_update_interval;
unsigned short hello_interval;
unsigned short self_update_interval;
};
extern struct network *networks;
......
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