From b437f80e89f701fbc09d8dd449f20b33d65bf5e7 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Mon, 28 Aug 2023 13:56:25 +0200 Subject: [PATCH] socket: Avoid aborting socket creation if setsockopt for ASCONF fails Avoid aborting the entire socket creation, since those sockopt are fairly new in the kernel (v5.4), and the feature can still be enabled in older versions system-wide with sysctl. The worst it can happen is that the ability to submit address updates (such as Peer Primary Address) doesn't work, which is not really critical. Related: SYS#6501 Change-Id: Iff261c8592b6b3c4237c90c84b4e8e921e3c4a65 --- src/core/socket.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/socket.c b/src/core/socket.c index 02d05e2a9..3c2ba501d 100644 --- a/src/core/socket.c +++ b/src/core/socket.c @@ -850,7 +850,8 @@ int osmo_sock_init2_multiaddr(uint16_t family, uint16_t type, uint8_t proto, LOGP(DLGLOBAL, LOGL_ERROR, "cannot setsockopt(SCTP_AUTH_SUPPORTED) socket: %s:%u: %s\n", strbuf, local_port, strerror(err)); - goto ret_close; + /* do not fail, some features such as Peer Primary Address won't be available + * unless configured system-wide through sysctl */ } rc = setsockopt_sctp_asconf_supported(sfd); @@ -860,7 +861,8 @@ int osmo_sock_init2_multiaddr(uint16_t family, uint16_t type, uint8_t proto, LOGP(DLGLOBAL, LOGL_ERROR, "cannot setsockopt(SCTP_ASCONF_SUPPORTED) socket: %s:%u: %s\n", strbuf, local_port, strerror(err)); - goto ret_close; + /* do not fail, some features such as Peer Primary Address won't be available + * unless configured system-wide through sysctl */ } }