(RADIATOR) AuthRADIUS <Hosts ..> patch

Hugh Irvine hugh at open.com.au
Mon Feb 5 03:51:11 CST 2007


Hello Bjoern -

Many thanks for your contribution - Mike will look at it tomorrow.

regards

Hugh


On 5 Feb 2007, at 20:43, Bjoern A. Zeeb wrote:

> 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.



NB:

Have you read the reference manual ("doc/ref.html")?
Have you searched the mailing list archive (www.open.com.au/archives/ 
radiator)?
Have you had a quick look on Google (www.google.com)?
Have you included a copy of your configuration file (no secrets),
together with a trace 4 debug showing what is happening?

-- 
Radiator: the most portable, flexible and configurable RADIUS server
anywhere. Available on *NIX, *BSD, Windows, MacOS X.
Includes support for reliable RADIUS transport (RadSec),
and DIAMETER translation agent.
-
Nets: internetwork inventory and management - graphical, extensible,
flexible with hardware, software, platform and database independence.
-
CATool: Private Certificate Authority for Unix and Unix-like systems.


--
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