Skip to content

Commit

Permalink
fix(web): Fixed firewall service pid in GwtNetworkService (#5328)
Browse files Browse the repository at this point in the history
Fixed firewall service pid in GwtNetworkService

Signed-off-by: pierantoniomerlino <[email protected]>
  • Loading branch information
pierantoniomerlino authored Jul 30, 2024
1 parent 83b5252 commit 1ba7687
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@
public class GwtNetworkServiceImpl extends OsgiRemoteServiceServlet implements GwtNetworkService {

private static final long serialVersionUID = -4188750359099902616L;
private static final String FIREWALL_CONFIGURATION_SERVICE_PID = "org.eclipse.kura.net.admin.ipv6.FirewallConfigurationServiceIPv6";
private static final String FIREWALL_IPV4_CONFIGURATION_SERVICE_PID = "org.eclipse.kura.net.admin.FirewallConfigurationService";
private static final String FIREWALL_IPV6_CONFIGURATION_SERVICE_PID = "org.eclipse.kura.net.admin.ipv6.FirewallConfigurationServiceIPv6";
private static final String UNKNOWN_NETWORK_IP6_SHORT = "::/0";
private static final String UNKNOWN_NETWORK_IP6_LONG = "0:0:0:0:0:0:0:0/0";
private static final String UNKNOWN_NETWORK_IP4 = "0.0.0.0/0";
Expand Down Expand Up @@ -411,7 +412,7 @@ public void updateDeviceFirewallOpenPorts(GwtXSRFToken xsrfToken, List<GwtFirewa
}

properties.put(openPortsPropName, openPorts.toString());
configurationService.updateConfiguration(FIREWALL_CONFIGURATION_SERVICE_PID, properties, true);
configurationService.updateConfiguration(FIREWALL_IPV4_CONFIGURATION_SERVICE_PID, properties, true);
} catch (KuraException | UnknownHostException e) {
throw new GwtKuraException(GwtKuraErrorCode.INTERNAL_ERROR, e);
}
Expand Down Expand Up @@ -457,7 +458,7 @@ public void updateDeviceFirewallOpenPortsIPv6(GwtXSRFToken xsrfToken, List<GwtFi
}

properties.put(openPortsPropName, openPorts.toString());
configurationService.updateConfiguration(FIREWALL_CONFIGURATION_SERVICE_PID, properties, true);
configurationService.updateConfiguration(FIREWALL_IPV6_CONFIGURATION_SERVICE_PID, properties, true);
} catch (KuraException | UnknownHostException e) {
throw new GwtKuraException(GwtKuraErrorCode.INTERNAL_ERROR, e);
}
Expand Down Expand Up @@ -505,7 +506,7 @@ public void updateDeviceFirewallPortForwards(GwtXSRFToken xsrfToken, List<GwtFir
}

properties.put(portForwardingPropName, portForwarding.toString());
configurationService.updateConfiguration(FIREWALL_CONFIGURATION_SERVICE_PID, properties, true);
configurationService.updateConfiguration(FIREWALL_IPV4_CONFIGURATION_SERVICE_PID, properties, true);
} catch (KuraException | UnknownHostException e) {
throw new GwtKuraException(GwtKuraErrorCode.INTERNAL_ERROR, e);
}
Expand Down Expand Up @@ -554,7 +555,7 @@ public void updateDeviceFirewallPortForwardsIPv6(GwtXSRFToken xsrfToken, List<Gw
}

properties.put(portForwardingPropName, portForwarding.toString());
configurationService.updateConfiguration(FIREWALL_CONFIGURATION_SERVICE_PID, properties, true);
configurationService.updateConfiguration(FIREWALL_IPV6_CONFIGURATION_SERVICE_PID, properties, true);
} catch (KuraException | UnknownHostException e) {
throw new GwtKuraException(GwtKuraErrorCode.INTERNAL_ERROR, e);
}
Expand Down Expand Up @@ -596,7 +597,7 @@ public void updateDeviceFirewallNATs(GwtXSRFToken xsrfToken, List<GwtFirewallNat
}

properties.put(natPropName, nat.toString());
configurationService.updateConfiguration(FIREWALL_CONFIGURATION_SERVICE_PID, properties, true);
configurationService.updateConfiguration(FIREWALL_IPV4_CONFIGURATION_SERVICE_PID, properties, true);
} catch (KuraException | UnknownHostException e) {
throw new GwtKuraException(GwtKuraErrorCode.INTERNAL_ERROR, e);
}
Expand Down Expand Up @@ -638,7 +639,7 @@ public void updateDeviceFirewallNATsIPv6(GwtXSRFToken xsrfToken, List<GwtFirewal
}

properties.put(natPropName, nat.toString());
configurationService.updateConfiguration(FIREWALL_CONFIGURATION_SERVICE_PID, properties, true);
configurationService.updateConfiguration(FIREWALL_IPV6_CONFIGURATION_SERVICE_PID, properties, true);
} catch (KuraException | UnknownHostException e) {
throw new GwtKuraException(GwtKuraErrorCode.INTERNAL_ERROR, e);
}
Expand Down

0 comments on commit 1ba7687

Please sign in to comment.