Changeset 536:f95cfc35d960 in freeDiameter
- Timestamp:
- Sep 10, 2010, 10:59:14 AM (14 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/app_radgw/rgwx_acct.c
r535 r536 159 159 int send_str; /* If not 0, we must send a STR when the ACA is received. */ 160 160 uint32_t term_cause; /* If not 0, the Termination-Cause to put in the STR. */ 161 /* Temporary : try sending the User-Name back in Accounting-Response for RADIUS */ 162 uint8_t *username; 163 size_t un_size; 161 164 }; 165 166 static void free_sess_state(struct sess_state *s) { 167 if (s) 168 free(s->username); 169 free(s); 170 } 162 171 163 172 /* Initialize the plugin */ … … 173 182 memset(new, 0, sizeof(struct rgwp_config)); 174 183 175 CHECK_FCT( fd_sess_handler_create( &new->sess_hdl, free ) );184 CHECK_FCT( fd_sess_handler_create( &new->sess_hdl, free_sess_state ) ); 176 185 new->confstr = conffile; 177 186 … … 1187 1196 } 1188 1197 st->term_cause = str_cause; 1198 if (un && un_len) { 1199 CHECK_MALLOC( st->username = malloc(un_len) ); 1200 memcpy(st->username, un, un_len); 1201 st->un_size = un_len; 1202 } 1189 1203 CHECK_FCT( fd_sess_state_store( cs->sess_hdl, *session, &st ) ); 1190 1204 } … … 1353 1367 Specific. 1354 1368 */ 1369 1370 /* Well, it seems some devices are expecting the user name ??? */ 1371 if (st->username) { 1372 CHECK_MALLOC(radius_msg_add_attr(*rad_fw, RADIUS_ATTR_USER_NAME, st->username, st->un_size)); 1373 } 1355 1374 1356 1375 /* Now loop in the list of AVPs and convert those that we know how */ … … 1425 1444 -- done in radius_msg_finish_srv 1426 1445 */ 1446 1447 free_sess_state(st); 1427 1448 1428 1449 return 0;
Note: See TracChangeset
for help on using the changeset viewer.