diff options
author | Renato Botelho <garga@FreeBSD.org> | 2013-05-09 08:03:18 -0300 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2013-05-09 08:05:13 -0300 |
commit | 19341491e34d2f003284cb7df03cad920116d196 (patch) | |
tree | b6c3792d8b115faadf6ea1b942200ba07f495003 /etc/inc | |
parent | 5c8cbb2600972334f83d724a2faedcbcb3834cd3 (diff) | |
download | pfsense-19341491e34d2f003284cb7df03cad920116d196.zip pfsense-19341491e34d2f003284cb7df03cad920116d196.tar.gz |
Create is_linklocal() to validate ll addresses
Diffstat (limited to 'etc/inc')
-rw-r--r-- | etc/inc/util.inc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/etc/inc/util.inc b/etc/inc/util.inc index 0cce818..acd3fc3 100644 --- a/etc/inc/util.inc +++ b/etc/inc/util.inc @@ -494,6 +494,10 @@ function is_ipaddrv4($ipaddr) { return false; } +/* returns true if $ipaddr is a valid linklocal address */ +function is_linklocal($ipaddr) { + return preg_match('/^fe80:/i', $ipaddr); +} /* returns true if $ipaddr is a valid literal IPv6 address */ function is_literalipaddrv6($ipaddr) { |