Resolves: #599528 - make radtest IPv6 compatible

This commit is contained in:
John Dennis 2011-03-23 18:25:17 -04:00
parent b7092d9f3e
commit efd9eca8b1
2 changed files with 68 additions and 1 deletions

View File

@ -0,0 +1,61 @@
--- freeradius-server-2.1.10/src/main/radtest.in.orig 2011-02-14 16:19:05.000000000 -0500
+++ freeradius-server-2.1.10/src/main/radtest.in 2011-02-14 16:24:18.000000000 -0500
@@ -16,6 +16,8 @@
echo " -t <type> Set authentication method" >&2
echo " type can be pap, chap, mschap, or eap-md5" >&2
echo " -x Enable debug output" >&2
+ echo " -4 Use IPv4 address family for the NAS (default)" >&2
+ echo " -6 Use IPv6 address family for the NAS" >&2
exit 1
}
@@ -30,6 +32,7 @@
OPTIONS=
PASSWORD="User-Password"
+family="IPv4"
# We need at LEAST these many options
if [ $# -lt 5 ]
@@ -41,6 +44,14 @@
while [ `echo "$1" | cut -c 1` = "-" ]
do
case "$1" in
+ -4)
+ family="IPv4"
+ shift
+ ;;
+ -6)
+ family="IPv6"
+ shift
+ ;;
-d)
OPTIONS="$OPTIONS -d $2"
shift;shift
@@ -97,10 +108,25 @@
nas=`hostname`
fi
+# Set the address family
+case "$family" in
+ IPv4)
+ OPTIONS="$OPTIONS -4"
+ NAS_ADDR_ATTR="NAS-IP-Address"
+ ;;
+ IPv6)
+ OPTIONS="$OPTIONS -6"
+ NAS_ADDR_ATTR="NAS-IPv6-Address"
+ ;;
+ *)
+ echo "ERROR: unknown address family ($family)" >&2
+ usage
+esac
+
(
echo "User-Name = \"$1\""
echo "$PASSWORD = \"$2\""
- echo "NAS-IP-Address = $nas"
+ echo "$NAS_ADDR_ATTR = $nas"
echo "NAS-Port = $4"
if [ "$radclient" = "$radeapclient" ]
then

View File

@ -1,7 +1,7 @@
Summary: High-performance and highly configurable free RADIUS server
Name: freeradius
Version: 2.1.10
Release: 5%{?dist}
Release: 6%{?dist}
License: GPLv2+ and LGPLv2+
Group: System Environment/Daemons
URL: http://www.freeradius.org/
@ -12,6 +12,7 @@ Source102: freeradius-logrotate
Source103: freeradius-pam-conf
Patch1: freeradius-cert-config.patch
Patch2: freeradius-radtest-ipv6.patch
Obsoletes: freeradius-devel
Obsoletes: freeradius-libs
@ -142,6 +143,7 @@ This plugin provides the unixODBC support for the FreeRADIUS server project.
%prep
%setup -q -n freeradius-server-%{version}
%patch1 -p1 -b .cert-config
%patch2 -p1 -b .radtest-ipv6
# Some source files mistakenly have execute permissions set
find $RPM_BUILD_DIR/freeradius-server-%{version} \( -name '*.c' -o -name '*.h' \) -a -perm /0111 -exec chmod a-x {} +
@ -565,6 +567,10 @@ exit 0
%{_libdir}/freeradius/rlm_sql_unixodbc-%{version}.so
%changelog
=======
* Wed Mar 23 2011 John Dennis <jdennis@redhat.com> - 2.1.10-6
- Resolves: #599528 - make radtest IPv6 compatible
* Wed Mar 23 2011 Dan Horák <dan@danny.cz> - 2.1.10-5
- rebuilt for mysql 5.5.10 (soname bump in libmysqlclient)