Ray Milkey
Committed by Gerrit Code Review

Fix NPE if flowSpecCapability is not specified

Change-Id: Iac5958cdbcd495f3b661771628de429eb2a07556
......@@ -128,6 +128,9 @@ public class BgpCfgProvider extends AbstractProvider {
bgpConfig.setMaxSession(config.maxSession());
bgpConfig.setLargeASCapability(config.largeAsCapability());
if (config.flowSpecCapability() == null) {
bgpConfig.setFlowSpecCapability(BgpCfg.FlowSpec.NONE);
} else {
if (config.flowSpecCapability().equals("IPV4")) {
bgpConfig.setFlowSpecCapability(BgpCfg.FlowSpec.IPV4);
} else if (config.flowSpecCapability().equals("VPNV4")) {
......@@ -137,6 +140,7 @@ public class BgpCfgProvider extends AbstractProvider {
} else {
bgpConfig.setFlowSpecCapability(BgpCfg.FlowSpec.NONE);
}
}
bgpConfig.setFlowSpecRpdCapability(config.rpdCapability());
nodes = config.bgpPeer();
......@@ -178,6 +182,9 @@ public class BgpCfgProvider extends AbstractProvider {
bgpConfig.setMaxSession(config.maxSession());
bgpConfig.setLargeASCapability(config.largeAsCapability());
if (config.flowSpecCapability() == null) {
bgpConfig.setFlowSpecCapability(BgpCfg.FlowSpec.NONE);
} else {
if (config.flowSpecCapability().equals("IPV4")) {
bgpConfig.setFlowSpecCapability(BgpCfg.FlowSpec.IPV4);
} else if (config.flowSpecCapability().equals("VPNV4")) {
......@@ -187,6 +194,7 @@ public class BgpCfgProvider extends AbstractProvider {
} else {
bgpConfig.setFlowSpecCapability(BgpCfg.FlowSpec.NONE);
}
}
bgpConfig.setFlowSpecRpdCapability(config.rpdCapability());
/* update the peer configuration */
......