Project

General

Profile

« Previous | Next » 

Revision 6cdd2fda

Added by Viktor Gurov over 3 years ago

pfanchordrill Captive Portal anchors support. Fixes #13142

View differences:

src/etc/phpshellsessions/pfanchordrill
19 19
 * limitations under the License.
20 20
 */
21 21
/* Recursively check anchors for rules/nat and also for anchors inside anchors (like those used by UPnP) */
22

  
23
include_once('globals.inc');
24

  
22 25
function anchor_recurse($name = '') {
23 26
	$anchor_list = "";
24 27
	if ($name) {
......
28 31
	foreach ($anchor_list as $anchor) {
29 32
		$anchor = trim($anchor);
30 33
		echo "\n{$anchor} rules/nat contents:\n";
31
		system("/sbin/pfctl -a " . escapeshellarg($anchor) . " -sn");
32
		system("/sbin/pfctl -a " . escapeshellarg($anchor) . " -sr");
34
		if (strpos($anchor, CPPREFIX) !== false) {
35
			system("/sbin/pfctl -a " . escapeshellarg($anchor) . " -se");
36
		} else {
37
			system("/sbin/pfctl -a " . escapeshellarg($anchor) . " -sn");
38
			system("/sbin/pfctl -a " . escapeshellarg($anchor) . " -sr");
39
		}
33 40
		anchor_recurse($anchor);
34 41
	}
35 42
}

Also available in: Unified diff