(RADIATOR) AuthRADIUS <Hosts ..> patch

Bjoern A. Zeeb bz-lists at cksoft.de
Mon Feb 5 03:43:11 CST 2007


Hi,

while doing some consulting work on Radiator we found that one cannot
configure LocalAddress inside a <Host ..> clause of an <AuthBy RADIUS>.

Attached patch allows you configure a LocalAddress per Host an fall back
to the one from the AuthBy clause which falls back to the global
setting. In addition it allows OutPort to be configurable per Host
in the same way.

Seemed to work with both <Host ..> clauses and Host entries directly in
the AuthBy clause. If it looks ok to you too feel free to add it to the
next patchset and update the documentation.


Regards
Bjoern


--- AuthRADIUS.pm.orig	Thu Feb  1 11:33:57 2007
+++ AuthRADIUS.pm	Thu Feb  1 11:58:38 2007
@@ -288 +288 @@ sub getSock
-    my ($self, $dest_addr) = @_;
+    my ($self, $dest_addr, $host) = @_;
@@ -291 +291 @@ sub getSock
-    my @bind_address = split(/\s*,\s*/, &Radius::Util::format_special($self->{LocalAddress}));
+    my @bind_address = split(/\s*,\s*/, &Radius::Util::format_special($host->{LocalAddress}));
@@ -305 +305 @@ sub getSock
-	$thisaddr = &Socket6::pack_sockaddr_in6(&Radius::Util::get_port($self->{OutPort}), 
+	$thisaddr = &Socket6::pack_sockaddr_in6(&Radius::Util::get_port($host->{OutPort}), 
@@ -321 +321 @@ sub getSock
-	$thisaddr = scalar &Socket::sockaddr_in(&Radius::Util::get_port($self->{OutPort}), Socket::inet_aton($localaddr));
+	$thisaddr = scalar &Socket::sockaddr_in(&Radius::Util::get_port($host->{OutPort}), Socket::inet_aton($localaddr));
@@ -867 +867 @@ sub sendHost
-    $fp->{SendSocket} = $self->getSock($addr);
+    $fp->{SendSocket} = $self->getSock($addr, $host);
@@ -904,0 +905,2 @@ sub addHost
+	 'LocalAddress'               => $self->{LocalAddress},
+	 'OutPort'                    => $self->{OutPort},
@@ -945,0 +948,2 @@ package Radius::Host;
+     'LocalAddress'               => 'string',
+     'OutPort'                    => 'string',
@@ -998,0 +1003 @@ sub initialize
+    $self->{OutPort} = 0;

-- 
Dipl. Ing. (BA) Bjoern A. Zeeb          bjoern.zeeb at cksoft.de
CK Software GmbH                        Research & Development
Schwarzwaldstr. 31                      Phone: +49 7452 889 135
D-71131 Jettingen                       Fax: +49 7452 889 136
HRB245288, Amtsgericht Stuttgart        http://www.cksoft.de/
Geschaeftsfuehrer: Christian Kratzer

--
Archive at http://www.open.com.au/archives/radiator/
Announcements on radiator-announce at open.com.au
To unsubscribe, email 'majordomo at open.com.au' with
'unsubscribe radiator' in the body of the message.


More information about the radiator mailing list