Commit 6f530114 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Add new flag SPLIT_HORIZON.

parent 3a055e6d
...@@ -894,7 +894,7 @@ flushupdates(struct network *net) ...@@ -894,7 +894,7 @@ flushupdates(struct network *net)
if(metric < INFINITY) if(metric < INFINITY)
satisfy_request(route->src->prefix, route->src->plen, satisfy_request(route->src->prefix, route->src->plen,
seqno, route->src->id, net); seqno, route->src->id, net);
if(split_horizon && (net->flags & NET_WIRED) && if((net->flags & NET_SPLIT_HORIZON) &&
route->neigh->network == net) route->neigh->network == net)
continue; continue;
really_send_update(net, route->src->id, really_send_update(net, route->src->id,
......
...@@ -262,6 +262,8 @@ network_up(struct network *net, int up) ...@@ -262,6 +262,8 @@ network_up(struct network *net, int up)
if(wired) { if(wired) {
net->flags |= NET_WIRED; net->flags |= NET_WIRED;
net->cost = 96; net->cost = 96;
if(split_horizon)
net->flags |= NET_SPLIT_HORIZON;
} else { } else {
net->flags &= ~NET_WIRED; net->flags &= ~NET_WIRED;
net->cost = 256; net->cost = 256;
......
...@@ -34,6 +34,7 @@ struct network_conf { ...@@ -34,6 +34,7 @@ struct network_conf {
#define NET_UP (1 << 0) #define NET_UP (1 << 0)
#define NET_WIRED (1<<1) #define NET_WIRED (1<<1)
#define NET_SPLIT_HORIZON (1 << 2)
struct network { struct network {
struct network *next; struct network *next;
......
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