Commit b6513124 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Remove default argument from NET_CONF.

parent 050c0366
...@@ -103,8 +103,8 @@ update_hello_interval(struct network *net) ...@@ -103,8 +103,8 @@ update_hello_interval(struct network *net)
if(network_idle(net)) if(network_idle(net))
interval = idle_hello_interval; interval = idle_hello_interval;
else if(NET_CONF(net, hello_interval, 0) > 0) else if(NET_CONF(net, hello_interval) > 0)
interval = NET_CONF(net, hello_interval, 0); interval = NET_CONF(net, hello_interval);
else if((net->flags & NET_WIRED)) else if((net->flags & NET_WIRED))
interval = wired_hello_interval; interval = wired_hello_interval;
else else
...@@ -259,14 +259,14 @@ network_up(struct network *net, int up) ...@@ -259,14 +259,14 @@ network_up(struct network *net, int up)
if(wired) { if(wired) {
net->flags |= NET_WIRED; net->flags |= NET_WIRED;
net->cost = NET_CONF(net, cost, 0); net->cost = NET_CONF(net, cost);
if(net->cost <= 0) net->cost = 96; if(net->cost <= 0) net->cost = 96;
if(split_horizon) if(split_horizon)
net->flags |= NET_SPLIT_HORIZON; net->flags |= NET_SPLIT_HORIZON;
net->flags &= ~NET_LQ; net->flags &= ~NET_LQ;
} else { } else {
net->flags &= ~NET_WIRED; net->flags &= ~NET_WIRED;
net->cost = NET_CONF(net, cost, 0); net->cost = NET_CONF(net, cost);
if(net->cost <= 0) net->cost = 256; if(net->cost <= 0) net->cost = 256;
net->flags &= ~NET_SPLIT_HORIZON; net->flags &= ~NET_SPLIT_HORIZON;
net->flags |= NET_LQ; net->flags |= NET_LQ;
......
...@@ -75,8 +75,8 @@ struct network { ...@@ -75,8 +75,8 @@ struct network {
unsigned short self_update_interval; unsigned short self_update_interval;
}; };
#define NET_CONF(_net, _field, _default) \ #define NET_CONF(_net, _field) \
((_net)->conf ? (_net)->conf->_field : (_default)) ((_net)->conf ? (_net)->conf->_field : 0)
extern struct network *networks; extern struct network *networks;
extern int numnets; extern int numnets;
......
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