From c8bace4850f504db9ed036f5e4d82250d2fd7308 Mon Sep 17 00:00:00 2001 From: Mike Hansen Date: Wed, 4 Nov 2020 12:27:07 -0500 Subject: [PATCH] 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. --- .../wlan/opensync/ovsdb/dao/OvsdbDao.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/opensync-gateway/src/main/java/com/telecominfraproject/wlan/opensync/ovsdb/dao/OvsdbDao.java b/opensync-gateway/src/main/java/com/telecominfraproject/wlan/opensync/ovsdb/dao/OvsdbDao.java index cdc1611..80c838e 100644 --- a/opensync-gateway/src/main/java/com/telecominfraproject/wlan/opensync/ovsdb/dao/OvsdbDao.java +++ b/opensync-gateway/src/main/java/com/telecominfraproject/wlan/opensync/ovsdb/dao/OvsdbDao.java @@ -3269,12 +3269,26 @@ public class OvsdbDao { Map 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));