Re: [PATCH] Radius accounting proxy thread.

Stipe Tolj <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Organization Wapme Systems AG
Message-ID <[email protected]>
Vjacheslav Chekushin wrote:
> 
> There are some problems in current radius account proxy implementation.
> First, as I mentioned before, is that Kannel RADIUS accounting proxy
> _allways_ forward incoming packets to somewhere (default localhost).
> I don't undestand why? In many cases kannel is the end point for these packets.
> I think that if remote_host not defined, then packets must not be forwarded.
> 
> Second problem is blocking read from UDP sockets. So if you start wapbox and
> then try to stop it, it waits for for packet from RAS forever:
> 
> 2003-10-03 10:03:58 [0] DEBUG: Waiting for 1 (radius/radius_acct.c:proxy_thread)
> to terminate
> 
> And strace show us that wapbox wait data on socket:
> 
> [wapgw@vasdevel wapgw]$ strace -p18071
> recvfrom(11,  <unfinished ...>
> 
> Attached patch solve both problems. Please look at it.
> I send two patches:
> 1) radius_accnt.patch - functionality patch
> 2) radius_accnt_style.patch with style modifications for patched radius_acct.c
> according doc/CodingStyle document. (can be apllied only after first patch)

applied to cvs. Thanks a lot!

> And I still have some questions.
> 1. Persistent storage for mapping.

Yet not implemented. This should use gwlib/dbpool.c's dbpools, ie.
using sqlite. But persistance has some implications: how do you delete
entries after restarting Kannel and meanwhile a STOP packet should
have been received to the RADIUS acct proxy? How does your acct proxy
know about a dead mapping in the table?

> 2. Why session and client table not cleaned when accounting "stop" packet received:
> 2003-10-06 14:09:11 [1] DEBUG: RADIUS: Mapping table contains 5 elements
> 2003-10-06 14:09:11 [1] DEBUG: RADIUS: Session table contains 53 elements
> 2003-10-06 14:09:11 [1] DEBUG: RADIUS: Client table contains 53 elements
> 
> Is it a bug or planned behavior?

good question ;) let's have a review in the code...

Stipe

[email protected]
-------------------------------------------------------------------
Wapme Systems AG

Vogelsanger Weg 80
40470 Düsseldorf

Tel: +49-211-74845-0
Fax: +49-211-74845-299

E-Mail: [email protected]
Internet: http://www.wapme-systems.de
-------------------------------------------------------------------
wapme.net - wherever you are
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.