Wang Tinggong | 1 Feb 10:51 2010
Picon

[PATCH] radiusd.h: fix error "expected specifier-qualifier-list before 'RADCLIENT' "

Signed-off-by: Wang Tinggong <wangtinggong <at> gmail.com>
---
 src/include/radiusd.h |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/src/include/radiusd.h b/src/include/radiusd.h
index 8ec5bbb..486cbe0 100644
--- a/src/include/radiusd.h
+++ b/src/include/radiusd.h
 <at>  <at>  -104,9 +104,6  <at>  <at>  typedef struct auth_req REQUEST;

 typedef struct radclient_list RADCLIENT_LIST;

-#include <freeradius-devel/smodule.h>
-
-
 /*
  *	See util.c
  */
 <at>  <at>  -153,6 +150,7  <at>  <at>  typedef struct radclient {
 #endif
 } RADCLIENT;

+#include <freeradius-devel/smodule.h>

 /*
  *	For listening on multiple IP's and ports.
--

-- 
1.6.0.6
-
(Continue reading)

Wang Tinggong | 1 Feb 10:52 2010
Picon

[PATCH] event.c: eliminate warning "‘maxfd’ may be used uninitialized"

Signed-off-by: Wang Tinggong <wangtinggong <at> gmail.com>
---
 src/lib/event.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/lib/event.c b/src/lib/event.c
index 84a928b..6f91661 100644
--- a/src/lib/event.c
+++ b/src/lib/event.c
 <at>  <at>  -322,13 +322,13  <at>  <at>  int fr_event_loop(fr_event_list_t *el)
 	el->exit = 0;
 	el->dispatch = 1;
 	el->changed = 1;
+	maxfd = 0;

 	while (!el->exit) {
 		/*
 		 *	Cache the list of FD's to watch.
 		 */
 		if (el->changed) {
-			maxfd = 0;
 			FD_ZERO(&master_fds);
 			
 			for (i = 0; i < el->max_readers; i++) {
--

-- 
1.6.0.6
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/devel.html

(Continue reading)

Wang Tinggong | 1 Feb 10:53 2010
Picon

[PATCH] tcp.c: elimiate warining "format '%ld', but argument has type 'ssize_t'

Signed-off-by: Wang Tinggong <wangtinggong <at> gmail.com>
---
 src/lib/tcp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/lib/tcp.c b/src/lib/tcp.c
index 2f0946b..4a691c1 100644
--- a/src/lib/tcp.c
+++ b/src/lib/tcp.c
 <at>  <at>  -323,7 +323,7  <at>  <at>  int fr_tcp_read_packet(RADIUS_PACKET *packet, int flags)
 			DEBUG("rad_recv: Packet from %s code=%d",
 			      buffer, packet->code);
 		}
-		DEBUG(", id=%d, length=%ld\n", packet->id, packet->data_len);
+		DEBUG(", id=%d, length=%d\n", packet->id, packet->data_len);
 	}

 	return 1;		/* done reading the packet */
--

-- 
1.6.0.6
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/devel.html

Alan DeKok | 1 Feb 11:02 2010

Re: [PATCH] radiusd.h: fix error "expected specifier-qualifier-list before 'RADCLIENT' "

  Please do not CC me on messages to this list.  I already subscribe.
Getting two copies of the same message is annoying.

  Alan DeKok.
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/devel.html

WANG Tinggong | 1 Feb 11:06 2010
Picon

git tree build error

hi all,

i got the latest freeRadius tree from git://git.freeradius.org/freeradius-server.git , and i try to
compile it under these steps:
	1. ./configure
	2. make
after that, i encountered an error:
In file included from /home/wtg/develop/freeradius-server/src/freeradius-devel/radiusd.h:154,
                 from frs_acct.c:30:
/home/wtg/develop/freeradius-server/src/freeradius-devel/smodule.h:146: error: expected
specifier-qualifier-list before ‘fr_tcp_radius_t’

git-log says after commit e04b62, fr_tcp_radius_t structure and API are deleted, but it still stay in 
src/main/listen.c
src/include/smodule.h

is it a bug?

-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/devel.html
Alex Massover | 1 Feb 11:11 2010

freeradius-client sequence file replacement

Hello,

 

I made a patch that adds fast locking mechanisms instead of seq file for freeradius-client.

 

This patch is based on putting the sequence number in the shared memory. Two approaches used to do a mutual exclusion for shared memory:

a) GCC builtin atomic memory access (only on Intel)

b) POSIX named semaphore

Fallback:

c) If nothing of the above available it fallbacks to a sequence file locks.

 

Originally I did it against radiusclient-ng, but looks that freeradius-client is a correct place. The patch works for freeradius-client 1.1.6 as well.

 

Here’s a patch and more detailed description:

 

http://developer.berlios.de/patch/?func=detailpatch&patch_id=2810&group_id=1208

 

--

Best Regards,

Alex Massover

VoIP R&D TL

Jajah Inc.

 



This mail was sent via Mail-SeCure System.
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/devel.html
Alex Massover | 1 Feb 11:25 2010

freeradius-client rc_avpair_log() function

Hi,

 

AFAIU, rc_avpair_log() function in freeradius-client is not thread-safe, it uses a shared buffer (rh->ppbuf).

 

So one can’t have shared rc_handle if calling to rc_avpair_log() from different threads.

 

Please tell me if that’s correct and I’ll make a simple patch changing:

 

rc_avpair_log(rc_handle *rh, VALUE_PAIR *pair)

to

rc_avpair_log(rc_handle *rh, VALUE_PAIR *pair, char *buf, size_t l)

 

This way a caller will provide a non-shared buffer.

 

--

Best Regards,

Alex Massover

VoIP R&D TL

Jajah Inc.

 



This mail was sent via Mail-SeCure System.
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/devel.html
Alan Buxey | 1 Feb 11:24 2010
Picon

Re: git tree build error

Hi,

> git-log says after commit e04b62, fr_tcp_radius_t structure and API are deleted, but it still stay in 
> src/main/listen.c
> src/include/smodule.h

I recall that you've submitted some patches for these files - in which case you have
local copies of those files that you have played with and are therefore locked
and so you wont get new versions - you need to use the tools in GIT to make
our own branch for your work....

ie download a fresh GIT copy and you'll get the new versions of those...

alan
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/devel.html

Alan DeKok | 1 Feb 11:29 2010

Re: freeradius-client rc_avpair_log() function

Alex Massover wrote:
> Please tell me if that’s correct and I’ll make a simple patch changing:
>  
> rc_avpair_log(rc_handle *rh, VALUE_PAIR *pair)
> 
> to
> 
> rc_avpair_log(rc_handle *rh, VALUE_PAIR *pair, char *buf, size_t l)

  That's a good idea, thanks.

  Alan DeKok.
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/devel.html
Alan DeKok | 1 Feb 11:36 2010

Re: freeradius-client sequence file replacement

Alex Massover wrote:
> I made a patch that adds fast locking mechanisms instead of seq file for
> freeradius-client.

  OK... I just re-read the original code, and boggled a bit.  Using a
file for a sequence number is completely wrong.  There is just no need.

  I'd suggest two patches:

 1) replace "seq_nbr" in the code with "id".  The field is NOT a
    sequence number.  it's a random id.  The ONLY requirement
    is that it's unique until the outgoing packet times out,
    or a reply is received.

 2) replace the rc_get_seqnbr() with a function that tracks 256
    allocated IDs, and allocates a free one.  Also update
    rc_check_reply() to mark the "id" as free.

  This will be *enormously* faster than using a file or shared memory.

  The array of 256 Ids needs to be unique per source port.  But it can
be shared across child threads.  It does NOT need to be shared across
multiple processes.

  The main server code does it a little differently.  See
src/lib/packet.c for a number of functions that track/allocate/free
packet Ids.

  Alan DeKok.
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/devel.html


Gmane