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

December 2023

  • 1 participants
  • 1601 discussions
[M] Change in pysim[master]: transport/pcsc: Allow opening PC/SC readers by a regex of their name
by laforge 17 Dec '23

17 Dec '23
Attention is currently required from: dexter, fixeria. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/34960?usp=email ) Change subject: transport/pcsc: Allow opening PC/SC readers by a regex of their name ...................................................................... Patch Set 3: (1 comment) File pySim/transport/pcsc.py: https://gerrit.osmocom.org/c/pysim/+/34960/comment/c9ad1c5b_cd67e7fe PS2, Line 50: is_a_number(reader_number): > you are right. […] Done -- To view, visit https://gerrit.osmocom.org/c/pysim/+/34960?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I983f19c6741904c1adf27749c9801b44a03a5d78 Gerrit-Change-Number: 34960 Gerrit-PatchSet: 3 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-Comment-Date: Sun, 17 Dec 2023 11:59:19 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: laforge <laforge(a)osmocom.org> Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
[S] Change in pysim[master]: transport: Extend the documentation for each transport driver
by laforge 17 Dec '23

17 Dec '23
Attention is currently required from: dexter, fixeria, osmith. Hello Jenkins Builder, dexter, fixeria, osmith, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/pysim/+/34962?usp=email to look at the new patch set (#4). The following approvals got outdated and were removed: Code-Review+1 by fixeria, Code-Review+2 by osmith, Verified+1 by Jenkins Builder The change is no longer submittable: Code-Review and Verified are unsatisfied now. Change subject: transport: Extend the documentation for each transport driver ...................................................................... transport: Extend the documentation for each transport driver This driver description we add to the code is automatically added to the respective user manual sections. Change-Id: I8807bfb11f43b167f1321d556e09ec5234fff629 --- M pySim/transport/calypso.py M pySim/transport/modem_atcmd.py M pySim/transport/pcsc.py M pySim/transport/serial.py 4 files changed, 28 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/62/34962/4 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/34962?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I8807bfb11f43b167f1321d556e09ec5234fff629 Gerrit-Change-Number: 34962 Gerrit-PatchSet: 4 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-MessageType: newpatchset
1 0
0 0
[M] Change in pysim[master]: transport/pcsc: Allow opening PC/SC readers by a regex of their name
by laforge 17 Dec '23

17 Dec '23
Attention is currently required from: dexter, fixeria. Hello Jenkins Builder, dexter, fixeria, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/pysim/+/34960?usp=email to look at the new patch set (#4). The following approvals got outdated and were removed: Verified+1 by Jenkins Builder Change subject: transport/pcsc: Allow opening PC/SC readers by a regex of their name ...................................................................... transport/pcsc: Allow opening PC/SC readers by a regex of their name Opening PC/SC readers by index/number is very error-prone as the order is never deterministic in any system with multiple (hot-plugged, USB) readers. Instead, let's offer the alternative of specifying a regular expression to match the reader name (similar to remsim-bankd). Change-Id: I983f19c6741904c1adf27749c9801b44a03a5d78 --- M pySim/transport/__init__.py M pySim/transport/pcsc.py 2 files changed, 45 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/60/34960/4 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/34960?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I983f19c6741904c1adf27749c9801b44a03a5d78 Gerrit-Change-Number: 34960 Gerrit-PatchSet: 4 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-MessageType: newpatchset
1 0
0 0
[S] Change in pysim[master]: transport: Move printing of reader number/name to generic code
by laforge 17 Dec '23

17 Dec '23
Attention is currently required from: dexter, fixeria, laforge, osmith. Hello Jenkins Builder, dexter, fixeria, osmith, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/pysim/+/34961?usp=email to look at the new patch set (#5). The following approvals got outdated and were removed: Code-Review+1 by fixeria, Code-Review+2 by osmith, Verified+1 by Jenkins Builder The change is no longer submittable: Code-Review and Verified are unsatisfied now. Change subject: transport: Move printing of reader number/name to generic code ...................................................................... transport: Move printing of reader number/name to generic code Let's avoid copy+pasting print statements everywhere. The instances do already have a __str__ method for the purpose of printing their name in a generic way. Change-Id: I663a9ea69bf7e7aaa6502896b6a71ef692f8d844 --- M pySim/transport/__init__.py M pySim/transport/calypso.py M pySim/transport/modem_atcmd.py M pySim/transport/pcsc.py M pySim/transport/serial.py 5 files changed, 24 insertions(+), 19 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/61/34961/5 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/34961?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I663a9ea69bf7e7aaa6502896b6a71ef692f8d844 Gerrit-Change-Number: 34961 Gerrit-PatchSet: 5 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-MessageType: newpatchset
1 0
0 0
[M] Change in pysim[master]: transport: Pass argparse.Namespace directly into transport classes
by laforge 17 Dec '23

17 Dec '23
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/35382?usp=email ) Change subject: transport: Pass argparse.Namespace directly into transport classes ...................................................................... transport: Pass argparse.Namespace directly into transport classes It's odd that the individual transport driver specifies their argparse options but then the core transport part evaluates them individually. This means we cannot add new options within a transport. Let's pass the Namespace instance into the constructor of the specific transport to improve this. Change-Id: Ib977007dd605ec9a9c09a3d143d2c2308991a12c --- M contrib/sim-rest-server.py M pySim/transport/__init__.py M pySim/transport/calypso.py M pySim/transport/modem_atcmd.py M pySim/transport/pcsc.py M pySim/transport/serial.py 6 files changed, 39 insertions(+), 21 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/82/35382/1 diff --git a/contrib/sim-rest-server.py b/contrib/sim-rest-server.py index fc8afd9..0e44b23 100755 --- a/contrib/sim-rest-server.py +++ b/contrib/sim-rest-server.py @@ -38,7 +38,7 @@ pass def connect_to_card(slot_nr:int): - tp = PcscSimLink(slot_nr, apdu_tracer=ApduPrintTracer()) + tp = PcscSimLink(argparse.Namespace(pcsc_dev=slot_nr), apdu_tracer=ApduPrintTracer()) tp.connect() scc = SimCardCommands(tp) diff --git a/pySim/transport/__init__.py b/pySim/transport/__init__.py index 2ffb9c3..e0e1e62 100644 --- a/pySim/transport/__init__.py +++ b/pySim/transport/__init__.py @@ -289,17 +289,15 @@ """ if opts.pcsc_dev is not None: from pySim.transport.pcsc import PcscSimLink - sl = PcscSimLink(opts.pcsc_dev, **kwargs) + sl = PcscSimLink(opts, **kwargs) elif opts.osmocon_sock is not None: from pySim.transport.calypso import CalypsoSimLink - sl = CalypsoSimLink(sock_path=opts.osmocon_sock, **kwargs) + sl = CalypsoSimLink(opts, **kwargs) elif opts.modem_dev is not None: from pySim.transport.modem_atcmd import ModemATCommandLink - sl = ModemATCommandLink( - device=opts.modem_dev, baudrate=opts.modem_baud, **kwargs) + sl = ModemATCommandLink(opts, **kwargs) else: # Serial reader is default print("No reader/driver specified; falling back to default (Serial reader)") from pySim.transport.serial import SerialSimLink - sl = SerialSimLink(device=opts.device, - baudrate=opts.baudrate, **kwargs) + sl = SerialSimLink(opts, **kwargs) return sl diff --git a/pySim/transport/calypso.py b/pySim/transport/calypso.py index 98330a9..01bbe23 100644 --- a/pySim/transport/calypso.py +++ b/pySim/transport/calypso.py @@ -77,7 +77,8 @@ class CalypsoSimLink(LinkBase): """Transport Link for Calypso based phones.""" - def __init__(self, sock_path: str = "/tmp/osmocom_l2", **kwargs): + def __init__(self, opts: argparse.Namespace = argparse.Namespace(osmocon_sock="/tmp/osmocom_l2"), **kwargs): + sock_path = opts.osmocon_sock super().__init__(**kwargs) if os.environ.get('PYSIM_INTEGRATION_TEST') == "1": print("Using Calypso-based (OsmocomBB) reader interface") diff --git a/pySim/transport/modem_atcmd.py b/pySim/transport/modem_atcmd.py index 71f76e2..9a4f0a5 100644 --- a/pySim/transport/modem_atcmd.py +++ b/pySim/transport/modem_atcmd.py @@ -35,7 +35,10 @@ class ModemATCommandLink(LinkBase): """Transport Link for 3GPP TS 27.007 compliant modems.""" - def __init__(self, device: str = '/dev/ttyUSB0', baudrate: int = 115200, **kwargs): + def __init__(self, opts: argparse.Namespace = argparse.Namespace(modem_dev='/dev/ttyUSB0', + modem_baud=115200), **kwargs): + device = opts.modem_dev + baudrate = opts.modem_baud super().__init__(**kwargs) if os.environ.get('PYSIM_INTEGRATION_TEST') == "1": print("Using modem for Generic SIM Access (3GPP TS 27.007)") diff --git a/pySim/transport/pcsc.py b/pySim/transport/pcsc.py index 762908c..6afcdac 100644 --- a/pySim/transport/pcsc.py +++ b/pySim/transport/pcsc.py @@ -34,18 +34,18 @@ class PcscSimLink(LinkBase): """ pySim: PCSC reader transport link.""" - def __init__(self, reader_number: int = 0, **kwargs): + def __init__(self, opts: argparse.Namespace = argparse.Namespace(pcsc_dev=0), **kwargs): super().__init__(**kwargs) if os.environ.get('PYSIM_INTEGRATION_TEST') == "1": print("Using PC/SC reader interface") else: - print("Using PC/SC reader number %u" % reader_number) + print("Using PC/SC reader number %u" % opts.pcsc_dev) r = readers() - if reader_number >= len(r): - raise ReaderError('No reader found for number %d' % reader_number) - self._reader = r[reader_number] + if opts.pcsc_dev >= len(r): + raise ReaderError('No reader found for number %d' % opts.pcsc_dev) + self._reader = r[opts.pcsc_dev] self._con = self._reader.createConnection() - self._reader_number = reader_number + self._reader_number = opts.pcsc_dev def __del__(self): try: diff --git a/pySim/transport/serial.py b/pySim/transport/serial.py index ad800ed..e6803be 100644 --- a/pySim/transport/serial.py +++ b/pySim/transport/serial.py @@ -30,24 +30,24 @@ class SerialSimLink(LinkBase): """ pySim: Transport Link for serial (RS232) based readers included with simcard""" - def __init__(self, device: str = '/dev/ttyUSB0', baudrate: int = 9600, rst: str = '-rts', + def __init__(self, opts = argparse.Namespace(device='/dev/ttyUSB0', baudrate=9600), rst: str = '-rts', debug: bool = False, **kwargs): super().__init__(**kwargs) if os.environ.get('PYSIM_INTEGRATION_TEST') == "1": print("Using serial reader interface") else: - print("Using serial reader interface at port %s" % device) - if not os.path.exists(device): - raise ValueError("device file %s does not exist -- abort" % device) + print("Using serial reader interface at port %s" % opts.device) + if not os.path.exists(opts.device): + raise ValueError("device file %s does not exist -- abort" % opts.device) self._sl = serial.Serial( - port=device, + port=opts.device, parity=serial.PARITY_EVEN, bytesize=serial.EIGHTBITS, stopbits=serial.STOPBITS_TWO, timeout=1, xonxoff=0, rtscts=0, - baudrate=baudrate, + baudrate=opts.baudrate, ) self._rst_pin = rst self._debug = debug -- To view, visit https://gerrit.osmocom.org/c/pysim/+/35382?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: Ib977007dd605ec9a9c09a3d143d2c2308991a12c Gerrit-Change-Number: 35382 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in libosmocore[master]: utils: fix OSMO_STRBUF_REMAIN to handle sb.pos == NULL correctly
by fixeria 17 Dec '23

17 Dec '23
Attention is currently required from: laforge, neels. fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/35312?usp=email ) Change subject: utils: fix OSMO_STRBUF_REMAIN to handle sb.pos == NULL correctly ...................................................................... Patch Set 1: (1 comment) File include/osmocom/core/utils.h: https://gerrit.osmocom.org/c/libosmocore/+/35312/comment/52f26c46_9c4fb51d PS1, Line 284: /*! Get remaining space for characters and terminating nul in the given struct osmo_strbuf. > I'd expect the linker will throw out any unused functions anyway This is my expectation/understanding too. -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/35312?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: I294a74a99c40995cf7fb5520d61f697d967be5a4 Gerrit-Change-Number: 35312 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Comment-Date: Sun, 17 Dec 2023 11:59:10 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: neels <nhofmeyr(a)sysmocom.de> Comment-In-Reply-To: laforge <laforge(a)osmocom.org> Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmo-mgw[master]: mgcp: simplify getting msgb tail in mgcp_msg_terminate_nul()
by fixeria 17 Dec '23

17 Dec '23
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/35321?usp=email ) Change subject: mgcp: simplify getting msgb tail in mgcp_msg_terminate_nul() ...................................................................... Patch Set 2: (1 comment) File include/osmocom/mgcp/mgcp_common.h: https://gerrit.osmocom.org/c/osmo-mgw/+/35321/comment/7cd0ee9b_d1cdd7d9 PS1, Line 86: > The code writes to `tail[-1]`, which corresponds to the last character of the received MGCP message. […] https://gerrit.osmocom.org/c/osmo-mgw/+/35381 -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/35321?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I4f4b0f792bbeef94a5449c4a5843628a703a3d54 Gerrit-Change-Number: 35321 Gerrit-PatchSet: 2 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: laforge <laforge(a)osmocom.org> Gerrit-Comment-Date: Sun, 17 Dec 2023 11:55:41 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: laforge <laforge(a)osmocom.org> Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmo-mgw[master]: mgcp: correctly put NUL character in mgcp_msg_terminate_nul()
by fixeria 17 Dec '23

17 Dec '23
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-mgw/+/35381?usp=email ) Change subject: mgcp: correctly put NUL character in mgcp_msg_terminate_nul() ...................................................................... mgcp: correctly put NUL character in mgcp_msg_terminate_nul() As was pointed out during code review of a previously merged patch, whenever we write something to the tailroom, we must use msgb_put(). Change-Id: Ibe1605631a94088bfd1f603f7043322ed5585ffe --- M include/osmocom/mgcp/mgcp_common.h 1 file changed, 13 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/81/35381/1 diff --git a/include/osmocom/mgcp/mgcp_common.h b/include/osmocom/mgcp/mgcp_common.h index be5a0d6..05ae95f 100644 --- a/include/osmocom/mgcp/mgcp_common.h +++ b/include/osmocom/mgcp/mgcp_common.h @@ -72,7 +72,7 @@ if (tail[-1] == '\0') /* nothing to do */; else if (msgb_tailroom(msg) > 0) - tail[0] = '\0'; + msgb_put_u8(msg, (uint8_t)'\0'); else if (tail[-1] == '\r' || tail[-1] == '\n') tail[-1] = '\0'; else { -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/35381?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: Ibe1605631a94088bfd1f603f7043322ed5585ffe Gerrit-Change-Number: 35381 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in osmo-mgw[master]: mgcp: simplify getting msgb tail in mgcp_msg_terminate_nul()
by fixeria 17 Dec '23

17 Dec '23
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/35321?usp=email ) Change subject: mgcp: simplify getting msgb tail in mgcp_msg_terminate_nul() ...................................................................... mgcp: simplify getting msgb tail in mgcp_msg_terminate_nul() The current statement: msg->l2h + msgb_l2len(msg) looks as follows, if we expand the msgb_l2len(): msg->l2h + msgb->tail - msg->l2h so this is basically equal to msgb->tail alone. Change-Id: I4f4b0f792bbeef94a5449c4a5843628a703a3d54 Related: CID#272990 --- M include/osmocom/mgcp/mgcp_common.h 1 file changed, 21 insertions(+), 1 deletion(-) Approvals: pespin: Looks good to me, but someone else must approve Jenkins Builder: Verified daniel: Looks good to me, approved diff --git a/include/osmocom/mgcp/mgcp_common.h b/include/osmocom/mgcp/mgcp_common.h index 7de45f9..be5a0d6 100644 --- a/include/osmocom/mgcp/mgcp_common.h +++ b/include/osmocom/mgcp/mgcp_common.h @@ -68,7 +68,7 @@ /* Ensure that the msg->l2h is NUL terminated. */ static inline int mgcp_msg_terminate_nul(struct msgb *msg) { - unsigned char *tail = msg->l2h + msgb_l2len(msg); /* char after l2 data */ + unsigned char *tail = msg->tail; /* char after l2 data */ if (tail[-1] == '\0') /* nothing to do */; else if (msgb_tailroom(msg) > 0) -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/35321?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I4f4b0f792bbeef94a5449c4a5843628a703a3d54 Gerrit-Change-Number: 35321 Gerrit-PatchSet: 2 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: laforge <laforge(a)osmocom.org> Gerrit-MessageType: merged
1 0
0 0
[S] Change in osmo-mgw[master]: mgcp: reserve once byte for '\0' in mgcp_do_read()
by fixeria 17 Dec '23

17 Dec '23
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/35322?usp=email ) Change subject: mgcp: reserve once byte for '\0' in mgcp_do_read() ...................................................................... mgcp: reserve once byte for '\0' in mgcp_do_read() We need to be able to terminate the received string in case it was not nul-terminated by the sender (see mgcp_msg_terminate_nul()). Change-Id: Icc878af7f671213bb516af62cb601914d86ff808 Fixes: CID#272990 --- M src/libosmo-mgcp-client/mgcp_client.c 1 file changed, 15 insertions(+), 1 deletion(-) Approvals: laforge: Looks good to me, approved Jenkins Builder: Verified pespin: Looks good to me, but someone else must approve daniel: Looks good to me, but someone else must approve diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index 8693b1b..cd73391 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -758,7 +758,8 @@ return -1; } - ret = read(fd->fd, msg->data, 4096 - 128); + /* msgb_tailroom() is basically (4096 - 128); -1 is for '\0' */ + ret = read(fd->fd, msg->data, msgb_tailroom(msg) - 1); if (ret <= 0) { LOGPMGW(mgcp, LOGL_ERROR, "Failed to read: %s: %d='%s'\n", osmo_sock_get_name2(fd->fd), errno, strerror(errno)); -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/35322?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: Icc878af7f671213bb516af62cb601914d86ff808 Gerrit-Change-Number: 35322 Gerrit-PatchSet: 2 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • ...
  • 161
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.