[patch] [regression] freeradius 3.0.4: dhcp module cuts suboption list of option 82

Eugene Grosbein fr at grosbein.net
Fri Oct 24 17:37:24 CEST 2014


Hi!

Today I made another attempt to migrate from freeradius-2.2.2 to latest release 3.0.4.
I use dhcp module and rlm_perl.

I found that radiusd passes DHCP-Relay-Circuit-Id suboption to my perl script
but no DHCP-Relay-Remote-Id suboption.

Long story short: radiusd receives both suboptions and parses them correctly
but stores only first one due to subtle bug. I fixed the problem with the following patch:

--- src/modules/proto_dhcp/dhcp.c.orig	2014-09-10 20:57:22.000000000 +0700
+++ src/modules/proto_dhcp/dhcp.c	2014-10-24 22:08:53.000000000 +0700
@@ -994,7 +994,7 @@ ssize_t fr_dhcp_decode_options(VALUE_PAI
 				pairfree(out);
 				return -1;
 			}
-			fr_cursor_insert(&cursor, vp);
+			fr_cursor_merge(&cursor, vp);
 
 			for (vp = fr_cursor_current(&cursor);
 			     vp;



That is, the function fr_dhcp_decode_options() calls fr_dhcp_attr2vp() to parse list of suboptions
but uses fr_cursor_insert() to store it. fr_cursor_insert stores only first suboption
and fr_cursor_merge should be used instead to store all of suboptions.

With noted fix, freeradius 3.0.4 runs just fine for me.
Some time ago I reported crashes in the perl subsystem - I managed to elimitate them
by abadoning usage of unixODBC/DBD::ODBC for MS SQL access and now use DBD::SyBase with freetds directly.

Thank you for the great release.

Eugene Grosbein


More information about the Freeradius-Users mailing list