lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

February 2024

  • 1 participants
  • 1748 discussions
[M] Change in osmo-ggsn[master]: Revert "kernel-gtp: support IPv6 on outer layer"
by pespin 22 Feb '24

22 Feb '24
Attention is currently required from: osmith. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ggsn/+/36057?usp=email ) Change subject: Revert "kernel-gtp: support IPv6 on outer layer" ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ggsn/+/36057?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Change-Id: I2c2b2ff0875217e041d94c8e2cef030d2a86c2d8 Gerrit-Change-Number: 36057 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: Jenkins Builder Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Comment-Date: Thu, 22 Feb 2024 15:08:11 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[M] Change in osmo-ggsn[master]: Revert "kernel-gtp: support IPv6 on outer layer"
by osmith 22 Feb '24

22 Feb '24
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ggsn/+/36057?usp=email ) Change subject: Revert "kernel-gtp: support IPv6 on outer layer" ...................................................................... Revert "kernel-gtp: support IPv6 on outer layer" This reverts commit 0917ce4e2271c0d71dfb8c86eb2d99821a374781, as it breaks building osmo-sgsn. This needs to be reworked to be backwards compatible. Related: OS#6373 Change-Id: I2c2b2ff0875217e041d94c8e2cef030d2a86c2d8 --- M ggsn/ggsn.c M gtp/gsn.c M gtp/gsn.h M gtp/gtp.c M lib/in46_addr.c M lib/in46_addr.h M sgsnemu/sgsnemu.c M tests/gtp/Makefile.am 8 files changed, 54 insertions(+), 61 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/57/36057/1 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index db906ea..0cd0feb 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -816,7 +816,7 @@ LOGPGGSN(LOGL_INFO, ggsn, "Starting GGSN\n"); /* Start libgtp listener */ - if (gtp_new(&ggsn->gsn, ggsn->cfg.state_dir, &ggsn->cfg.listen_addr, GTP_MODE_GGSN)) { + if (gtp_new(&ggsn->gsn, ggsn->cfg.state_dir, &ggsn->cfg.listen_addr.v4, GTP_MODE_GGSN)) { LOGPGGSN(LOGL_ERROR, ggsn, "Failed to create GTP: %s\n", strerror(errno)); return -1; } @@ -824,9 +824,11 @@ /* patch in different addresses to use (in case we're behind NAT, the listen * address is different from what we advertise externally) */ - ggsn->gsn->gsnc = ggsn->cfg.gtpc_addr; + if (ggsn->cfg.gtpc_addr.v4.s_addr) + ggsn->gsn->gsnc = ggsn->cfg.gtpc_addr.v4; - ggsn->gsn->gsnu = ggsn->cfg.gtpu_addr; + if (ggsn->cfg.gtpu_addr.v4.s_addr) + ggsn->gsn->gsnu = ggsn->cfg.gtpu_addr.v4; /* Register File Descriptors */ osmo_fd_setup(&ggsn->gtp_fd0, ggsn->gsn->fd0, OSMO_FD_READ, ggsn_gtp_fd_cb, ggsn, 0); diff --git a/gtp/gsn.c b/gtp/gsn.c index c01d193..e66dc99 100644 --- a/gtp/gsn.c +++ b/gtp/gsn.c @@ -64,6 +64,11 @@ /* Error reporting functions */ +#define LOGP_WITH_ADDR(ss, level, addr, fmt, args...) \ + LOGP(ss, level, "addr(%s:%d) " fmt, \ + inet_ntoa((addr).sin_addr), htons((addr).sin_port), \ + ##args) + static const struct rate_ctr_desc gsn_ctr_description[] = { [GSN_CTR_ERR_SOCKET] = { "err:socket", "Socket error" }, [GSN_CTR_ERR_READFROM] = { "err:readfrom", "readfrom() errors" }, @@ -418,62 +423,46 @@ talloc_free(filename); } -static int create_and_bind_socket(const char *name, struct gsn_t *gsn, int *fd, const struct in46_addr *listen, - int port) +static int create_and_bind_socket(const char *name, struct gsn_t *gsn, int *fd, int domain, + const struct in_addr *listen, int port) { - int family = in46a_to_af(listen); + struct sockaddr_in addr; int type = SOCK_DGRAM; int protocol = 0; - struct sockaddr addr = {0}; - struct sockaddr_in *addr4 = (struct sockaddr_in *)&addr; - struct sockaddr_in6 *addr6 = (struct sockaddr_in6 *)&addr; - *fd = socket(family, type, protocol); + *fd = socket(domain, type, protocol); if (*fd < 0) { rate_ctr_inc2(gsn->ctrg, GSN_CTR_ERR_SOCKET); LOGP(DLGTP, LOGL_ERROR, "%s socket(domain=%d, type=%d, protocol=%d) failed: Error = %s\n", - name, family, type, protocol, strerror(errno)); + name, domain, type, protocol, strerror(errno)); return -errno; } - switch (family) { - case AF_INET: - addr4->sin_family = AF_INET; - addr4->sin_addr = listen->v4; - addr4->sin_port = htons(port); + memset(&addr, 0, sizeof(addr)); + addr.sin_family = domain; + addr.sin_addr = *listen; + addr.sin_port = htons(port); #if defined(__FreeBSD__) || defined(__APPLE__) - addr4->sin_len = sizeof(struct addr); + addr.sin_len = sizeof(addr); #endif - break; - case AF_INET6: - addr6->sin6_family = AF_INET6; - addr6->sin6_addr = listen->v6; - addr6->sin6_port = htons(port); -#if defined(__FreeBSD__) || defined(__APPLE__) - addr6->sin6_len = sizeof(struct addr); -#endif - break; - default: - OSMO_ASSERT(false); - break; - } - if (bind(*fd, &addr, sizeof(addr)) < 0) { + if (bind(*fd, (struct sockaddr *)&addr, sizeof(addr)) < 0) { rate_ctr_inc2(gsn->ctrg, GSN_CTR_ERR_SOCKET); - LOGP(DLGTP, LOGL_ERROR, - "%s bind(fd=%d, addr=(%s:%d)) failed: Error = %s\n", - name, *fd, in46a_ntoa(listen), port, strerror(errno)); + LOGP_WITH_ADDR(DLGTP, LOGL_ERROR, addr, + "%s bind(fd=%d) failed: Error = %s\n", + name, *fd, strerror(errno)); return -errno; } return 0; } -int gtp_new(struct gsn_t **gsn, char *statedir, struct in46_addr *listen, int mode) +int gtp_new(struct gsn_t **gsn, char *statedir, struct in_addr *listen, + int mode) { - LOGP(DLGTP, LOGL_NOTICE, "GTP: gtp_newgsn() started at %s\n", in46a_ntoa(listen)); + LOGP(DLGTP, LOGL_NOTICE, "GTP: gtp_newgsn() started at %s\n", inet_ntoa(*listen)); *gsn = calloc(sizeof(struct gsn_t), 1); /* TODO */ @@ -522,15 +511,15 @@ (*gsn)->fd1u = -1; /* Create GTP version 0 socket */ - if (create_and_bind_socket("GTPv0", *gsn, &(*gsn)->fd0, listen, GTP0_PORT) < 0) + if (create_and_bind_socket("GTPv0", *gsn, &(*gsn)->fd0, AF_INET, listen, GTP0_PORT) < 0) goto error; /* Create GTP version 1 control plane socket */ - if (create_and_bind_socket("GTPv1 control plane", *gsn, &(*gsn)->fd1c, listen, GTP1C_PORT) < 0) + if (create_and_bind_socket("GTPv1 control plane", *gsn, &(*gsn)->fd1c, AF_INET, listen, GTP1C_PORT) < 0) goto error; /* Create GTP version 1 user plane socket */ - if (create_and_bind_socket("GTPv1 user plane", *gsn, &(*gsn)->fd1u, listen, GTP1U_PORT) < 0) + if (create_and_bind_socket("GTPv1 user plane", *gsn, &(*gsn)->fd1u, AF_INET, listen, GTP1U_PORT) < 0) goto error; /* Start internal queue timer */ diff --git a/gtp/gsn.h b/gtp/gsn.h index df2f745..8e47ce3 100644 --- a/gtp/gsn.h +++ b/gtp/gsn.h @@ -18,7 +18,6 @@ #include <osmocom/core/tdef.h> #include <osmocom/core/rate_ctr.h> -#include "../lib/in46_addr.h" #include "pdp.h" #define GTP_MODE_GGSN 1 @@ -78,8 +77,8 @@ int fd1c; /* GTP1 control plane file descriptor */ int fd1u; /* GTP0 user plane file descriptor */ int mode; /* Mode of operation: GGSN or SGSN */ - struct in46_addr gsnc; /* IP address of this gsn for signalling */ - struct in46_addr gsnu; /* IP address of this gsn for user traffic */ + struct in_addr gsnc; /* IP address of this gsn for signalling */ + struct in_addr gsnu; /* IP address of this gsn for user traffic */ /* Parameters related to signalling messages */ uint16_t seq_next; /* Next sequence number to use */ @@ -118,7 +117,8 @@ /* External API functions */ -extern int gtp_new(struct gsn_t **gsn, char *statedir, struct in46_addr *listen, int mode); +extern int gtp_new(struct gsn_t **gsn, char *statedir, struct in_addr *listen, + int mode); extern int gtp_free(struct gsn_t *gsn); diff --git a/gtp/gtp.c b/gtp/gtp.c index 86c456f..43e56b5 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -1297,8 +1297,8 @@ } /* Initialize our own IP addresses */ - in46a_to_gsna(&pdp->gsnlc, &gsn->gsnc); - in46a_to_gsna(&pdp->gsnlu, &gsn->gsnu); + in_addr2gsna(&pdp->gsnlc, &gsn->gsnc); + in_addr2gsna(&pdp->gsnlu, &gsn->gsnu); if (!gtp_pdp_getimsi(gsn, &pdp_old, pdp->imsi, pdp->nsapi)) { /* Found old pdp with same tid. Now the voodoo begins! */ diff --git a/lib/in46_addr.c b/lib/in46_addr.c index d7c194f..648fe7e 100644 --- a/lib/in46_addr.c +++ b/lib/in46_addr.c @@ -376,14 +376,6 @@ return 1; } -void in46a_to_gsna(struct ul16_t *gsna, const struct in46_addr *src) -{ - memset(gsna, 0, sizeof(struct ul16_t)); - gsna->l = src->len; - OSMO_ASSERT(gsna->l <= sizeof(gsna->v)); - memcpy(gsna->v, &src->v6, gsna->l); -} - void in46a_from_gsna(const struct ul16_t *in, struct in46_addr *dst) { dst->len = in->l; diff --git a/lib/in46_addr.h b/lib/in46_addr.h index 59f58fc..5589f94 100644 --- a/lib/in46_addr.h +++ b/lib/in46_addr.h @@ -40,5 +40,4 @@ return addr->len == sizeof(struct in_addr); } -void in46a_to_gsna(struct ul16_t *gsna, const struct in46_addr *src); void in46a_from_gsna(const struct ul16_t *in, struct in46_addr *dst); diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c index f5ed671..7893f4f 100644 --- a/sgsnemu/sgsnemu.c +++ b/sgsnemu/sgsnemu.c @@ -59,7 +59,6 @@ #include "../lib/syserr.h" #include "../lib/netns.h" #include "../lib/icmpv6.h" -#include "../lib/in46_addr.h" #include "../gtp/pdp.h" #include "../gtp/gtp.h" #include "cmdline.h" @@ -118,7 +117,7 @@ int pingsize; int pingcount; int pingquiet; - struct in46_addr listen; + struct in_addr listen; struct in_addr remote; struct in_addr dns; int contexts; /* Number of contexts to create */ @@ -460,10 +459,10 @@ args_info.listen_arg); return -1; } else { - options.listen.len = host->h_length; - memcpy(&options.listen.v6, host->h_addr, host->h_length); + memcpy(&options.listen.s_addr, host->h_addr, + host->h_length); printf("Local IP address is: %s (%s)\n", - args_info.listen_arg, in46a_ntoa(&options.listen)); + args_info.listen_arg, inet_ntoa(options.listen)); } } else { SYS_ERR(DSGSN, LOGL_ERROR, 0, diff --git a/tests/gtp/Makefile.am b/tests/gtp/Makefile.am index 4d4d2e3..ef69260 100644 --- a/tests/gtp/Makefile.am +++ b/tests/gtp/Makefile.am @@ -22,13 +22,11 @@ gtpie_test_LDADD = \ $(top_builddir)/lib/debug.o \ $(top_builddir)/gtp/libgtp.la \ - $(top_builddir)/lib/libmisc.a \ $(LIBOSMOCORE_LIBS) \ $(NULL) queue_test_LDADD = \ $(top_builddir)/lib/debug.o \ $(top_builddir)/gtp/libgtp.la \ - $(top_builddir)/lib/libmisc.a \ $(LIBOSMOCORE_LIBS) \ $(NULL) -- To view, visit https://gerrit.osmocom.org/c/osmo-ggsn/+/36057?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Change-Id: I2c2b2ff0875217e041d94c8e2cef030d2a86c2d8 Gerrit-Change-Number: 36057 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in libosmocore[master]: osmo_io: Use poll/select to notify socket connection at osmo_io_uring.c
by jolly 22 Feb '24

22 Feb '24
Attention is currently required from: daniel, laforge, pespin. jolly has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/35910?usp=email ) Change subject: osmo_io: Use poll/select to notify socket connection at osmo_io_uring.c ...................................................................... Patch Set 6: (1 comment) File src/core/osmo_io_uring.c: https://gerrit.osmocom.org/c/libosmocore/+/35910/comment/12a07974_c9af407a PS5, Line 436: LOGP(DLIO, LOGL_DEBUG, "%s: %s\n", iofd->name, __func__); > Use LOGPIO(iofd, ... […] Done -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/35910?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I4eca9ea72beb0d6ea4d44cce81ed620033f07270 Gerrit-Change-Number: 35910 Gerrit-PatchSet: 6 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: daniel <dwillmann(a)sysmocom.de> Gerrit-Comment-Date: Thu, 22 Feb 2024 15:05:42 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: daniel <dwillmann(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
[M] Change in libosmocore[master]: osmo_io: SCTP support
by jolly 22 Feb '24

22 Feb '24
Attention is currently required from: arehbein, daniel, fixeria, laforge, pespin. jolly has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/35068?usp=email ) Change subject: osmo_io: SCTP support ...................................................................... Patch Set 9: (1 comment) Patchset: PS7: > Done This will be fixed in a different patch for easier review. -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/35068?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I89eb519b22d21011d61a7855b2364bc3c295df82 Gerrit-Change-Number: 35068 Gerrit-PatchSet: 9 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: arehbein <arehbein(a)sysmocom.de> Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-CC: jolly <andreas(a)eversberg.eu> Gerrit-Attention: arehbein <arehbein(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: daniel <dwillmann(a)sysmocom.de> Gerrit-Comment-Date: Thu, 22 Feb 2024 15:05:37 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: jolly <andreas(a)eversberg.eu> Comment-In-Reply-To: laforge <laforge(a)osmocom.org> Gerrit-MessageType: comment
1 0
0 0
[M] Change in libosmocore[master]: osmo_io: SCTP support
by jolly 22 Feb '24

22 Feb '24
Attention is currently required from: arehbein, daniel, fixeria, laforge, pespin. jolly has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/35068?usp=email ) Change subject: osmo_io: SCTP support ...................................................................... Patch Set 9: (6 comments) Patchset: PS3: > We can probably have a read/write cb passing a cmsg, and then a separate API/cb_helper constructing/ […] Issue will be fixed later. Patchset: PS7: > HAVE_LIBSCTP still missing Done File include/osmocom/core/osmo_io.h: https://gerrit.osmocom.org/c/libosmocore/+/35068/comment/39dac0ae_a82f7b2f PS3, Line 17: // FIXME: This must avoid clashing with the existing definitions in libosmo-netif!!! > I explicitly requested somewhere (review comment or redmine issue) to test build all osmocom softwar […] I tested compilation with libsccp, osmo-bsc and osmo-msc. There was no clash, so I removed the comment. File src/core/osmo_io_internal.h: https://gerrit.osmocom.org/c/libosmocore/+/35068/comment/2cce0515_46f26155 PS1, Line 7: #include <netinet/sctp.h> > Agree to do "if HAVE_LIBSCTP" here. I added #ifdef HAVE_LIBSCTP. File src/core/osmo_io_uring.c: https://gerrit.osmocom.org/c/libosmocore/+/35068/comment/44a62e95_9a8dead4 PS7, Line 340: iofd->mode == OSMO_IO_FD_MODE_SCTP_RECVMSG_SEND) { > If I understand correctly in https://gerrit.osmocom.org/c/libosmocore/+/35910 […] Yes, it is not required, so I removed it. https://gerrit.osmocom.org/c/libosmocore/+/35068/comment/35ef9dc6_68f87ed7 PS7, Line 369: } else > else {} Done -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/35068?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I89eb519b22d21011d61a7855b2364bc3c295df82 Gerrit-Change-Number: 35068 Gerrit-PatchSet: 9 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: arehbein <arehbein(a)sysmocom.de> Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-CC: jolly <andreas(a)eversberg.eu> Gerrit-Attention: arehbein <arehbein(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: daniel <dwillmann(a)sysmocom.de> Gerrit-Comment-Date: Thu, 22 Feb 2024 15:04:16 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: laforge <laforge(a)osmocom.org> Comment-In-Reply-To: pespin <pespin(a)sysmocom.de> Comment-In-Reply-To: daniel <dwillmann(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
[M] Change in libosmocore[master]: osmo_io: Move notify_connected function to backend
by jolly 22 Feb '24

22 Feb '24
Attention is currently required from: daniel, laforge, pespin. jolly has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/35909?usp=email ) Change subject: osmo_io: Move notify_connected function to backend ...................................................................... Patch Set 4: (1 comment) Commit Message: https://gerrit.osmocom.org/c/libosmocore/+/35909/comment/a9f90d52_4271a40e PS3, Line 17: file descriptior > I would always use 'iofd' when talking about an iofd, as otherwise it's getting confusing as 'file d […] But the "integer value" is what I mean. I rephrased it and hope is is clear now. -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/35909?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I905ec85210570aff8addadfc9603335d04eb057a Gerrit-Change-Number: 35909 Gerrit-PatchSet: 4 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: daniel <dwillmann(a)sysmocom.de> Gerrit-Comment-Date: Thu, 22 Feb 2024 15:03:44 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: laforge <laforge(a)osmocom.org> Gerrit-MessageType: comment
1 0
0 0
[S] Change in libosmocore[master]: Make osmo-io compile without libsctp support (--disable-libsctp)
by jolly 22 Feb '24

22 Feb '24
jolly has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/36056?usp=email ) Change subject: Make osmo-io compile without libsctp support (--disable-libsctp) ...................................................................... Make osmo-io compile without libsctp support (--disable-libsctp) Change-Id: Ief8ca40c0e85efe340eaecb866a10f76ac2bfc98 --- M src/core/osmo_io.c M src/core/osmo_io_internal.h M src/core/osmo_io_poll.c M src/core/osmo_io_uring.c 4 files changed, 24 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/56/36056/1 diff --git a/src/core/osmo_io.c b/src/core/osmo_io.c index 61d2641..34d4b00 100644 --- a/src/core/osmo_io.c +++ b/src/core/osmo_io.c @@ -330,7 +330,6 @@ * \param[in] hdr serialized msghdr containing state of completed I/O */ void iofd_handle_recv(struct osmo_io_fd *iofd, struct msgb *msg, int rc, struct iofd_msghdr *hdr) { - struct cmsghdr *cmsg = NULL; talloc_steal(iofd->msgb_alloc.ctx, msg); switch (iofd->mode) { @@ -340,11 +339,13 @@ case OSMO_IO_FD_MODE_RECVFROM_SENDTO: iofd->io_ops.recvfrom_cb(iofd, rc, msg, &hdr->osa); break; +#ifdef HAVE_LIBSCTP case OSMO_IO_FD_MODE_SCTP_RECVMSG_SEND: msgb_sctp_msg_flags(msg) = 0; if (hdr->hdr.msg_flags & MSG_NOTIFICATION) { msgb_sctp_msg_flags(msg) = OSMO_STREAM_SCTP_MSG_FLAGS_NOTIFICATION; } else { + struct cmsghdr *cmsg = NULL; for (cmsg = CMSG_FIRSTHDR(&hdr->hdr); cmsg != NULL; cmsg = CMSG_NXTHDR(&hdr->hdr, cmsg)) { if (cmsg->cmsg_level == IPPROTO_SCTP && cmsg->cmsg_type == SCTP_SNDRCV) { @@ -359,6 +360,7 @@ } iofd->io_ops.read_cb(iofd, rc, msg); break; +#endif default: OSMO_ASSERT(false); break; @@ -505,6 +507,7 @@ return 0; } +#ifdef HAVE_LIBSCTP /*! Send a message through a connected SCTP socket, similar to sctp_sendmsg(). * * Appends the message to the internal transmit queue. @@ -566,6 +569,7 @@ return 0; } +#endif /*! Allocate and setup a new iofd. * \param[in] ctx the parent context from which to allocate @@ -585,7 +589,9 @@ switch (mode) { case OSMO_IO_FD_MODE_READ_WRITE: case OSMO_IO_FD_MODE_RECVFROM_SENDTO: +#ifdef HAVE_LIBSCTP case OSMO_IO_FD_MODE_SCTP_RECVMSG_SEND: +#endif break; default: return NULL; diff --git a/src/core/osmo_io_internal.h b/src/core/osmo_io_internal.h index 77ed142..822f3fb 100644 --- a/src/core/osmo_io_internal.h +++ b/src/core/osmo_io_internal.h @@ -4,7 +4,9 @@ #include <unistd.h> #include <stdbool.h> +#ifdef HAVE_LIBSCTP #include <netinet/sctp.h> +#endif #include <osmocom/core/osmo_io.h> #include <osmocom/core/linuxlist.h> @@ -129,8 +131,10 @@ /*! io-vector we need to pass as argument to sendmsg/recvmsg; is set up * to point into msg below */ struct iovec iov[1]; +#ifdef HAVE_LIBSCTP /*! control message buffer for passing sctp_sndrcvinfo along */ char cmsg[CMSG_SPACE(sizeof(struct sctp_sndrcvinfo))]; +#endif /*! flags we pass as argument to sendmsg / recvmsg */ int flags; diff --git a/src/core/osmo_io_poll.c b/src/core/osmo_io_poll.c index ea3e3cc..aea0bbc 100644 --- a/src/core/osmo_io_poll.c +++ b/src/core/osmo_io_poll.c @@ -64,10 +64,12 @@ .msg_name = &hdr.osa.u.sa, .msg_namelen = sizeof(struct osmo_sockaddr), }; +#ifdef HAVE_LIBSCTP if (iofd->mode == OSMO_IO_FD_MODE_SCTP_RECVMSG_SEND) { hdr.hdr.msg_control = hdr.cmsg; hdr.hdr.msg_controllen = sizeof(hdr.cmsg); } +#endif rc = recvmsg(ofd->fd, &hdr.hdr, flags); if (rc > 0) diff --git a/src/core/osmo_io_uring.c b/src/core/osmo_io_uring.c index 1e1e987..b47f0a3 100644 --- a/src/core/osmo_io_uring.c +++ b/src/core/osmo_io_uring.c @@ -37,7 +37,6 @@ #include <errno.h> #include <netinet/in.h> -#include <netinet/sctp.h> #include <sys/eventfd.h> #include <liburing.h> @@ -129,10 +128,12 @@ switch (action) { case IOFD_ACT_READ: break; +#ifdef HAVE_LIBSCTP case IOFD_ACT_SCTP_RECVMSG: msghdr->hdr.msg_control = msghdr->cmsg; msghdr->hdr.msg_controllen = sizeof(msghdr->cmsg); /* fall-through */ +#endif case IOFD_ACT_RECVFROM: msghdr->hdr.msg_iov = &msghdr->iov[0]; msghdr->hdr.msg_iovlen = 1; -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/36056?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Ief8ca40c0e85efe340eaecb866a10f76ac2bfc98 Gerrit-Change-Number: 36056 Gerrit-PatchSet: 1 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in libosmocore[master]: Make socket.c compile without libsctp support (--disable-libsctp)
by jolly 22 Feb '24

22 Feb '24
jolly has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/36055?usp=email ) Change subject: Make socket.c compile without libsctp support (--disable-libsctp) ...................................................................... Make socket.c compile without libsctp support (--disable-libsctp) Change-Id: I214a16b60e0149a8b1cdcfd3c788cc56a1a40476 --- M src/core/socket.c 1 file changed, 13 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/55/36055/1 diff --git a/src/core/socket.c b/src/core/socket.c index ce73cd8..d36a5f4 100644 --- a/src/core/socket.c +++ b/src/core/socket.c @@ -1868,6 +1868,7 @@ return 0; } +#ifdef HAVE_LIBSCTP /*! Get multiple IP addresses and/or port number on socket in separate string buffers * \param[in] fd file descriptor of socket. * \param[out] ip_proto IPPROTO of the socket, eg: IPPROTO_SCTP. @@ -1956,6 +1957,7 @@ local ? sctp_freeladdrs(addrs) : sctp_freepaddrs(addrs); return rc; } +#endif /*! Get local IP address on socket * \param[in] fd file descriptor of socket @@ -2018,6 +2020,7 @@ return talloc_asprintf(ctx, "(%s)", str); } +#ifdef HAVE_LIBSCTP /*! Format multiple IP addresses and/or port number into a combined string buffer * \param[out] str Destination string buffer. * \param[in] str_len sizeof(str), usually OSMO_SOCK_MULTIADDR_PEER_STR_MAXLEN. @@ -2123,6 +2126,7 @@ return sb.chars_needed; } +#endif /*! Get address/port information on socket in provided string buffer, like "r=1.2.3.4:5<->l=6.7.8.9:10". * This does not include braces like osmo_sock_get_name(). -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/36055?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I214a16b60e0149a8b1cdcfd3c788cc56a1a40476 Gerrit-Change-Number: 36055 Gerrit-PatchSet: 1 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in libosmocore[master]: osmo_io: Use poll/select to notify socket connection at osmo_io_uring.c
by jolly 22 Feb '24

22 Feb '24
Attention is currently required from: daniel, jolly, laforge, pespin. Hello Jenkins Builder, daniel, laforge, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/libosmocore/+/35910?usp=email to look at the new patch set (#6). The following approvals got outdated and were removed: Code-Review+1 by daniel, Verified+1 by Jenkins Builder Change subject: osmo_io: Use poll/select to notify socket connection at osmo_io_uring.c ...................................................................... osmo_io: Use poll/select to notify socket connection at osmo_io_uring.c In order to receive a connect notification from SCTP socket, poll/select event must be used instead of a write notification via io_uring completion event. Once the connect notification has been received, subsequent write notifications via io_uring are used. Change-Id: I4eca9ea72beb0d6ea4d44cce81ed620033f07270 Related: OS#5751 --- M src/core/osmo_io_internal.h M src/core/osmo_io_uring.c 2 files changed, 83 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/10/35910/6 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/35910?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I4eca9ea72beb0d6ea4d44cce81ed620033f07270 Gerrit-Change-Number: 35910 Gerrit-PatchSet: 6 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: jolly <andreas(a)eversberg.eu> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: daniel <dwillmann(a)sysmocom.de> Gerrit-MessageType: newpatchset
1 0
0 0
[M] Change in libosmocore[master]: osmo_io: Move notify_connected function to backend
by jolly 22 Feb '24

22 Feb '24
Attention is currently required from: daniel, jolly, laforge, pespin. Hello Jenkins Builder, daniel, laforge, pespin, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/libosmocore/+/35909?usp=email to look at the new patch set (#4). The following approvals got outdated and were removed: Code-Review+1 by daniel, Code-Review+1 by laforge Change subject: osmo_io: Move notify_connected function to backend ...................................................................... osmo_io: Move notify_connected function to backend This relocation is necessary as the backend (osmo_io_fd or osmo_io_uring) requires a different approach in handling connect notifications. As a result, a function call has been introduced to struct iofd_backend_ops. In a subsequent patch, the process for the osmo_io_uring backend will be modified to handle SCTP connect notifications using poll/select. If connect notification is requested using poll/select, the file descriptior must be registered to osmo_fd, using osmo_fd_register. If read / write notification is requested by application, the file descriptior must be registered also. A flag is used prevent calling osmo_fd_register / osmo_fd_unregister multiple times, which would cause a crash. Change-Id: I905ec85210570aff8addadfc9603335d04eb057a Related: OS#5751 --- M src/core/osmo_io.c M src/core/osmo_io_internal.h M src/core/osmo_io_poll.c M src/core/osmo_io_uring.c 4 files changed, 54 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/09/35909/4 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/35909?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I905ec85210570aff8addadfc9603335d04eb057a Gerrit-Change-Number: 35909 Gerrit-PatchSet: 4 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: jolly <andreas(a)eversberg.eu> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: daniel <dwillmann(a)sysmocom.de> Gerrit-MessageType: newpatchset
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • ...
  • 175
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.