diff options
author | Ermal Luçi <eri@pfsense.org> | 2008-07-15 14:58:28 +0000 |
---|---|---|
committer | Ermal Luçi <eri@pfsense.org> | 2008-07-15 14:58:28 +0000 |
commit | 63161b3f6048b640827c0771fae1f82592f52f01 (patch) | |
tree | a792d229e9c8053f4487763a49eedcb7174f3ed6 | |
parent | c25a6b6aed5db2393a976b1fcef60137cf83979f (diff) | |
download | pfsense-63161b3f6048b640827c0771fae1f82592f52f01.zip pfsense-63161b3f6048b640827c0771fae1f82592f52f01.tar.gz |
Correctly show interface addresses on Status->Interfaces page
-rw-r--r-- | etc/inc/pfsense-utils.inc | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index d45fd64..8c91c02 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -3692,7 +3692,7 @@ function get_interface_info($ifdescr) { $ifinfo['status'] = "up"; } - if (!strstr($ifinfo['if'],'tun')) { + if (!strstr($ifinfo['if'],'ovpn')) { $ifinfo['macaddr'] = $linkinfo[3]; $ifinfo['inpkts'] = $linkinfo[4]; $ifinfo['inerrs'] = $linkinfo[5]; @@ -3708,6 +3708,17 @@ function get_interface_info($ifdescr) { $ifinfo['outbytes'] = $linkinfo[8]; } + $ifconfiginfo = ""; + unset($ifconfiginfo); + exec("/sbin/ifconfig " . $ifinfo['if'], $ifconfiginfo); + foreach ($ifconfiginfo as $ici) { + if (preg_match("/inet (\S+)/", $ici, $matches)) + $ifinfo['ipaddr'] = $matches[1]; + if (preg_match("/netmask (\S+)/", $ici, $matches)) + if (preg_match("/^0x/", $matches[1])) + $ifinfo['subnet'] = long2ip(hexdec($matches[1])); + } + switch ($config['interfaces'][$if]['ipaddr']) { /* DHCP? -> see if dhclient is up */ case "dhcp": @@ -3717,6 +3728,7 @@ function get_interface_info($ifdescr) { $ifinfo['dhcplink'] = "up"; else $ifinfo['dhcplink'] = "down"; + break; /* PPPoE interface? -> get status from virtual interface */ case "pppoe": @@ -3727,21 +3739,11 @@ function get_interface_info($ifdescr) { $ifinfo['pppoelink'] = "down"; } else { /* get PPPoE link status for dial on demand */ - $ifconfiginfo = ""; - unset($ifconfiginfo); - exec("/sbin/ifconfig " . $ifinfo['if'], $ifconfiginfo); - $ifinfo['pppoelink'] = "up"; foreach ($ifconfiginfo as $ici) { if (strpos($ici, 'LINK0') !== false) $ifinfo['pppoelink'] = "down"; - - if (preg_match("/inet (\S+)/", $ici, $matches)) - $ifinfo['ipaddr'] = $matches[1]; - if (preg_match("/netmask (\S+)/", $ici, $matches)) - if (preg_match("/^0x/", $matches[1])) - $ifinfo['subnet'] = long2ip(hexdec($matches[1])); } } break; @@ -3754,23 +3756,16 @@ function get_interface_info($ifdescr) { $ifinfo['pptplink'] = "down"; } else { /* get PPTP link status for dial on demand */ - unset($ifconfiginfo); - exec("/sbin/ifconfig " . $ifinfo['if'], $ifconfiginfo); - $ifinfo['pptplink'] = "up"; foreach ($ifconfiginfo as $ici) { if (strpos($ici, 'LINK0') !== false) $ifinfo['pptplink'] = "down"; - - if (preg_match("/inet (\S+)/", $ici, $matches)) - $ifinfo['ipaddr'] = $matches[1]; - if (preg_match("/netmask (\S+)/", $ici, $matches)) - if (preg_match("/^0x/", $matches[1])) - $ifinfo['subnet'] = long2ip(hexdec($matches[1])); } } break; + default: + break; } if ($ifinfo['status'] == "up") { |