Skip to content

Commit 81fac53

Browse files
committed
main/sofia-sip: merged patch that fixes unexpected 482 merged request
See: freeswitch/sofia-sip#211
1 parent a6ba6f4 commit 81fac53

File tree

2 files changed

+72
-2
lines changed

2 files changed

+72
-2
lines changed

main/sofia-sip/APKBUILD

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Maintainer: Francesco Colista <[email protected]>
33
pkgname=sofia-sip
44
pkgver=1.13.14
5-
pkgrel=1
5+
pkgrel=2
66
pkgdesc="RFC3261 compliant SIP User-Agent library"
77
url="https://github.com/freeswitch/sofia-sip"
88
arch="all"
@@ -12,7 +12,8 @@ makedepends="automake autoconf libtool m4
1212
glib-dev openssl-dev>3 lksctp-tools-dev"
1313
checkdepends="check-dev"
1414
subpackages="$pkgname-dev"
15-
source="$pkgname-$pkgver.tar.gz::https://github.com/freeswitch/sofia-sip/archive/v$pkgver.tar.gz"
15+
source="$pkgname-$pkgver.tar.gz::https://github.com/freeswitch/sofia-sip/archive/v$pkgver.tar.gz
16+
fix-unexpected-482-merge-request.patch"
1617

1718
# secfixes:
1819
# 1.13.11-r0:
@@ -51,4 +52,5 @@ doc() {
5152
}
5253
sha512sums="
5354
0a0b30e99251f32a3e4d5c1b0e167ae7cffaf93f2e8b9c84ecc96543181418da000a3bc7ea933da42b2943a66e2cef6c690aeda5504e2ead381c9448c77fcf2c sofia-sip-1.13.14.tar.gz
55+
6763a295be4e450e1806be14f22ab4813af238b6ee75d95dbc20b38f7e98d4aa49b8e67a97007e6a4015f8abf54b5d4ae62e38951762e8701ffa2afe90a049d4 fix-unexpected-482-merge-request.patch
5456
"
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
From 016cfe1b6abe8e96f4bf0b27ed9ed422267bc3ad Mon Sep 17 00:00:00 2001
2+
From: Ilkka Nurlund <[email protected]>
3+
Date: Mon, 10 Apr 2023 06:36:04 +0000
4+
Subject: [PATCH 1/2] nta.c/leg_find: Fix 'by method' leg matching condition
5+
6+
In certain cases 'leg_method' might be null so the IF statement:
7+
8+
if (leg_method && method_name && !su_casematch(method_name, leg_method))
9+
continue;
10+
11+
is not working at all despite 'method_name' is not null. It leads to
12+
leg matching process returns false positive at:
13+
14+
if (loose_match == NULL)
15+
loose_match = leg;
16+
---
17+
libsofia-sip-ua/nta/nta.c | 2 +-
18+
1 file changed, 1 insertion(+), 1 deletion(-)
19+
20+
diff --git a/libsofia-sip-ua/nta/nta.c b/libsofia-sip-ua/nta/nta.c
21+
index e360b7ed..f0ad0539 100644
22+
--- a/libsofia-sip-ua/nta/nta.c
23+
+++ b/libsofia-sip-ua/nta/nta.c
24+
@@ -5120,7 +5120,7 @@ nta_leg_t *leg_find(nta_agent_t const *sa,
25+
26+
if (leg_url && request_uri && url_cmp(leg_url, request_uri))
27+
continue;
28+
- if (leg_method && method_name && !su_casematch(method_name, leg_method))
29+
+ if (leg_method == NULL || method_name && !su_casematch(method_name, leg_method))
30+
continue;
31+
32+
/* Perfect match if both local and To have tag
33+
34+
From 6cf8d6a6e2fb3d7fa10657fd9b9d63017093bce1 Mon Sep 17 00:00:00 2001
35+
From: Ilkka Nurlund <[email protected]>
36+
Date: Mon, 10 Apr 2023 08:13:22 +0000
37+
Subject: [PATCH 2/2] nta.c/incoming_find: Fix "Merged Request" case matching
38+
/RFC3261 8.2.2.2; 17.2.3/
39+
40+
Implements missing matching rules (17.2.3.1 and 17.2.3.2)
41+
---
42+
libsofia-sip-ua/nta/nta.c | 14 ++++++++++----
43+
1 file changed, 10 insertions(+), 4 deletions(-)
44+
45+
diff --git a/libsofia-sip-ua/nta/nta.c b/libsofia-sip-ua/nta/nta.c
46+
index f0ad0539..d6d4d748 100644
47+
--- a/libsofia-sip-ua/nta/nta.c
48+
+++ b/libsofia-sip-ua/nta/nta.c
49+
@@ -6238,10 +6238,16 @@ static nta_incoming_t *incoming_find(nta_agent_t const *agent,
50+
51+
/* RFC3261 - section 8.2.2.2 Merged Requests */
52+
if (return_merge) {
53+
- if (irq->irq_cseq->cs_method == cseq->cs_method &&
54+
- strcmp(irq->irq_cseq->cs_method_name,
55+
- cseq->cs_method_name) == 0)
56+
- *return_merge = irq, return_merge = NULL;
57+
+ /* RFC3261 - section 17.2.3 Matching Requests to Server Transactions */
58+
+ if (irq->irq_via->v_branch &&
59+
+ su_casematch(irq->irq_via->v_branch, v->v_branch) &&
60+
+ su_casematch(irq->irq_via->v_host, v->v_host) &&
61+
+ su_strmatch(irq->irq_via->v_port, v->v_port)) {
62+
+ if (irq->irq_cseq->cs_method == cseq->cs_method &&
63+
+ strcmp(irq->irq_cseq->cs_method_name,
64+
+ cseq->cs_method_name) == 0)
65+
+ *return_merge = irq, return_merge = NULL;
66+
+ }
67+
}
68+
}

0 commit comments

Comments
 (0)