Skip to content
Snippets Groups Projects
Commit e183e76e authored by chechoRP's avatar chechoRP
Browse files

Fix for Firewall issue #590

The dl_type=ARP (or any other dl_type) is overwritten if dst-ip/src-ip are specified later on in the json object. I added condition that only overwrites the field if it hasn't been already specified. This case only applies for src-ip, and dst-ip.
parent 7fbbbbbb
No related branches found
No related tags found
No related merge requests found
......@@ -223,8 +223,10 @@ public class FirewallRulesResource extends ServerResource {
else if (n.equalsIgnoreCase("src-ip")) {
if (!jp.getText().equalsIgnoreCase("ANY")) {
rule.any_nw_src = false;
rule.any_dl_type = false;
rule.dl_type = EthType.IPv4;
if (rule.dl_type.equals(EthType.NONE)){
rule.any_dl_type = false;
rule.dl_type = EthType.IPv4;
}
try {
rule.nw_src_prefix_and_mask = IPv4AddressWithMask.of(jp.getText());
} catch (IllegalArgumentException e) {
......@@ -237,8 +239,10 @@ public class FirewallRulesResource extends ServerResource {
else if (n.equalsIgnoreCase("dst-ip")) {
if (!jp.getText().equalsIgnoreCase("ANY")) {
rule.any_nw_dst = false;
rule.any_dl_type = false;
rule.dl_type = EthType.IPv4;
if (rule.dl_type.equals(EthType.NONE)){
rule.any_dl_type = false;
rule.dl_type = EthType.IPv4;
}
try {
rule.nw_dst_prefix_and_mask = IPv4AddressWithMask.of(jp.getText());
} catch (IllegalArgumentException e) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment