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