Revision b9064a4d
Added by Seth Mos about 16 years ago
etc/inc/pfsense-utils.inc | ||
---|---|---|
3036 | 3036 |
unset($ifconfiginfo, $link0); |
3037 | 3037 |
exec("/sbin/ifconfig " . $ifinfo['if'], $ifconfiginfo); |
3038 | 3038 |
foreach ($ifconfiginfo as $ici) { |
3039 |
if (preg_match("/inet (\S+)/", $ici, $matches)) |
|
3039 |
if (preg_match("/inet (\S+)/", $ici, $matches)) {
|
|
3040 | 3040 |
$ifinfo['ipaddr'] = $matches[1]; |
3041 |
else if (preg_match("/netmask (\S+)/", $ici, $matches)) |
|
3042 |
if (preg_match("/^0x/", $matches[1])) |
|
3041 |
} |
|
3042 |
if (preg_match("/netmask (\S+)/", $ici, $matches)) { |
|
3043 |
if (preg_match("/^0x/", $matches[1])) { |
|
3043 | 3044 |
$ifinfo['subnet'] = long2ip(hexdec($matches[1])); |
3044 |
if (strpos($ici, 'LINK0') !== false) |
|
3045 |
} |
|
3046 |
} |
|
3047 |
if (strpos($ici, 'LINK0') !== false) { |
|
3045 | 3048 |
$link0 = "down"; |
3049 |
} |
|
3046 | 3050 |
} |
3047 | 3051 |
|
3048 | 3052 |
switch ($config['interfaces'][$if]['ipaddr']) { |
... | ... | |
3509 | 3513 |
} |
3510 | 3514 |
|
3511 | 3515 |
|
3512 |
?> |
|
3516 |
?> |
Also available in: Unified diff
Reverse style fixes to get our subnet mask listed backed from get_interface_info()