diff --git a/proto/bmp/bmp.c b/proto/bmp/bmp.c index 7efa8f6a..fce9a0a1 100644 --- a/proto/bmp/bmp.c +++ b/proto/bmp/bmp.c @@ -964,6 +964,22 @@ bmp_close_socket(struct bmp_proto *p) } +static void +bmp_postconfig(struct proto_config *CF) +{ + struct bmp_config *cf = (void *) CF; + + /* Do not check templates at all */ + if (cf->c.class == SYM_TEMPLATE) + return; + + if (ipa_zero(cf->station_ip)) + cf_error("Station IP address not specified"); + + if (!cf->station_port) + cf_error("Station port number not specified"); +} + /** Configuration handle section **/ static struct proto * bmp_init(struct proto_config *CF) @@ -1047,6 +1063,7 @@ struct protocol proto_bmp = { .class = PROTOCOL_BMP, .proto_size = sizeof(struct bmp_proto), .config_size = sizeof(struct bmp_config), + .postconfig = bmp_postconfig, .init = bmp_init, .start = bmp_start, .shutdown = bmp_shutdown, diff --git a/proto/bmp/config.Y b/proto/bmp/config.Y index 2fc87458..5a5e0812 100644 --- a/proto/bmp/config.Y +++ b/proto/bmp/config.Y @@ -25,9 +25,6 @@ proto: bmp_proto '}' ; bmp_proto_start: proto_start BMP { this_proto = proto_config_new(&proto_bmp, $1); - BMP_CFG->local_addr = IPA_NONE4; - BMP_CFG->station_ip = IPA_NONE4; - BMP_CFG->station_port = 0; BMP_CFG->sys_descr = "Not defined"; BMP_CFG->sys_name = "Not defined"; BMP_CFG->monitoring_rib_in_pre_policy = false;