Skip to content

Commit c4db6cc

Browse files
committed
Merge branch '1.1.10-prep'
2 parents 61d3721 + 0952e7b commit c4db6cc

24 files changed

+1042
-397
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
OpenLI -- open source ETSI-compliant Lawful Intercept software
22

3-
Version: 1.1.9
3+
Version: 1.1.10
44

55
---------------------------------------------------------------------------
66

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Super primitive configure script
22

3-
AC_INIT([openli],[1.1.9],[[email protected]])
3+
AC_INIT([openli],[1.1.10],[[email protected]])
44

55
AM_INIT_AUTOMAKE([subdir-objects])
66
AC_CONFIG_SRCDIR(src/collector/collector.c)

debian/changelog

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,40 @@
1+
openli (1.1.10-1) unstable; urgency=medium
2+
3+
* RADIUS: Accounting Response packets no longer need to be seen by
4+
the collector; session state updates are now inferred from
5+
Accounting Requests automatically without the need to see the
6+
matching Response.
7+
* Collector: using multiple forwarding threads now actually
8+
behaves as expected.
9+
* Collector: support the use of zero GTP, SMS, or email worker
10+
threads. Having no SMS worker threads, in particular, can increase
11+
collector performance for operators who do not require SMS
12+
interception.
13+
* Collector: reduce CPU usage in encoder worker threads when they are idle.
14+
* Collector: improve performance when copying packets to distribute to
15+
other worker threads.
16+
* Collector: reduce CPU usage when checking if a packet matches a
17+
user-specified RADIUS, GTP, or SIP server.
18+
* Voice: fix bug where the RTP stream might not be intercepted if
19+
there are multiple intercepts configured for the same target.
20+
* Mediator: fix bug where a mediator using RabbitMQ would never receive
21+
intercept records from a collector.
22+
* SIP: fix bug where SIP sessions using TCP keepalives would not be
23+
intercepted due to errors in the TCP reassembly code.
24+
* SIP: fix crash caused by incorrectly freeing a packet that had been
25+
claimed by the TCP reassembler.
26+
* SIP: fix bug where SIP messages that do not begin at the start of the
27+
TCP payload would not be intercepted or used to update the call
28+
state.
29+
* SIP: assume TCP packets for a stream are lost forever if the gap between
30+
the expected sequence number and the observed packets exceeds 64KB.
31+
* SIP: reset the SIP and TCP reassembly state for TCP streams where a
32+
packet has been lost or the SIP parser reported an error.
33+
* SIP: fix bug that caused an assertion failure in find_sip_message_end()
34+
when processing a TCP SIP stream after a packet was lost.
35+
36+
-- Shane Alcock <[email protected]> Mon, 04 Nov 2024 11:21:40 +1300
37+
138
openli (1.1.9-1) unstable; urgency=medium
239

340
* RADIUS: fix crash that can occur under very rare circumstances due to

rpm/openli.spec

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Name: openli
2-
Version: 1.1.9
2+
Version: 1.1.10
33
Release: 1%{?dist}
44
Summary: Software for performing ETSI-compliant lawful intercept
55

@@ -283,6 +283,9 @@ fi
283283

284284

285285
%changelog
286+
* Mon Nov 4 2024 Shane Alcock <[email protected]> - 1.1.10-1
287+
- Updated for 1.1.10 release
288+
286289
* Wed Sep 18 2024 Shane Alcock <[email protected]> - 1.1.9-1
287290
- Updated for 1.1.9 release
288291

src/collector/accessplugins/radius.c

Lines changed: 50 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1201,16 +1201,11 @@ static inline void find_matching_request(radius_parsed_t *raddata) {
12011201
uint32_t reqid;
12021202
int rcint, i;
12031203

1204-
if (raddata->msgtype == RADIUS_CODE_ACCOUNT_RESPONSE) {
1205-
reqid = DERIVE_REQUEST_ID(raddata, RADIUS_CODE_ACCOUNT_REQUEST);
1206-
} else {
1207-
reqid = DERIVE_REQUEST_ID(raddata, RADIUS_CODE_ACCESS_REQUEST);
1208-
}
1204+
reqid = DERIVE_REQUEST_ID(raddata, RADIUS_CODE_ACCESS_REQUEST);
12091205

12101206
if (raddata->msgtype == RADIUS_CODE_ACCESS_ACCEPT ||
12111207
raddata->msgtype == RADIUS_CODE_ACCESS_REJECT ||
1212-
raddata->msgtype == RADIUS_CODE_ACCESS_CHALLENGE ||
1213-
raddata->msgtype == RADIUS_CODE_ACCOUNT_RESPONSE) {
1208+
raddata->msgtype == RADIUS_CODE_ACCESS_CHALLENGE) {
12141209

12151210
radius_saved_req_t *req = NULL;
12161211

@@ -1254,6 +1249,11 @@ static user_identity_t *radius_get_userid(access_plugin_t *p UNUSED,
12541249
raddata = (radius_parsed_t *)parsed;
12551250
*numberids = 0;
12561251

1252+
if (raddata->msgtype == RADIUS_CODE_ACCOUNT_RESPONSE) {
1253+
raddata->muser_count = 0;
1254+
return NULL;
1255+
}
1256+
12571257
if (raddata->muser_count == 0) {
12581258
if (!raddata->matchednas) {
12591259
logger(LOG_INFO, "OpenLI RADIUS: please parse the packet before attempting to get the user id.");
@@ -1268,9 +1268,7 @@ static user_identity_t *radius_get_userid(access_plugin_t *p UNUSED,
12681268

12691269
//process_nasport_attribute(raddata);
12701270

1271-
if (raddata->msgtype == RADIUS_CODE_ACCESS_REQUEST ||
1272-
raddata->msgtype == RADIUS_CODE_ACCOUNT_REQUEST) {
1273-
1271+
if (raddata->msgtype == RADIUS_CODE_ACCESS_REQUEST) {
12741272
if (raddata->muser_count == 0) {
12751273
return NULL;
12761274
}
@@ -1328,12 +1326,18 @@ static inline void apply_fsm_logic(
13281326
/* TODO figure out what Access-Failed is, since it is in the ETSI spec */
13291327
if ((radsess->current == SESSION_STATE_NEW ||
13301328
radsess->current == SESSION_STATE_OVER) && (
1331-
msgtype == RADIUS_CODE_ACCESS_REQUEST ||
1332-
(msgtype == RADIUS_CODE_ACCOUNT_REQUEST &&
1333-
accttype == RADIUS_ACCT_START))) {
1329+
msgtype == RADIUS_CODE_ACCESS_REQUEST)) {
13341330

13351331
radsess->current = SESSION_STATE_AUTHING;
13361332
*action = ACCESS_ACTION_ATTEMPT;
1333+
} else if ((radsess->current == SESSION_STATE_NEW ||
1334+
radsess->current == SESSION_STATE_OVER) && (
1335+
msgtype == RADIUS_CODE_ACCOUNT_REQUEST &&
1336+
accttype == RADIUS_ACCT_START)) {
1337+
1338+
radsess->current = SESSION_STATE_ACTIVE;
1339+
*action = ACCESS_ACTION_ACCEPT;
1340+
13371341
} else if (radsess->current == SESSION_STATE_AUTHING && (
13381342
msgtype == RADIUS_CODE_ACCESS_REJECT)) {
13391343

@@ -1346,24 +1350,15 @@ static inline void apply_fsm_logic(
13461350
radsess->current = SESSION_STATE_AUTHING;
13471351
*action = ACCESS_ACTION_RETRY;
13481352

1349-
} else if (radsess->current == SESSION_STATE_AUTHING && (
1350-
msgtype == RADIUS_CODE_ACCOUNT_REQUEST &&
1351-
accttype == RADIUS_ACCT_STOP)) {
1352-
1353-
radsess->current = SESSION_STATE_OVER;
1354-
*action = ACCESS_ACTION_FAILED;
1355-
1356-
} else if (radsess->current == SESSION_STATE_AUTHING && (
1357-
msgtype == RADIUS_CODE_ACCESS_ACCEPT ||
1358-
(msgtype == RADIUS_CODE_ACCOUNT_RESPONSE &&
1359-
accttype == RADIUS_ACCT_START))) {
1353+
} else if (radsess->current == SESSION_STATE_AUTHING &&
1354+
msgtype == RADIUS_CODE_ACCESS_ACCEPT) {
13601355

13611356
radsess->current = SESSION_STATE_ACTIVE;
13621357
*action = ACCESS_ACTION_ACCEPT;
13631358

13641359
} else if ((radsess->current == SESSION_STATE_ACTIVE ||
13651360
radsess->current == SESSION_STATE_ACTIVE_NO_IP) &&
1366-
(msgtype == RADIUS_CODE_ACCOUNT_RESPONSE &&
1361+
(msgtype == RADIUS_CODE_ACCOUNT_REQUEST &&
13671362
(accttype == RADIUS_ACCT_START ||
13681363
accttype == RADIUS_ACCT_INTERIM_UPDATE))) {
13691364

@@ -1375,15 +1370,15 @@ static inline void apply_fsm_logic(
13751370

13761371
} else if ((radsess->current == SESSION_STATE_ACTIVE ||
13771372
radsess->current == SESSION_STATE_ACTIVE_NO_IP) &&
1378-
(msgtype == RADIUS_CODE_ACCOUNT_RESPONSE &&
1373+
(msgtype == RADIUS_CODE_ACCOUNT_REQUEST &&
13791374
accttype == RADIUS_ACCT_STOP)) {
13801375

13811376
radsess->current = SESSION_STATE_OVER;
13821377
*action = ACCESS_ACTION_END;
13831378

13841379
} else if ((radsess->current == SESSION_STATE_NEW ||
13851380
radsess->current == SESSION_STATE_OVER) && (
1386-
msgtype == RADIUS_CODE_ACCOUNT_RESPONSE &&
1381+
msgtype == RADIUS_CODE_ACCOUNT_REQUEST &&
13871382
accttype == RADIUS_ACCT_INTERIM_UPDATE)) {
13881383

13891384
/* session was already underway when we started the intercept,
@@ -1552,7 +1547,7 @@ static inline void update_first_action(radius_parsed_t *raddata,
15521547
/* handle rare case where assigned IPs were missing from access
15531548
* accept message -- seen this in the wild */
15541549
raddata->firstattrs = raddata->savedreq->attrs;
1555-
if (raddata->msgtype == RADIUS_CODE_ACCOUNT_RESPONSE &&
1550+
if (raddata->msgtype == RADIUS_CODE_ACCOUNT_REQUEST &&
15561551
raddata->accttype == RADIUS_ACCT_START &&
15571552
sess->sessipcount == 0) {
15581553
extract_assigned_ip_address(raddata, raddata->firstattrs,
@@ -1579,14 +1574,6 @@ static inline void update_second_action(radius_parsed_t *raddata,
15791574
TIMESTAMP_TO_TV((&(sess->started)), raddata->savedresp->tvsec);
15801575
return;
15811576

1582-
} else if ((raddata->secondaction == ACCESS_ACTION_ACCEPT ||
1583-
raddata->secondaction == ACCESS_ACTION_ALREADY_ACTIVE) &&
1584-
raddata->savedresp->resptype == RADIUS_CODE_ACCOUNT_RESPONSE) {
1585-
1586-
raddata->secondattrs = raddata->attrs;
1587-
extract_assigned_ip_address(raddata, raddata->secondattrs, sess);
1588-
TIMESTAMP_TO_TV((&(sess->started)), raddata->savedresp->tvsec);
1589-
return;
15901577
}
15911578

15921579
switch(raddata->secondaction) {
@@ -1609,7 +1596,9 @@ static access_session_t *radius_update_session_state(access_plugin_t *p,
16091596
radius_user_t *raduser = (radius_user_t *)plugindata;
16101597
access_session_t *thissess;
16111598
radius_user_session_t *usess;
1599+
radius_saved_req_t *req = NULL;
16121600

1601+
uint32_t reqid;
16131602
char sessionid[5000];
16141603
char tempstr[24];
16151604
char *ptr;
@@ -1648,11 +1637,33 @@ static access_session_t *radius_update_session_state(access_plugin_t *p,
16481637
strlen(thissess->sessionid), thissess);
16491638
}
16501639

1651-
if (raddata->msgtype == RADIUS_CODE_ACCESS_REQUEST ||
1652-
raddata->msgtype == RADIUS_CODE_ACCOUNT_REQUEST) {
1640+
if (raddata->msgtype == RADIUS_CODE_ACCOUNT_REQUEST) {
1641+
if (glob->freeaccreqs == NULL) {
1642+
req = (radius_saved_req_t *)malloc(
1643+
sizeof(radius_saved_req_t));
1644+
} else {
1645+
req = glob->freeaccreqs;
1646+
glob->freeaccreqs = req->next;
1647+
}
1648+
reqid = DERIVE_REQUEST_ID(raddata, raddata->msgtype);
1649+
1650+
req->reqid = reqid;
1651+
req->statustype = raddata->accttype;
1652+
req->acctsess_hash = raddata->acctsess_hash;
1653+
req->tvsec = raddata->tvsec;
1654+
req->next = NULL;
1655+
req->attrs = raddata->attrs;
1656+
req->targetuser_count = raddata->muser_count;
1657+
req->active_targets = raddata->muser_count;
1658+
memcpy(req->targetusers, raddata->matchedusers,
1659+
sizeof(radius_user_t *) * USER_IDENT_MAX);
1660+
1661+
raddata->savedreq = req;
1662+
}
1663+
1664+
if (raddata->msgtype == RADIUS_CODE_ACCESS_REQUEST) {
16531665

16541666
/* Save the request so we can match the reply later on */
1655-
radius_saved_req_t *req = NULL;
16561667
radius_saved_req_t *check = NULL;
16571668

16581669
radius_orphaned_resp_t *orphan = NULL;
@@ -1664,7 +1675,6 @@ static access_session_t *radius_update_session_state(access_plugin_t *p,
16641675
if (orphan) {
16651676
raddata->savedresp = orphan;
16661677
} else if (!raddata->savedresp) {
1667-
uint32_t reqid;
16681678
reqid = DERIVE_REQUEST_ID(raddata, raddata->msgtype);
16691679

16701680
HASH_FIND(hh, raddata->matchednas->request_map, &(reqid),

0 commit comments

Comments
 (0)