Project

General

Profile

« Previous | Next » 

Revision f86fa91c

Added by Jim Pingle over 13 years ago

Take routing table into account when figuring out which IP address to use for talking to CP clients.

View differences:

etc/inc/captiveportal.inc
1571 1571
			return $ip;
1572 1572
	}
1573 1573

  
1574
	$iface = exec_command("/sbin/route -n get {$cliip} | /usr/bin/awk '/interface/ { print \$2; };'");
1575
	$iface = trim($iface, "\n");
1576
	if (!empty($iface)) {
1577
		$ip = find_interface_ip($iface);
1578
		if (is_ipaddr($ip))
1579
			return $ip;
1580
	}
1581

  
1574 1582
	// doesn't match up to any particular interface
1575 1583
	// so let's set the portal IP to what PHP says 
1576 1584
	// the server IP issuing the request is. 

Also available in: Unified diff