summaryrefslogtreecommitdiff
path: root/proto/bgp/bgp.c
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2017-03-29 15:31:04 +0200
committerOndrej Zajicek (work) <santiago@crfreenet.org>2017-03-29 15:31:04 +0200
commit6fe11c994151344c38d1b080c3f2e1280b4b2448 (patch)
tree79cb1e71989bd11f4107f0be0daf8331977bb5e4 /proto/bgp/bgp.c
parentc49e4a65657e9abff1b94cbfdc7686efe7376a7a (diff)
BGP: Simplify igp table options
Diffstat (limited to 'proto/bgp/bgp.c')
-rw-r--r--proto/bgp/bgp.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/proto/bgp/bgp.c b/proto/bgp/bgp.c
index ad3320be..01ac5453 100644
--- a/proto/bgp/bgp.c
+++ b/proto/bgp/bgp.c
@@ -1656,6 +1656,7 @@ bgp_postconfig(struct proto_config *CF)
if (cc->gr_able == 0xff)
cc->gr_able = (cf->gr_mode == BGP_GR_ABLE);
+ /* Default values of IGP tables */
if ((cc->gw_mode == GW_RECURSIVE) && !cc->desc->no_igp)
{
if (!cc->igp_table_ip4 && (bgp_cc_is_ipv4(cc) || cc->ext_next_hop))
@@ -1663,6 +1664,12 @@ bgp_postconfig(struct proto_config *CF)
if (!cc->igp_table_ip6 && (bgp_cc_is_ipv6(cc) || cc->ext_next_hop))
cc->igp_table_ip6 = bgp_default_igp_table(cf, cc, NET_IP6);
+
+ if (cc->igp_table_ip4 && bgp_cc_is_ipv6(cc) && !cc->ext_next_hop)
+ cf_error("Mismatched IGP table type");
+
+ if (cc->igp_table_ip6 && bgp_cc_is_ipv4(cc) && !cc->ext_next_hop)
+ cf_error("Mismatched IGP table type");
}
if (cf->multihop && (cc->gw_mode == GW_DIRECT))