File tree Expand file tree Collapse file tree
pfSense-pkg-API/files/etc/inc/api/models Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -195,7 +195,7 @@ class APIFirewallRuleCreate extends APIModel {
195195 $ this ->errors [] = APIResponse \get (4043 );
196196 }
197197 # Check if the gateway IP protocol matches our rule's IP protocol
198- elseif ($ gw_protocol !== " inet46 " and $ gw_protocol !== $ this ->validated_data ["ipprotocol " ]) {
198+ elseif ($ gw_protocol !== $ this ->validated_data ["ipprotocol " ]) {
199199 $ this ->errors [] = APIResponse \get (4109 );
200200 }
201201 # Otherwise, the gateway is valid
Original file line number Diff line number Diff line change @@ -218,7 +218,7 @@ class APIFirewallRuleUpdate extends APIModel {
218218 $ this ->errors [] = APIResponse \get (4043 );
219219 }
220220 # Check if the gateway IP protocol matches our rule's IP protocol
221- elseif ($ gw_protocol !== " inet46 " and $ gw_protocol !== $ this ->validated_data ["ipprotocol " ]) {
221+ elseif ($ gw_protocol !== $ this ->validated_data ["ipprotocol " ]) {
222222 $ this ->errors [] = APIResponse \get (4109 );
223223 }
224224 # Otherwise, the gateway is valid
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ class APIUnitTestFirewallRule(unit_test_framework.APIUnitTest):
2828 "dst" : "127.0.0.1" ,
2929 "dstport" : "443" ,
3030 "descr" : "Unit test" ,
31+ "log" : True ,
3132 "top" : True
3233 }
3334 ]
@@ -38,10 +39,12 @@ class APIUnitTestFirewallRule(unit_test_framework.APIUnitTest):
3839 "ipprotocol" : "inet" ,
3940 "protocol" : "tcp/udp" ,
4041 "src" : "172.16.77.125" ,
41- "srcport" : "HTTP " ,
42+ "srcport" : "8080-8081 " ,
4243 "dst" : "127.0.0.1" ,
43- "dstport" : "HTTP " ,
44+ "dstport" : "2222-4444 " ,
4445 "descr" : "Updated Unit test" ,
46+ "gateway" : "WAN_DHCP" ,
47+ "log" : False ,
4548 "top" : True
4649 }
4750 ]
You can’t perform that action at this time.
0 commit comments