Skip to content

Commit 05a5222

Browse files
Merge pull request #423 from jaredhendrickson13/next_minor
v1.7.0 Fixes
2 parents 7140cdc + ace4bee commit 05a5222

12 files changed

Lines changed: 59 additions & 70 deletions

.github/workflows/build.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,9 @@ jobs:
5353
strategy:
5454
matrix:
5555
include:
56-
- pfsense_version: pfSense-2.7.0-RELEASE
56+
- pfsense_version: pfSense-2.7.1-RELEASE
5757
freebsd_id: freebsd14
58-
- pfsense_version: pfSense-23.01-RELEASE
59-
freebsd_id: freebsd14
60-
- pfsense_version: pfSense-23.05-RELEASE
58+
- pfsense_version: pfSense-2.7.2-RELEASE
6159
freebsd_id: freebsd14
6260

6361
steps:

.github/workflows/release.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ jobs:
1717
- freebsd_version: FreeBSD-14.0-CURRENT
1818
pfsense_version: 2.7
1919
- freebsd_version: FreeBSD-14.0-CURRENT
20-
pfsense_version: 23.05
21-
- freebsd_version: FreeBSD-14.0-CURRENT
22-
pfsense_version: 23.01
20+
pfsense_version: 23.09
2321

2422
steps:
2523
- uses: actions/checkout@v3

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@ are made preventing the need for a reboot. All this results in the fastest, safe
1818
<details>
1919
<summary>Supported pfSense Versions</summary>
2020

21-
- pfSense CE 2.7.0 (amd64)
22-
- pfSense Plus 23.01 (amd64)
23-
- pfSense Plus 23.05 (amd64)
21+
- pfSense CE 2.7.1 (amd64)
22+
- pfSense CE 2.7.2 (amd64)
2423
- pfSense Plus 23.09 (community supported)
2524

25+
Don't see your version listed? Check the [releases page](https://github.com/jaredhendrickson13/pfsense-api/releases).
26+
Older versions of this package may support older versions of pfSense.
27+
2628
_This package is not supported on other architectures such as arm64 and aarch64. However, the package should still
2729
install and operate on these systems. Compatibility on unsupported systems is not guaranteed and is at your own risk._
2830

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"require": {
3-
"firebase/php-jwt": "v6.9.*"
3+
"firebase/php-jwt": "v6.10.*"
44
}
55
}

composer.lock

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/SECURITY.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ Below are versions that are currently supported and will receive security update
66

77
| Version | Supported |
88
|---------| ------------------ |
9+
| 1.7.x | :white_check_mark: |
910
| 1.6.x | :white_check_mark: |
10-
| 1.5.x | :white_check_mark: |
11-
| <=1.3.x | :x: |
11+
| <=1.5.x | :x: |
1212

1313
## Reporting a Vulnerability
1414

pfSense-pkg-API/files/etc/inc/api/models/APIFirewallNATOutboundMappingCreate.inc

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -135,28 +135,29 @@ class APIFirewallNATOutboundMappingCreate extends APIModel {
135135
if (isset($this->initial_data['target'])) {
136136
# Require the target to be a valid IPv4 subnet, address, alias or empty string for iface address
137137
if (APITools\is_ip_subnet_or_alias($this->initial_data['target']) === "ipv4_subnet") {
138-
$this->validated_data["target"] = "other-subnet";
139-
$this->validated_data['targetip'] = explode("/", $this->initial_data["target"])[0];
140-
$this->validated_data['targetip_subnet'] = explode("/", $this->initial_data["target"])[1];
141-
} elseif (APITools\is_ip_subnet_or_alias($this->initial_data['target']) === "ipv4_addr") {
142-
$this->validated_data["target"] = "other-subnet";
143-
$this->validated_data["targetip"] = $this->initial_data['target'];
144-
$this->validated_data['targetip_subnet'] = 32;
145-
} elseif (APITools\is_ip_subnet_or_alias($this->initial_data['target']) === "alias") {
138+
$this->validated_data['target'] = explode("/", $this->initial_data["target"])[0];
139+
$this->validated_data['target_subnet'] = explode("/", $this->initial_data["target"])[1];
140+
}
141+
elseif (APITools\is_ip_subnet_or_alias($this->initial_data['target']) === "ipv4_addr") {
142+
$this->validated_data["target"] = $this->initial_data['target'];
143+
$this->validated_data['target_subnet'] = 32;
144+
}
145+
elseif (APITools\is_ip_subnet_or_alias($this->initial_data['target']) === "alias") {
146146
# Only allow an alias if round-robin is chosen as the pool option
147147
if (in_array($this->validated_data["poolopts"], ["round-robin", "round-robin sticky-address"])) {
148148
$this->validated_data["target"] = $this->initial_data['target'];
149149
} else {
150150
$this->errors[] = APIResponse\get(4096);
151151
}
152-
} elseif ($this->initial_data["target"] === "") {
153-
$this->validated_data["target"] = "";
154-
$this->validated_data['targetip'] = "";
155-
$this->validated_data['targetip_subnet'] = "";
156-
} else {
152+
}
153+
elseif ($this->initial_data["target"] === "" or $this->initial_data["target"] === $this->validated_data["interface"]."ip") {
154+
$this->validated_data["target"] = $this->validated_data["interface"]."ip";
155+
}
156+
else {
157157
$this->errors[] = APIResponse\get(4095);
158158
}
159-
} else {
159+
}
160+
else {
160161
$this->errors[] = APIResponse\get(4094);
161162
}
162163
}

pfSense-pkg-API/files/etc/inc/api/models/APIFirewallNATOutboundMappingUpdate.inc

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -151,28 +151,25 @@ class APIFirewallNATOutboundMappingUpdate extends APIModel {
151151
if (isset($this->initial_data['target'])) {
152152
# Require the target to be a valid IPv4 subnet, address, alias or empty string for iface address
153153
if (APITools\is_ip_subnet_or_alias($this->initial_data['target']) === "ipv4_subnet") {
154-
$this->validated_data["target"] = "other-subnet";
155-
$this->validated_data['targetip'] = explode("/", $this->initial_data["target"])[0];
156-
$this->validated_data['targetip_subnet'] = explode("/", $this->initial_data["target"])[1];
157-
} elseif (APITools\is_ip_subnet_or_alias($this->initial_data['target']) === "ipv4_addr") {
158-
$this->validated_data["target"] = "other-subnet";
159-
$this->validated_data["targetip"] = $this->initial_data['target'];
160-
$this->validated_data['targetip_subnet'] = 32;
161-
} elseif (APITools\is_ip_subnet_or_alias($this->initial_data['target']) === "alias") {
162-
# Only allow an alias if default or round-robin is chosen as the pool option
163-
if (in_array($this->validated_data["poolopts"], ["", "round-robin", "round-robin sticky-address"])) {
164-
# Remove existing target IPs/subnets and add our alias as the target
165-
unset($this->validated_data["targetip"]);
166-
unset($this->validated_data["targetip_subnet"]);
154+
$this->validated_data['target'] = explode("/", $this->initial_data["target"])[0];
155+
$this->validated_data['target_subnet'] = explode("/", $this->initial_data["target"])[1];
156+
}
157+
elseif (APITools\is_ip_subnet_or_alias($this->initial_data['target']) === "ipv4_addr") {
158+
$this->validated_data["target"] = $this->initial_data['target'];
159+
$this->validated_data['target_subnet'] = 32;
160+
}
161+
elseif (APITools\is_ip_subnet_or_alias($this->initial_data['target']) === "alias") {
162+
# Only allow an alias if round-robin is chosen as the pool option
163+
if (in_array($this->validated_data["poolopts"], ["round-robin", "round-robin sticky-address"])) {
167164
$this->validated_data["target"] = $this->initial_data['target'];
168165
} else {
169166
$this->errors[] = APIResponse\get(4096);
170167
}
171-
} elseif ($this->initial_data["target"] === "") {
172-
$this->validated_data["target"] = "";
173-
$this->validated_data['targetip'] = "";
174-
$this->validated_data['targetip_subnet'] = "";
175-
} else {
168+
}
169+
elseif ($this->initial_data["target"] === "" or $this->initial_data["target"] === $this->validated_data["interface"]."ip") {
170+
$this->validated_data["target"] = $this->validated_data["interface"]."ip";
171+
}
172+
else {
176173
$this->errors[] = APIResponse\get(4095);
177174
}
178175
}

pfSense-pkg-API/files/etc/inc/api/models/APIInterfaceApplyCreate.inc

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,10 @@ class APIInterfaceApplyCreate extends APIModel {
9191
else {
9292
# Bring down the existing interface on the system if it exists
9393
interface_bring_down($if_to_apply, true, $if_conf);
94-
95-
# Restart DHCP services to remove DHCP server(s) on this interface
96-
if (APIModel::is_config_enabled("dhcpd/{$if_to_apply}") or APIModel::is_config_enabled("dhcpdv6/{$if_to_apply}")) {
97-
services_dhcpd_configure();
98-
}
9994
}
10095

96+
restart_interface_services($if_to_apply, array_get_path($if_conf, 'ifcfg/ipaddrv6'));
97+
10198
# Interfaces with sub-interfaces (e.g. VLANs) need their MTU reconfigured if changed
10299
if (interface_has_clones(get_real_interface($if_to_apply))) {
103100
# When static MTU is set
@@ -126,7 +123,6 @@ class APIInterfaceApplyCreate extends APIModel {
126123
}
127124

128125
# Restart associated/dependent services
129-
services_snmpd_configure();
130126
setup_gateways_monitor();
131127
clear_subsystem_dirty('interfaces');
132128
filter_configure();
@@ -137,14 +133,11 @@ class APIInterfaceApplyCreate extends APIModel {
137133
clear_subsystem_dirty('staticroutes');
138134
}
139135

140-
# Initialize syslog configuration and restart the syslog service
141-
if (APIModel::is_config_enabled("syslog") and $if_to_apply == APIModel::get_config("syslog/sourceip")) {
142-
system_syslogd_start();
143-
}
144-
145136
# After all is said and done, clear the interface subsystem status and remove the pending interface change file
146137
clear_subsystem_dirty('interfaces');
147138
@unlink($g['tmp_path']."/.interfaces.apply");
139+
140+
send_event("service reload packages");
148141
}
149142

150143
# Apply interfaces asynchronously

tests/test_api_v1_interface.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ class APIE2ETestInterface(e2e_test_framework.APIE2ETest):
608608
{
609609
"name": "Disable interface",
610610
"resp_time": 5,
611-
"post_test_callable": "is_if_disabled",
611+
"post_test_callable": "is_if_disabled",
612612
"req_data": {
613613
"id": VLAN_IF,
614614
"descr": "IF_DISABLED_TEST",
@@ -804,7 +804,7 @@ def is_if_disabled(self):
804804

805805
# Loop through each line and check if em2.2 is now disabled
806806
for line in ifconfig_lines:
807-
if line.startswith(f"{VLAN_IF}:") and "UP" in line:
807+
if line.startswith(f"{VLAN_IF}:") and "<UP" in line:
808808
raise AssertionError(f"Expected {VLAN_IF} to be disabled and not UP")
809809

810810

0 commit comments

Comments
 (0)