summaryrefslogtreecommitdiff
path: root/proto/bgp/bgp.c
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2012-07-04 21:31:03 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2012-07-16 01:33:02 +0200
commit26822d8fe1376b2ffd902a3b5caa47f81a88e74e (patch)
tree6ca5eb0756861b729cb62440a49123a58453a393 /proto/bgp/bgp.c
parentb7f3df79054aca327654c1fb4739c4ff02e59e6e (diff)
Finalize RA_ACCEPTED handling.
Diffstat (limited to 'proto/bgp/bgp.c')
-rw-r--r--proto/bgp/bgp.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/proto/bgp/bgp.c b/proto/bgp/bgp.c
index 099a39a9..d59b4308 100644
--- a/proto/bgp/bgp.c
+++ b/proto/bgp/bgp.c
@@ -955,14 +955,14 @@ bgp_check_config(struct bgp_config *c)
if (internal && c->rs_client)
cf_error("Only external neighbor can be RS client");
- /*
+
if (c->multihop && (c->gw_mode == GW_DIRECT))
cf_error("Multihop BGP cannot use direct gateway mode");
if (c->multihop && (ipa_has_link_scope(c->remote_ip) ||
ipa_has_link_scope(c->source_addr)))
cf_error("Multihop BGP cannot be used with link-local addresses");
- */
+
/* Different default based on rs_client */
if (!c->missing_lladdr)
@@ -970,8 +970,17 @@ bgp_check_config(struct bgp_config *c)
/* Different default for gw_mode */
if (!c->gw_mode)
- // c->gw_mode = (c->multihop || internal) ? GW_RECURSIVE : GW_DIRECT;
- c->gw_mode = GW_DIRECT;
+ c->gw_mode = (c->multihop || internal) ? GW_RECURSIVE : GW_DIRECT;
+
+
+ if ((c->gw_mode == GW_RECURSIVE) && c->c.table->sorted)
+ cf_error("BGP in recursive mode prohibits sorted table");
+
+ if (c->deterministic_med && c->c.table->sorted)
+ cf_error("BGP with deterministic MED prohibits sorted table");
+
+ if (c->secondary && !c->c.table->sorted)
+ cf_error("BGP with secondary option requires sorted table");
}
static int