Project

General

Profile

« Previous | Next » 

Revision 4d349ede

Added by Ermal LUÇI about 15 years ago

Free ipfw ruleno so it can be reused. Propperly delete passthrough mac entries that are not used.

View differences:

usr/local/captiveportal/index.php
296 296
				if ($_POST['replacemacpassthru']) {
297 297
					foreach ($config['captiveportal']['passthrumac'] as $idx => $macent) {
298 298
						if ($macent['mac'] == $mac['mac']) {
299
							$macrules = "";
300
							$ruleno = captiveportal_get_ipfw_passthru_ruleno($mac['mac']);
301
                                			if ($ruleno) {
302
								captiveportal_free_ipfw_ruleno($ruleno, true);
303
                                        			$macrules .= "delete {$ruleno}";
304
								++$ruleno;
305
                                        			$macrules .= "delete {$ruleno}";
306
                                			}
299 307
							unset($config['captiveportal']['passthrumac'][$idx]);
300 308
							$mac['mac'] = $clientmac;
301 309
							$config['captiveportal']['passthrumac'][] = $mac;

Also available in: Unified diff