From 82c456c0c5fa6299c3b130fb66f5b9f252bd7539 Mon Sep 17 00:00:00 2001 From: Sebastian Reimers Date: Mon, 6 Nov 2023 09:24:36 +0100 Subject: [PATCH 1/2] sip/transp: add fallback addr --- src/sip/transp.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/sip/transp.c b/src/sip/transp.c index eb7717b3e..c63940a8b 100644 --- a/src/sip/transp.c +++ b/src/sip/transp.c @@ -792,8 +792,18 @@ static int conn_send(struct sip_connqent **qentp, struct sip *sip, bool secure, if (err) goto out; - if (connh) + /* Fallback check for any address win32 */ + if (!sa_isset(&conn->laddr, SA_ALL)) { + err = sip_transp_laddr(sip, &conn->laddr, conn->tp, dst); + if (err) + goto out; + } + + if (connh) { err = connh(&conn->laddr, dst, mb, arg); + if (err) + goto out; + } (void)tcp_conn_settos(conn->tc, sip->tos); #ifdef USE_TLS From a0606b4e9246c0f1259dcb281ff4b254f5b59bfa Mon Sep 17 00:00:00 2001 From: Sebastian Reimers Date: Mon, 6 Nov 2023 11:28:14 +0100 Subject: [PATCH 2/2] restore via port --- src/sip/transp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/sip/transp.c b/src/sip/transp.c index c63940a8b..ada515522 100644 --- a/src/sip/transp.c +++ b/src/sip/transp.c @@ -794,9 +794,13 @@ static int conn_send(struct sip_connqent **qentp, struct sip *sip, bool secure, /* Fallback check for any address win32 */ if (!sa_isset(&conn->laddr, SA_ALL)) { + uint16_t port = sa_port(&conn->laddr); err = sip_transp_laddr(sip, &conn->laddr, conn->tp, dst); if (err) goto out; + + if (port) + sa_set_port(&conn->laddr, port); } if (connh) {