From 391931d45686a807d322878d4b3d5c9634e2dbca Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Fri, 19 Nov 2010 13:46:21 +0100 Subject: Minor finalizations of link state checks. --- proto/static/config.Y | 2 +- proto/static/static.c | 2 +- proto/static/static.h | 4 +--- 3 files changed, 3 insertions(+), 5 deletions(-) (limited to 'proto/static') diff --git a/proto/static/config.Y b/proto/static/config.Y index 9f4d7da..2849015 100644 --- a/proto/static/config.Y +++ b/proto/static/config.Y @@ -32,7 +32,7 @@ static_proto_start: proto_start STATIC { static_proto: static_proto_start proto_name '{' | static_proto proto_item ';' - | static_proto CHECK LINK ';' { STATIC_CFG->check = STATIC_CHECK_LINK; } + | static_proto CHECK LINK bool ';' { STATIC_CFG->check_link = $4; } | static_proto stat_route ';' ; diff --git a/proto/static/static.c b/proto/static/static.c index 4f879bd..4ee2cbd 100644 --- a/proto/static/static.c +++ b/proto/static/static.c @@ -72,7 +72,7 @@ static_decide(struct static_config *cf, struct static_route *r) if (!ifa) return 0; - if ((cf->check == STATIC_CHECK_LINK) && !(ifa->flags & IF_LINK_UP)) + if (cf->check_link && !(ifa->flags & IF_LINK_UP)) return 0; return 1; diff --git a/proto/static/static.h b/proto/static/static.h index 40da74c..5c31e00 100644 --- a/proto/static/static.h +++ b/proto/static/static.h @@ -13,11 +13,9 @@ struct static_config { struct proto_config c; list iface_routes; /* Routes to search on interface events */ list other_routes; /* Routes hooked to neighbor cache and reject routes */ - int check; /* Condition for route install */ + int check_link; /* Whether iface link state is used */ }; -#define STATIC_CHECK_NONE 0 -#define STATIC_CHECK_LINK 1 void static_init_config(struct static_config *); -- cgit v1.2.3