diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2011-05-25 18:00:54 -0400 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2011-05-25 18:02:05 -0400 |
commit | 474f36d1b277b3e0732496bf0ca8aa1659710809 (patch) | |
tree | 0d5b1a7936751d4a7f1979263d6dbf334821f702 /etc/inc | |
parent | 5c723d9fccffe78e1650c574427100760d0faf5e (diff) | |
download | pfsense-474f36d1b277b3e0732496bf0ca8aa1659710809.zip pfsense-474f36d1b277b3e0732496bf0ca8aa1659710809.tar.gz |
* Add is_ipaddr_configured() so that people do not need to reinvent the wheel for this task
* Check to make sure the administrator is not entering the IP address of the same host preventing a issue where the firewall will sync the voucher database to itself and cause the webConfigurator to crash.
Diffstat (limited to 'etc/inc')
-rw-r--r-- | etc/inc/interfaces.inc | 2 | ||||
-rw-r--r-- | etc/inc/pfsense-utils.inc | 19 |
2 files changed, 19 insertions, 2 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index 393833f..63f380a 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -3728,4 +3728,4 @@ function get_vip_descr($ipaddress) { return ""; } -?> +?>
\ No newline at end of file diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index ca16634..a673685 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -2207,4 +2207,21 @@ function load_mac_manufacturer_table() { } -?> +/****f* pfsense-utils/is_ipaddr_configured + * NAME + * is_ipaddr_configured + * INPUTS + * IP Address to check. + * RESULT + * returns true if the IP Address is + * configured and present on this device. +*/ +function is_ipaddr_configured($ipaddr) { + $interface_list_ips = get_configured_ip_addresses(); + foreach($interface_list_ips as $ilips) { + if(strcasecmp($ipaddr, $ilips) == 0) + return true; + } +} + +?>
\ No newline at end of file |