Wifi-1004: Provision gre_ifname, gre_local_inet_addr, gre_remote_inet_addr, gre_remote_mac_addr on AP

Add checks to make sure required parameters are not null before
attempting to configure on AP. Required because the gre attributes are
in the ApProfile now, so cannot just have check based on whether there
is an attached GreProfile.
This commit is contained in:
Mike Hansen
2020-11-04 12:27:07 -05:00
parent b182a6953d
commit c8bace4850

View File

@@ -3269,12 +3269,26 @@ public class OvsdbDao {
Map<String, Value> tableColumns = new HashMap<>();
ApNetworkConfiguration details = (ApNetworkConfiguration) apNetworkConfiguration.getDetails();
if (details.getGreParentIfName() == null) {
LOG.info("Cannot configure GRE profile without gre_ifname");
return;
}
tableColumns.put("gre_ifname", new Atom<>(details.getGreParentIfName()));
tableColumns.put("gre_local_inet_addr", new Atom<>(details.getGreLocalInetAddr().getHostAddress()));
if (details.getGreLocalInetAddr() != null) {
tableColumns.put("gre_local_inet_addr", new Atom<>(details.getGreLocalInetAddr().getHostAddress()));
}
if (details.getGreRemoteInetAddr() == null) {
LOG.info("Cannot configure GRE profile without gre_remote_inet_addr");
return;
}
tableColumns.put("gre_remote_inet_addr", new Atom<>(details.getGreRemoteInetAddr().getHostAddress()));
if (details.getGreRemoteMacAddr() != null) {
tableColumns.put("gre_remote_mac_addr", new Atom<>(details.getGreRemoteMacAddr().getAddressAsString()));
}
if (details.getGreTunnelName() == null) {
LOG.info("Cannot configure GRE profile without if_name");
return;
}
tableColumns.put("if_name", new Atom<>(details.getGreTunnelName()));
tableColumns.put("if_type", new Atom<>("gre"));
tableColumns.put("network", new Atom<>(true));