Attention is currently required from: lynxis lazus, neels.
pespin has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/40162?usp=email )
Change subject: rua: Handle event TX_DIRECT_TRANSFER in disconnected state discarding msg
......................................................................
Patch Set 1:
(3 comments)
File src/osmo-hnbgw/context_map_rua.c:
https://gerrit.osmocom.org/c/osmo-hnbgw/+/40162/comment/046aab39_185a32aa?u… :
PS1, Line 285: condition
> There can be several reasons, but the fact that we are in the state I'm explaining here still holds. […]
Done
https://gerrit.osmocom.org/c/osmo-hnbgw/+/40162/comment/f92b1e6f_86d2911c?u… :
PS1, Line 290: msgb_l2len(ranap_msg), osmo_hexdump(msgb_l2(ranap_msg), msgb_l2len(ranap_msg)));
> I can move the hexdump to DEBUG. […]
Done
https://gerrit.osmocom.org/c/osmo-hnbgw/+/40162/comment/a6b7b0f1_d2dcd2fe?u… :
PS1, Line 295: all
> I'll change it to "Ignore events", but I think it's obvious anyway.
Done
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/40162?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: Id68f219ce776fbbfaa80d3b3ed976f48bef4f883
Gerrit-Change-Number: 40162
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Comment-Date: Mon, 28 Apr 2025 08:34:39 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: neels <nhofmeyr(a)sysmocom.de>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Attention is currently required from: lynxis lazus, neels.
pespin has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/40162?usp=email )
Change subject: rua: Handle event TX_DIRECT_TRANSFER in disconnected state discarding msg
......................................................................
Patch Set 1:
(3 comments)
File src/osmo-hnbgw/context_map_rua.c:
https://gerrit.osmocom.org/c/osmo-hnbgw/+/40162/comment/7d2df55d_62c2ae82?u… :
PS1, Line 285: condition
> We have data to be sent out on RUA, but RUA is already disconnected. […]
There can be several reasons, but the fact that we are in the state I'm explaining here still holds. eg. if there's a RUA conn going down we'd be sending an SCCP Release over the other side.
It's a race condition in the sense that ending up in this path happens given a specific sequence and timing of events, ie. CN sending some DL traffic to HNBGW in the meantime that RUA side went disconnected and Release (SCCP or Iu) was sent to CN.
https://gerrit.osmocom.org/c/osmo-hnbgw/+/40162/comment/b8b41525_361cca7a?u… :
PS1, Line 290: msgb_l2len(ranap_msg), osmo_hexdump(msgb_l2(ranap_msg), msgb_l2len(ranap_msg)));
> I think we should not print entire messages' hexdump on NOTICE. […]
I can move the hexdump to DEBUG. Since it's going to be debug I think it's fine printing the whole thing.
https://gerrit.osmocom.org/c/osmo-hnbgw/+/40162/comment/48abe63d_27b7b698?u… :
PS1, Line 295: all
> it's no longer all events
I'll change it to "Ignore events", but I think it's obvious anyway.
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/40162?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: Id68f219ce776fbbfaa80d3b3ed976f48bef4f883
Gerrit-Change-Number: 40162
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Comment-Date: Mon, 28 Apr 2025 08:27:15 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: neels <nhofmeyr(a)sysmocom.de>
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40164?usp=email )
Change subject: tcpdump/dumpcap: move kill_rm_pidfile to inc file
......................................................................
tcpdump/dumpcap: move kill_rm_pidfile to inc file
Move kill_rm_pidfile out of the 4 ttcn3 tcpdump/dumpcap scripts into a
shared include file. Use the version of the function that only tries to
kill the command with sudo if it was started with sudo.
This fixes dumpcap not stopping if:
* it was started with ttcn3-tcpdump-start.sh (despite the name it will
start dumpcap instead of tcpdump if dumpcap was found), where it gets
started without sudo, and
* no rule is set in the user's sudoers file to run kill as root with
NOPASSWD.
Change-Id: Ia63c37b54fb42a8c64a676334cef6f9df4152e18
---
A _scripts/tcpdump-dumpcap.inc.sh
M ttcn3-dumpcap-start.sh
M ttcn3-dumpcap-stop.sh
M ttcn3-tcpdump-start.sh
M ttcn3-tcpdump-stop.sh
5 files changed, 23 insertions(+), 43 deletions(-)
Approvals:
fixeria: Looks good to me, but someone else must approve
Jenkins Builder: Verified
pespin: Looks good to me, but someone else must approve
osmith: Looks good to me, approved
diff --git a/_scripts/tcpdump-dumpcap.inc.sh b/_scripts/tcpdump-dumpcap.inc.sh
new file mode 100644
index 0000000..d033998
--- /dev/null
+++ b/_scripts/tcpdump-dumpcap.inc.sh
@@ -0,0 +1,15 @@
+# This file gets included by ttcn3-{tcpdump,dumpcap}-{start,stop} scripts
+
+kill_rm_pidfile() {
+ if [ -e $1 ]; then
+ PSNAME="$(ps -q "$(cat "$1")" -o comm=)"
+ if [ "$PSNAME" != "sudo" ]; then
+ kill "$(cat "$1")"
+ else
+ # NOTE: This requires you to be root or something like
+ # "laforge ALL=NOPASSWD: /usr/sbin/tcpdump, /bin/kill" in your sudoers file
+ sudo kill "$(cat "$1")"
+ fi
+ rm $1
+ fi
+}
diff --git a/ttcn3-dumpcap-start.sh b/ttcn3-dumpcap-start.sh
index a1e64fc..ddd4eb4 100755
--- a/ttcn3-dumpcap-start.sh
+++ b/ttcn3-dumpcap-start.sh
@@ -4,6 +4,8 @@
# needed when we want to capture from interfaces of different link
# types. It will also store the results as pcap-ng, not plain old pcap.
+. "$(dirname "$0")/_scripts/tcpdump-dumpcap.inc.sh"
+
PIDFILE_PCAP=/tmp/pcap.pid
DUMPCAP=/usr/bin/dumpcap
@@ -13,13 +15,6 @@
TESTCASE=$1
-kill_rm_pidfile() {
- if [ -e $1 ]; then
- kill "$(cat "$1")"
- rm $1
- fi
-}
-
echo "------ $TESTCASE ------"
date
diff --git a/ttcn3-dumpcap-stop.sh b/ttcn3-dumpcap-stop.sh
index 95bcdb6..1ac8e7b 100755
--- a/ttcn3-dumpcap-stop.sh
+++ b/ttcn3-dumpcap-stop.sh
@@ -1,24 +1,12 @@
#!/bin/sh
+. "$(dirname "$0")/_scripts/tcpdump-dumpcap.inc.sh"
+
PIDFILE_PCAP=/tmp/pcap.pid
PIDFILE_NETCAT=/tmp/netcat.pid
TESTCASE=$1
VERDICT="$2"
-kill_rm_pidfile() {
-if [ -e $1 ]; then
- PSNAME="$(ps -q "$(cat "$1")" -o comm=)"
- if [ "$PSNAME" != "sudo" ]; then
- kill "$(cat "$1")"
- else
- # NOTE: This requires you to be root or something like
- # "laforge ALL=NOPASSWD: /usr/sbin/tcpdump, /bin/kill" in your sudoers file
- sudo kill "$(cat "$1")"
- fi
- rm $1
-fi
-}
-
date
if [ x"$VERDICT" = x"pass" ]; then
diff --git a/ttcn3-tcpdump-start.sh b/ttcn3-tcpdump-start.sh
index 9575a68..2c2f8c5 100755
--- a/ttcn3-tcpdump-start.sh
+++ b/ttcn3-tcpdump-start.sh
@@ -1,5 +1,7 @@
#!/bin/sh
+. "$(dirname "$0")/_scripts/tcpdump-dumpcap.inc.sh"
+
PIDFILE_PCAP=/tmp/pcap.pid
TCPDUMP=$(command -v tcpdump)
DUMPCAP=$(command -v dumpcap)
@@ -18,17 +20,6 @@
# and this script will hang indefinitely
fi
-kill_rm_pidfile() {
- # NOTE: This requires you to be root or something like
- # "laforge ALL=NOPASSWD: /usr/sbin/tcpdump, /bin/kill" in your sudoers file
- if [ -e "$1" ]; then
- if [ -s "$1" ]; then
- $SUDOSTR kill "$(cat "$1")" 2>&1 | grep -v "No such process"
- fi
- rm $1
- fi
-}
-
echo "------ $TESTCASE ------"
date
diff --git a/ttcn3-tcpdump-stop.sh b/ttcn3-tcpdump-stop.sh
index def10d8..65aeb2a 100755
--- a/ttcn3-tcpdump-stop.sh
+++ b/ttcn3-tcpdump-stop.sh
@@ -1,5 +1,7 @@
#!/bin/sh
+. "$(dirname "$0")/_scripts/tcpdump-dumpcap.inc.sh"
+
PIDFILE_PCAP=/tmp/pcap.pid
PIDFILE_NETCAT=/tmp/netcat.pid
FIFO=/tmp/cmderr
@@ -13,17 +15,6 @@
# and this script will hang indefinitely
fi
-kill_rm_pidfile() {
- # NOTE: This requires you to be root or something like
- # "laforge ALL=NOPASSWD: /usr/sbin/tcpdump, /bin/kill" in your sudoers file
- if [ -e "$1" ]; then
- if [ -s "$1" ]; then
- $SUDOSTR kill "$(cat "$1")" 2>&1 | grep -v "No such process"
- fi
- rm $1
- fi
-}
-
date
if [ x"$VERDICT" = x"pass" ]; then
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40164?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ia63c37b54fb42a8c64a676334cef6f9df4152e18
Gerrit-Change-Number: 40164
Gerrit-PatchSet: 3
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>