Project

General

Profile

« Previous | Next » 

Revision cff5204a

Added by Ermal LUÇI over 13 years ago

Correct the Called-Station-Id attribute setting to be the same on STOP/START packets

View differences:

usr/local/captiveportal/radius_accounting.inc
42 42
	pfSense_MODULE:	captiveportal
43 43
*/
44 44

  
45

  
46
/**
47
 * Get the NAS-IP-Address based on the current wan address
48
 *
49
 * Use functions in interfaces.inc to find this out
50
 *
51
 */
52
if (!function_exists('getNasIP')) {
53
	function getNasIP()
54
	{
55
		global $config, $cpzone;
56

  
57
		if (empty($config['captiveportal'][$cpzone]['radiussrcip_attribute'])) {
58
				$nasIp = get_interface_ip();
59
		} else {
60
			if (is_ipaddr($config['captiveportal'][$cpzone]['radiussrcip_attribute']))
61
				$nasIp = $config['captiveportal'][$cpzone]['radiussrcip_attribute'];
62
			else
63
				$nasIp = get_interface_ip($config['captiveportal'][$cpzone]['radiussrcip_attribute']);
64
		}
65

  
66
		if(!is_ipaddr($nasIp))
67
			$nasIp = "0.0.0.0";
68

  
69
		return $nasIp;
70
	}
71
}
72

  
45 73
/*
46 74
RADIUS ACCOUNTING START 
47 75
-----------------------
......
67 95
        break;
68 96

  
69 97
        default:
70
	if (is_ipaddr($config['captiveportal'][$cpzone]['radiussrcip_attribute']))
71
            $calledstationid = $config['captiveportal'][$cpzone]['radiussrcip_attribute'];
72
        else
73
                $calledstationid = get_interface_ip($config['captiveportal'][$cpzone]['radiussrcip_attribute']);
74
            $callingstationid = $clientmac;
98
	$calledstationid = getNasIP();
75 99
        $callingstationid = $clientmac;
100
	break;
76 101
    }
77 102

  
78 103
    // Create our instance
......
189 214
        break;
190 215

  
191 216
        default:
192
        $calledstationid = get_interface_ip("wan");
217
	$calledstationid = getNasIP();
193 218
        $callingstationid = $clientmac;
219
	break;
194 220
    }
195 221

  
196 222
    // Create our instance, see if we should use Accounting Interim Updates or Accounting STOP messages

Also available in: Unified diff