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 2023

  • 1 participants
  • 2601 discussions
Change in osmo-ttcn3-hacks[master]: library/DIAMETER_Emulation: f_diameter_xceive(): ignore unexpected PDUs
by fixeria 11 Feb '23

11 Feb '23
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/31291 ) Change subject: library/DIAMETER_Emulation: f_diameter_xceive(): ignore unexpected PDUs ...................................................................... library/DIAMETER_Emulation: f_diameter_xceive(): ignore unexpected PDUs Currently an unexpected PDU will trigger a DTE (no matching alt). Change-Id: I6dbc646d5f036f454f197137373796f40c4c9e74 Related: SYS#5602 --- M library/DIAMETER_Emulation.ttcn 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/91/31291/1 diff --git a/library/DIAMETER_Emulation.ttcn b/library/DIAMETER_Emulation.ttcn index 09f92be..3fa6a5c 100644 --- a/library/DIAMETER_Emulation.ttcn +++ b/library/DIAMETER_Emulation.ttcn @@ -260,6 +260,7 @@ DIAMETER.send(t_DIAMETER_Send(g_diameter_conn_id, tx)); alt { [] DIAMETER.receive(tr_DIAMETER_RecvFrom_R(rx_t)) -> value mrf { } + [] DIAMETER.receive(tr_DIAMETER_RecvFrom_R(?)) { repeat; } [] DIAMETER.receive(tr_SctpAssocChange) { repeat; } [] DIAMETER.receive(tr_SctpPeerAddrChange) { repeat; } [] T.timeout { -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/31291 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I6dbc646d5f036f454f197137373796f40c4c9e74 Gerrit-Change-Number: 31291 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmo-ttcn3-hacks[master]: library/DIAMETER_Templates: add send template for CER
by fixeria 11 Feb '23

11 Feb '23
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/31290 ) Change subject: library/DIAMETER_Templates: add send template for CER ...................................................................... library/DIAMETER_Templates: add send template for CER Change-Id: I58690decfe0ec54da76af6dcfb108f2d78322e9c Related: SYS#5602 --- M library/DIAMETER_Templates.ttcn 1 file changed, 24 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/90/31290/1 diff --git a/library/DIAMETER_Templates.ttcn b/library/DIAMETER_Templates.ttcn index 5abcb48..e13e31f 100644 --- a/library/DIAMETER_Templates.ttcn +++ b/library/DIAMETER_Templates.ttcn @@ -1249,6 +1249,30 @@ } +/* 5.3.1 Capabilities Exchange Request */ +template (value) PDU_DIAMETER +ts_DIA_CER(octetstring host_ip, uint32_t vendor_app_id, + template (value) charstring orig_host := "ttcn3.localdomain", + template (value) charstring orig_realm := "localdomain", + template (value) UINT32 hbh_id := '00000000'O, + template (value) UINT32 ete_id := '00000000'O) := + ts_DIAMETER(flags := '10000000'B, + cmd_code := Capabilities_Exchange, + hbh_id := hbh_id, + ete_id := ete_id, + avps := { + ts_AVP_OriginHost(orig_host), + ts_AVP_OriginRealm(orig_realm), + ts_AVP_HostIpAddr(host_ip), + ts_AVP_VendorId(vendor_id_3GPP), + ts_AVP_ProductName("TTCN-3 Testsuite"), + ts_AVP_FwRevision('00000000'O), + ts_AVP_InbSecId('00000000'O), + ts_AVP_AuthAppId('FFFFFFFF'O), + ts_AVP_VendorSpecAppId(vendor_id_3GPP, vendor_app_id) + }); + + /* 5.3.2 Capabilities Exchange Answer */ template (value) PDU_DIAMETER ts_DIA_CEA_AUTH_APP_ID(template (value) UINT32 hbh_id, template (value) UINT32 ete_id, -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/31290 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I58690decfe0ec54da76af6dcfb108f2d78322e9c Gerrit-Change-Number: 31290 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmo-ttcn3-hacks[master]: library/DIAMETER_Emulation: initiate CER/CEA exchange in client mode
by fixeria 11 Feb '23

11 Feb '23
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/31292 ) Change subject: library/DIAMETER_Emulation: initiate CER/CEA exchange in client mode ...................................................................... library/DIAMETER_Emulation: initiate CER/CEA exchange in client mode Change-Id: I7537b306c2a569e2232597f21e15d3cf4ec9a12c Related: SYS#5602 --- M library/DIAMETER_Emulation.ttcn 1 file changed, 14 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/92/31292/1 diff --git a/library/DIAMETER_Emulation.ttcn b/library/DIAMETER_Emulation.ttcn index 3fa6a5c..28db6b5 100644 --- a/library/DIAMETER_Emulation.ttcn +++ b/library/DIAMETER_Emulation.ttcn @@ -272,13 +272,14 @@ } function main(DIAMETEROps ops, DIAMETER_conn_parameters p, charstring id) runs on DIAMETER_Emulation_CT { + var boolean server_mode := p.remote_sctp_port == -1; var Result res; g_diameter_id := id; f_imsi_table_init(); f_expect_table_init(); map(self:DIAMETER, system:DIAMETER_CODEC_PT); - if (p.remote_sctp_port == -1) { + if (server_mode) { res := DIAMETER_CodecPort_CtrlFunct.f_IPL4_listen(DIAMETER, p.local_ip, p.local_sctp_port, { sctp := valueof(ts_SCTP) }); } else { res := DIAMETER_CodecPort_CtrlFunct.f_IPL4_connect(DIAMETER, p.remote_ip, p.remote_sctp_port, @@ -290,6 +291,18 @@ } g_diameter_conn_id := res.connId; + /* If in client mode, send CER immediately */ + if (not server_mode) { + var template (value) PDU_DIAMETER req; + var PDU_DIAMETER rsp; + + req := ts_DIA_CER(f_inet_addr(p.local_ip), p.vendor_app_id, + orig_host := p.origin_host, orig_realm := p.origin_realm); + rsp := f_diameter_xceive(req, tr_DIAMETER_A(Capabilities_Exchange, req.application_id)); + /* notify our user that the CER->CEA exchange has happened */ + DIAMETER_UNIT.send(DiameterCapabilityExchgInd:{rx := rsp, tx := valueof(req)}); + } + while (true) { var DIAMETER_ConnHdlr vc_conn; var template IMSI imsi_t; -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/31292 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I7537b306c2a569e2232597f21e15d3cf4ec9a12c Gerrit-Change-Number: 31292 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmo-hnbgw[master]: on HNB Register, discard old HNB with same id, allow new connection
by neels 11 Feb '23

11 Feb '23
neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/31289 ) Change subject: on HNB Register, discard old HNB with same id, allow new connection ...................................................................... on HNB Register, discard old HNB with same id, allow new connection Change-Id: I6b04398296fdd9657a733984f28c2ef4188861ab --- M src/osmo-hnbgw/hnbgw_hnbap.c 1 file changed, 19 insertions(+), 34 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/89/31289/1 diff --git a/src/osmo-hnbgw/hnbgw_hnbap.c b/src/osmo-hnbgw/hnbgw_hnbap.c index 4aefe2b..bcb938e 100644 --- a/src/osmo-hnbgw/hnbgw_hnbap.c +++ b/src/osmo-hnbgw/hnbgw_hnbap.c @@ -49,6 +49,7 @@ return 0; } +#if 0 static int hnbgw_tx_hnb_register_rej(struct hnb_context *ctx) { HNBAP_HNBRegisterReject_t reject_out; @@ -90,6 +91,7 @@ return 0; } +#endif static int hnbgw_tx_hnb_register_acc(struct hnb_context *ctx) { @@ -428,41 +430,24 @@ ctx->id.mcc = plmn.mcc; ctx->id.mnc = plmn.mnc; + /* Guard against duplicate entries of HNB with the same LAC,SAC,RAC,CID,MCC,MNC identity */ llist_for_each_entry_safe(hnb, tmp, &ctx->gw->hnb_list, list) { - if (hnb->hnb_registered && ctx != hnb && memcmp(&ctx->id, &hnb->id, sizeof(ctx->id)) == 0) { - /* If it's coming from the same remote IP addr+port, then it must be our internal - * fault (bug), and we release the old context to keep going... */ - struct osmo_fd *other_fd = osmo_stream_srv_get_ofd(hnb->conn); - struct osmo_sockaddr other_osa = {}; - struct osmo_sockaddr cur_osa = {}; - socklen_t len = sizeof(other_osa); - if (getpeername(other_fd->fd, &other_osa.u.sa, &len) < 0) { - LOGHNB(ctx, DHNBAP, LOGL_ERROR, "BUG! Found old registered HNB with invalid socket, releasing it\n"); - hnb_context_release(hnb); - continue; - } - len = sizeof(cur_osa); - if (getpeername(ofd->fd, &cur_osa.u.sa, &len) < 0) { - LOGHNB(ctx, DHNBAP, LOGL_ERROR, "Error getpeername(): %s\n", strerror(errno)); - if (osmo_sockaddr_cmp(&cur_osa, &other_osa) == 0) { - LOGHNB(ctx, DHNBAP, LOGL_ERROR, "BUG! Found old registered HNB with same remote address, releasing it\n"); - hnb_context_release(hnb); - continue; - } - } else if (osmo_sockaddr_cmp(&cur_osa, &other_osa) == 0) { - LOGHNB(ctx, DHNBAP, LOGL_ERROR, "BUG! Found old registered HNB with same remote address, releasing it\n"); - hnb_context_release(hnb); - continue; - } /* else: addresses are different, we continue below */ - - /* If new conn registering same HNB is from anoter remote addr+port, let's reject it to avoid - * misconfigurations or someone trying to impersonate an already working HNB: */ - LOGHNB(ctx, DHNBAP, LOGL_ERROR, "rejecting HNB-REGISTER-REQ with duplicate cell identity " - "MCC=%u,MNC=%u,LAC=%u,RAC=%u,SAC=%u,CID=%u from %s\n", - ctx->id.mcc, ctx->id.mnc, ctx->id.lac, ctx->id.rac, ctx->id.sac, ctx->id.cid, name); - hnbap_free_hnbregisterrequesties(&ies); - return hnbgw_tx_hnb_register_rej(ctx); - } + if (hnb == ctx) + continue; + if (!hnb->hnb_registered) + continue; + if (memcmp(&ctx->id, &hnb->id, sizeof(ctx->id))) + continue; + /* There is another hnb_context with the same id. + * This can be misconfiguration -- the user must make sure to avoid two HNB with the same id. + * Or this is the same HNB re-connecting on a new conn, before osmo-hnbgw noticed that the HNB has gone + * down. + * Allow the new HNB connection, discard the old hnb_context. */ + LOGHNB(ctx, DHNBAP, LOGL_ERROR, "A HNB with the same cell identity already exists, discarding old HNB" + " context, in favor of this new HNB-REGISTER-REQ for" + " MCC=%u,MNC=%u,LAC=%u,RAC=%u,SAC=%u,CID=%u from %s\n", + ctx->id.mcc, ctx->id.mnc, ctx->id.lac, ctx->id.rac, ctx->id.sac, ctx->id.cid, name); + hnb_context_release(hnb); } LOGHNB(ctx, DHNBAP, LOGL_DEBUG, "HNB-REGISTER-REQ %s MCC=%u,MNC=%u,LAC=%u,RAC=%u,SAC=%u,CID=%u from %s%s\n", -- To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/31289 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hnbgw Gerrit-Branch: master Gerrit-Change-Id: I6b04398296fdd9657a733984f28c2ef4188861ab Gerrit-Change-Number: 31289 Gerrit-PatchSet: 1 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in libosmo-gprs[master]: rlcmac: llc_queue: Make sure queue is cleared before freeing mem
by fixeria 10 Feb '23

10 Feb '23
Attention is currently required from: pespin. fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-gprs/+/31283 ) Change subject: rlcmac: llc_queue: Make sure queue is cleared before freeing mem ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/libosmo-gprs/+/31283 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-gprs Gerrit-Branch: master Gerrit-Change-Id: Iadd08c727d46dfb5cac4df5219ecbcbacf6482eb Gerrit-Change-Number: 31283 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Fri, 10 Feb 2023 23:24:50 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in libosmocore[master]: add contrib/talloc_count.sh
by neels 10 Feb '23

10 Feb '23
neels has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/31266 ) Change subject: add contrib/talloc_count.sh ...................................................................... Patch Set 3: (1 comment) File contrib/talloc_count.sh: https://gerrit.osmocom.org/c/libosmocore/+/31266/comment/a7628578_f041e8f2 PS2, Line 31: grep contains "$f" | sed 's/[ \t]*contains.*//' | sed 's/^[ \t]*//' | sed 's/[ \t][ \t]*/ /g' | grep -v '^$' | grep -v '^[0-9]\+$' | sed 's/0x[0-9a-fA-F]\+/N/g' | sed 's/[0-9]\+/N/g' | sort > "$mangled" > split this over multiple lines, so it's more readable? Done -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/31266 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I5b3242dd6e0649925ac6abfd1e96625c682b8934 Gerrit-Change-Number: 31266 Gerrit-PatchSet: 3 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Comment-Date: Fri, 10 Feb 2023 20:46:11 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: osmith <osmith(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
Change in libosmocore[master]: add contrib/talloc_count.sh
by neels 10 Feb '23

10 Feb '23
neels has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/31266 ) Change subject: add contrib/talloc_count.sh ...................................................................... add contrib/talloc_count.sh When a user reports a memory leak with a talloc report, this script is useful to quickly get a handle of what is being leaked. The alternative is eyeballing the talloc report for a very long time. Change-Id: I5b3242dd6e0649925ac6abfd1e96625c682b8934 --- A contrib/talloc_count.sh 1 file changed, 52 insertions(+), 0 deletions(-) Approvals: neels: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/talloc_count.sh b/contrib/talloc_count.sh new file mode 100755 index 0000000..3b03585 --- /dev/null +++ b/contrib/talloc_count.sh @@ -0,0 +1,52 @@ +#!/bin/sh +# +# Print a summary of how often each named object appears in a talloc report. +# +# usage: +# talloc_count.sh my_talloc_report.txt +# or: +# osmo_interact_vty.py -p 4242 -c 'show talloc-context application full' | talloc_count.sh +# +# produces output like: +# 1 struct foo +# 1 struct log_info +# 1 struct log_info_cat +# 21 msgb +# 1391 SCCP-SCOC(N)[N] +# 1402 struct osmo_fsm_inst +# [...] + +f="$1" + +tmpdir="$(mktemp -d)" +trap "rm -rf \"$tmpdir\"" EXIT + +# without input file, read stdin +if [ "x$f" = "x" ]; then + f="$tmpdir/input" + cat > $f +fi + +mangled="$tmpdir/mangled" +grep contains "$f" \ + | sed 's/[ \t]*contains.*//' \ + | sed 's/^[ \t]*//' \ + | sed 's/[ \t][ \t]*/ /g' \ + | grep -v '^$' \ + | grep -v '^[0-9]\+$' \ + | sed 's/0x[0-9a-fA-F]\+/N/g' \ + | sed 's/[0-9]\+/N/g' \ + | sort \ + > "$mangled" + +count() { + name="$1" + nr="$(grep -Fx "$name" "$mangled" | wc -l)" + printf "%6d $name\\n" $nr +} + +{ + cat "$mangled" | uniq | while read type; do + count "$type" + done +} | sort -h -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/31266 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I5b3242dd6e0649925ac6abfd1e96625c682b8934 Gerrit-Change-Number: 31266 Gerrit-PatchSet: 3 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
Change in osmo-upf[master]: osmo_pfcp_tool: make usable again
by neels 10 Feb '23

10 Feb '23
neels has submitted this change. ( https://gerrit.osmocom.org/c/osmo-upf/+/31193 ) Change subject: osmo_pfcp_tool: make usable again ...................................................................... osmo_pfcp_tool: make usable again Some things in osmo-upf and libosmo-pfcp have changed without accounting for that in osmo-pfcp-tool. (This tool is not that important, forgive me for submitting various changes in one patch.) Properly represent all of {access,core} x {local,remote} GTP F-TEIDs in the internal osmo-pfcp-tool state. Adjust and clarify osmo-pfcp-tool script commands. Adjust the osmo-pfcp-tool scripts in contrib so that they work again. Change-Id: I22cfaa4aedd465c81de85e673b9960eaf99c426b --- M contrib/osmo-pfcp-tool-scripts/osmo-upf-11.cfg M contrib/osmo-pfcp-tool-scripts/osmo-upf-12.cfg M contrib/osmo-pfcp-tool-scripts/session_est_without_assoc.vty M contrib/osmo-pfcp-tool-scripts/session_mod.vty M contrib/osmo-pfcp-tool-scripts/tunend_plus_tunmap.vty M contrib/osmo-pfcp-tool-scripts/tunend_session_est.vty M contrib/osmo-pfcp-tool-scripts/tunmap_session_est.vty M src/osmo-pfcp-tool/pfcp_tool.c M src/osmo-pfcp-tool/pfcp_tool.h M src/osmo-pfcp-tool/pfcp_tool_vty.c 10 files changed, 176 insertions(+), 111 deletions(-) Approvals: Jenkins Builder: Verified osmith: Looks good to me, but someone else must approve pespin: Looks good to me, approved laforge: Looks good to me, approved diff --git a/contrib/osmo-pfcp-tool-scripts/osmo-upf-11.cfg b/contrib/osmo-pfcp-tool-scripts/osmo-upf-11.cfg index 10ecd8d..d619f54 100644 --- a/contrib/osmo-pfcp-tool-scripts/osmo-upf-11.cfg +++ b/contrib/osmo-pfcp-tool-scripts/osmo-upf-11.cfg @@ -23,5 +23,3 @@ local-addr 127.0.0.11 tunend dev create apn11 127.0.0.11 -tunmap - table-name osmo-upf-11 diff --git a/contrib/osmo-pfcp-tool-scripts/osmo-upf-12.cfg b/contrib/osmo-pfcp-tool-scripts/osmo-upf-12.cfg index 272301a..8b77417 100644 --- a/contrib/osmo-pfcp-tool-scripts/osmo-upf-12.cfg +++ b/contrib/osmo-pfcp-tool-scripts/osmo-upf-12.cfg @@ -21,7 +21,5 @@ timer pfcp x24 5000 pfcp local-addr 127.0.0.12 -tunend - dev create apn12 127.0.0.12 tunmap table-name osmo-upf-12 diff --git a/contrib/osmo-pfcp-tool-scripts/session_est_without_assoc.vty b/contrib/osmo-pfcp-tool-scripts/session_est_without_assoc.vty index 4ca669a..2efc68e 100644 --- a/contrib/osmo-pfcp-tool-scripts/session_est_without_assoc.vty +++ b/contrib/osmo-pfcp-tool-scripts/session_est_without_assoc.vty @@ -1,4 +1,6 @@ timer pfcp x23 0 pfcp-peer 127.0.0.1 session tunend + ue ip 127.127.127.127 + gtp access remote f-teid 127.0.0.127 127 tx session-est-req diff --git a/contrib/osmo-pfcp-tool-scripts/session_mod.vty b/contrib/osmo-pfcp-tool-scripts/session_mod.vty index 7645c05..58760a7 100644 --- a/contrib/osmo-pfcp-tool-scripts/session_mod.vty +++ b/contrib/osmo-pfcp-tool-scripts/session_mod.vty @@ -3,12 +3,14 @@ tx assoc-setup-req sleep 1 session + ue ip 127.127.127.127 + gtp access remote f-teid 127.0.0.127 127 tx session-est-req drop sleep 3 - tx session-mod-req forw + tx session-mod-req far forw sleep 5 - tx session-mod-req drop + tx session-mod-req far drop sleep 3 - tx session-mod-req forw + tx session-mod-req far forw sleep 3 tx session-del-req diff --git a/contrib/osmo-pfcp-tool-scripts/tunend_plus_tunmap.vty b/contrib/osmo-pfcp-tool-scripts/tunend_plus_tunmap.vty index 1cfcd6d..206766c 100644 --- a/contrib/osmo-pfcp-tool-scripts/tunend_plus_tunmap.vty +++ b/contrib/osmo-pfcp-tool-scripts/tunend_plus_tunmap.vty @@ -1,4 +1,4 @@ -# ACCESS HOP CORE +# ACCESS UPF tunmap UPF tunend (CORE) # session 23 = tunmap session 42 = encaps/decaps # GTP 127.0.0.13 127.0.0.12 127.0.0.11 # TEID l:23 r:123 <---> r:23 l:123 | l:142 r:42 <---> r:142 l:42 | 192.168.100.42 @@ -13,8 +13,8 @@ sleep 1 session tunend 42 ue ip 192.168.100.42 - gtp access ip 127.0.0.12 - gtp access teid local 42 remote 142 + gtp access local f-teid 127.0.0.11 42 + gtp access remote f-teid 127.0.0.12 142 tx session-est-req sleep 1 @@ -22,9 +22,9 @@ tx assoc-setup-req sleep 1 session tunmap 23 - gtp core ip 127.0.0.11 - gtp core teid local 142 remote 42 - gtp access ip 127.0.0.13 - gtp access teid local 123 remote 23 + gtp core remote f-teid 127.0.0.11 42 + gtp core local f-teid 127.0.0.12 142 + gtp access local f-teid 127.0.0.12 123 + gtp access remote f-teid 127.0.0.13 23 tx session-est-req sleep 1 diff --git a/contrib/osmo-pfcp-tool-scripts/tunend_session_est.vty b/contrib/osmo-pfcp-tool-scripts/tunend_session_est.vty index 3862c15..89a4629 100644 --- a/contrib/osmo-pfcp-tool-scripts/tunend_session_est.vty +++ b/contrib/osmo-pfcp-tool-scripts/tunend_session_est.vty @@ -3,6 +3,9 @@ tx assoc-setup-req sleep 1 session tunend + ue ip 127.127.127.127 + gtp access local f-teid choose + gtp access remote f-teid 127.0.0.12 142 tx session-est-req forw sleep 5 tx session-del-req diff --git a/contrib/osmo-pfcp-tool-scripts/tunmap_session_est.vty b/contrib/osmo-pfcp-tool-scripts/tunmap_session_est.vty index b01b088..bff069c 100644 --- a/contrib/osmo-pfcp-tool-scripts/tunmap_session_est.vty +++ b/contrib/osmo-pfcp-tool-scripts/tunmap_session_est.vty @@ -3,6 +3,10 @@ tx assoc-setup-req sleep 1 session tunmap + gtp core remote f-teid 127.0.0.11 42 + gtp core local f-teid choose + gtp access local f-teid choose + gtp access remote f-teid 127.0.0.13 23 tx session-est-req sleep 5 tx session-del-req diff --git a/src/osmo-pfcp-tool/pfcp_tool.c b/src/osmo-pfcp-tool/pfcp_tool.c index ae77f64..fcad7fd 100644 --- a/src/osmo-pfcp-tool/pfcp_tool.c +++ b/src/osmo-pfcp-tool/pfcp_tool.c @@ -85,7 +85,7 @@ } struct pfcp_tool_session *pfcp_tool_session_find_or_create(struct pfcp_tool_peer *peer, uint64_t cp_seid, - enum up_gtp_action_kind gtp_action) + enum up_gtp_action_kind kind) { struct pfcp_tool_session *session = pfcp_tool_session_find(peer, cp_seid); if (session) @@ -95,7 +95,7 @@ *session = (struct pfcp_tool_session){ .peer = peer, .cp_seid = cp_seid, - .gtp_action = gtp_action, + .kind = kind, }; llist_add(&session->entry, &peer->sessions); return session; diff --git a/src/osmo-pfcp-tool/pfcp_tool.h b/src/osmo-pfcp-tool/pfcp_tool.h index 9f04efd..dbfbb23 100644 --- a/src/osmo-pfcp-tool/pfcp_tool.h +++ b/src/osmo-pfcp-tool/pfcp_tool.h @@ -51,30 +51,43 @@ struct llist_head sessions; }; -struct pfcp_tool_teid_pair { - uint32_t local; - uint32_t remote; +struct pfcp_tool_gtp_tun_ep { + struct osmo_sockaddr_str addr; + uint32_t teid; +}; + +struct pfcp_tool_gtp_tun { + struct pfcp_tool_gtp_tun_ep local; + struct pfcp_tool_gtp_tun_ep remote; +}; + +struct pfcp_tool_tunend_desc { + struct pfcp_tool_gtp_tun access; + struct { + struct osmo_sockaddr_str ue_local_addr; + } core; +}; + +struct pfcp_tool_tunmap_desc { + struct pfcp_tool_gtp_tun access; + struct pfcp_tool_gtp_tun core; }; struct pfcp_tool_session { struct llist_head entry; - enum up_gtp_action_kind gtp_action; - struct pfcp_tool_peer *peer; uint64_t cp_seid; struct osmo_pfcp_ie_f_seid up_f_seid; - struct { - struct pfcp_tool_teid_pair teid; - struct osmo_sockaddr_str gtp_ip; - } access; + enum up_gtp_action_kind kind; + union { + /* En-/De-capsulate GTP: add/remove a GTP header and forward the GTP payload from/to plain IP. */ + struct pfcp_tool_tunend_desc tunend; - struct { - struct pfcp_tool_teid_pair teid; - struct osmo_sockaddr_str gtp_ip; - struct osmo_sockaddr_str ue_addr; - } core; + /* Tunnel-map GTP: translate from one TEID to another and forward */ + struct pfcp_tool_tunmap_desc tunmap; + }; }; struct g_pfcp_tool { diff --git a/src/osmo-pfcp-tool/pfcp_tool_vty.c b/src/osmo-pfcp-tool/pfcp_tool_vty.c index fcdbd67..dd76f9e 100644 --- a/src/osmo-pfcp-tool/pfcp_tool_vty.c +++ b/src/osmo-pfcp-tool/pfcp_tool_vty.c @@ -234,7 +234,7 @@ else *m = peer->last_resp; - OSMO_LOG_PFCP_MSG(m, LOGL_DEBUG, "retrans %s\n", argv[0]); + OSMO_LOG_PFCP_MSG(m, LOGL_INFO, "retrans %s\n", argv[0]); rc = osmo_pfcp_endpoint_tx_data(g_pfcp_tool->ep, m); if (rc) { @@ -261,15 +261,15 @@ { struct pfcp_tool_peer *peer = vty->index; struct pfcp_tool_session *session; - enum up_gtp_action_kind gtp_action = UP_GTP_U_TUNEND; + enum up_gtp_action_kind kind = UP_GTP_U_TUNEND; if (argc > 0 && !strcmp(argv[0], "tunmap")) - gtp_action = UP_GTP_U_TUNMAP; + kind = UP_GTP_U_TUNMAP; if (argc > 1) - session = pfcp_tool_session_find_or_create(peer, atoll(argv[1]), gtp_action); + session = pfcp_tool_session_find_or_create(peer, atoll(argv[1]), kind); else - session = pfcp_tool_session_find_or_create(peer, peer_new_seid(peer), gtp_action); + session = pfcp_tool_session_find_or_create(peer, peer_new_seid(peer), kind); vty->index = session; vty->node = SESSION_NODE; @@ -288,54 +288,112 @@ "IP address assigned to the UE\n") { struct pfcp_tool_session *session = vty->index; - if (osmo_sockaddr_str_from_str2(&session->core.ue_addr, argv[0])) { + + if (session->kind != UP_GTP_U_TUNEND) { + vty_out(vty, "%% Error: 'ue ip' makes no sense in a 'tunmap' session%s", VTY_NEWLINE); + return CMD_WARNING; + } + if (osmo_sockaddr_str_from_str2(&session->tunend.core.ue_local_addr, argv[0])) { vty_out(vty, "Error setting UE IP address%s", VTY_NEWLINE); return CMD_WARNING; } return CMD_SUCCESS; } -DEFUN(s_teid, s_teid_cmd, - "gtp (access|core) teid local <0-4294967295> remote <0-4294967295>", - "Setup TEID used in GTP\n" - "Set the TEIDs towards the ACCESS network (towards the radio network and the actual UE)\n" - "Set the TEIDs towards the CORE network (towards the internet)\n" - "Local TEID, which the UPF expects to see in incoming GTP packets\n" - "Local TEID, when 0 tell the UPF to choose (PFCP: FAR F-TEID: CHOOSE=1)\n" - "Remote TEID, which the UPF sends out in GTP packets\n" - "Remote TEID, which the GTP peer has assigned for itself\n") +#define GTP_ACCESS_CORE_STRS \ + "Setup GTP\n" \ + "Setup GTP towards ACCESS (towards the radio network and the actual UE)\n" \ + "Setup GTP towards CORE (towards the internet)\n" +#define GTP_LOCAL_STR "Setup GTP on the local side (UPF's local GTP endpoint)\n" +#define GTP_REMOTE_STR "Setup GTP on the remote side (UPF's remote GTP peer)\n" +#define F_TEID_STR "Set the fully-qualified TEID, i.e. GTP IP address and TEID\n" + +DEFUN(s_f_teid, s_f_teid_cmd, + "gtp (access|core) (local|remote) f-teid A.B.C.D <0-4294967295>", + GTP_ACCESS_CORE_STRS + GTP_LOCAL_STR GTP_REMOTE_STR + F_TEID_STR + "GTP peer IP address\n" + "GTP TEID\n") { struct pfcp_tool_session *session = vty->index; - struct pfcp_tool_teid_pair *dst; - if (!strcmp(argv[0], "access")) - dst = &session->access.teid; - else - dst = &session->core.teid; - *dst = (struct pfcp_tool_teid_pair){ - .local = atoi(argv[1]), - .remote = atoi(argv[2]), - }; + const char *tun_side = argv[0]; + const char *local_remote = argv[1]; + const char *addr_str = argv[2]; + const char *teid_str = argv[3]; + struct pfcp_tool_gtp_tun_ep *dst; + + switch (session->kind) { + case UP_GTP_U_TUNEND: + if (!strcmp(tun_side, "access")) { + if (!strcmp(local_remote, "local")) + dst = &session->tunend.access.local; + else + dst = &session->tunend.access.remote; + } else { + vty_out(vty, "%% Error: 'gtp core (local|remote) f-teid': 'tunend' only has GTP on" + " the 'access' side%s", VTY_NEWLINE); + return CMD_WARNING; + } + break; + case UP_GTP_U_TUNMAP: + if (!strcmp(tun_side, "access")) { + if (!strcmp(local_remote, "local")) + dst = &session->tunmap.access.local; + else + dst = &session->tunmap.access.remote; + } else { + if (!strcmp(local_remote, "local")) + dst = &session->tunmap.core.local; + else + dst = &session->tunmap.core.remote; + } + break; + default: + OSMO_ASSERT(0); + } + + if (osmo_sockaddr_str_from_str2(&dst->addr, addr_str)) { + vty_out(vty, "Error setting GTP IP address from %s%s", + osmo_quote_cstr_c(OTC_SELECT, addr_str, -1), VTY_NEWLINE); + return CMD_WARNING; + } + dst->teid = atoi(teid_str); return CMD_SUCCESS; } -DEFUN(s_gtp, s_gtp_cmd, - "gtp (access|core) ip A.B.C.D", - "Setup GTP peer\n" - "Set the GTP peer towards the ACCESS network (towards the radio network and the actual UE)\n" - "Set the GTP peer towards the CORE network (towards the internet)\n" - "Set the GTP peer IP address, where to send GTP packets to / receive GTP packets from\n" - "GTP peer IP address\n") +DEFUN(s_f_teid_choose, s_f_teid_choose_cmd, + "gtp (access|core) local f-teid choose", + GTP_ACCESS_CORE_STRS + GTP_LOCAL_STR + F_TEID_STR + "Send F-TEID with CHOOSE=1, i.e. the UPF shall return the local F-TEID in a PFCP Created PDR IE\n") { struct pfcp_tool_session *session = vty->index; - struct osmo_sockaddr_str *dst; - if (!strcmp(argv[0], "access")) - dst = &session->access.gtp_ip; - else - dst = &session->core.gtp_ip; - if (osmo_sockaddr_str_from_str2(dst, argv[1])) { - vty_out(vty, "Error setting GTP IP address%s", VTY_NEWLINE); - return CMD_WARNING; + const char *tun_side = argv[0]; + struct pfcp_tool_gtp_tun_ep *dst; + + switch (session->kind) { + case UP_GTP_U_TUNEND: + if (!strcmp(tun_side, "access")) { + dst = &session->tunend.access.local; + } else { + vty_out(vty, "%% Error: 'gtp core local choose': 'tunend' only has GTP on" + " the 'access' side%s", VTY_NEWLINE); + return CMD_WARNING; + } + break; + case UP_GTP_U_TUNMAP: + if (!strcmp(tun_side, "access")) + dst = &session->tunmap.access.local; + else + dst = &session->tunmap.core.local; + break; + default: + OSMO_ASSERT(0); } + + *dst = (struct pfcp_tool_gtp_tun_ep){}; return CMD_SUCCESS; } @@ -351,6 +409,8 @@ struct osmo_sockaddr ue_addr; struct osmo_pfcp_ie_f_seid cp_f_seid; + OSMO_ASSERT(session->kind == UP_GTP_U_TUNEND); + if (!g_pfcp_tool->ep) { vty_out(vty, "Endpoint not configured%s", VTY_NEWLINE); return CMD_WARNING; @@ -361,12 +421,17 @@ else osmo_pfcp_bits_set(aa.bits, OSMO_PFCP_APPLY_ACTION_FORW, true); - if (osmo_sockaddr_str_to_sockaddr(&session->core.ue_addr, &ue_addr.u.sas)) { - vty_out(vty, "Error in UE IP%s", VTY_NEWLINE); - return CMD_WARNING; - } +#define STR_TO_ADDR(DST, SRC) do { \ + if (osmo_sockaddr_str_to_sockaddr(&SRC, &DST.u.sas)) { \ + vty_out(vty, "Error in " #SRC ": " OSMO_SOCKADDR_STR_FMT "%s", \ + OSMO_SOCKADDR_STR_FMT_ARGS(&SRC), VTY_NEWLINE); \ + return CMD_WARNING; \ + } \ + } while (0) - if (session->access.teid.local == 0) { + STR_TO_ADDR(ue_addr, session->tunend.core.ue_local_addr); + + if (session->tunend.access.local.teid == 0) { f_teid_access_local = (struct osmo_pfcp_ie_f_teid){ .choose_flag = true, .choose = { @@ -376,29 +441,22 @@ } else { f_teid_access_local = (struct osmo_pfcp_ie_f_teid){ .fixed = { - .teid = session->access.teid.local, + .teid = session->tunend.access.local.teid, .ip_addr = { .v4_present = true, - .v4 = osmo_pfcp_endpoint_get_cfg(g_pfcp_tool->ep)->local_addr, }, }, }; - if (osmo_sockaddr_str_to_sockaddr(&session->access.gtp_ip, &f_teid_access_local.fixed.ip_addr.v4.u.sas)) { - vty_out(vty, "Error in GTP IP towards Access%s", VTY_NEWLINE); - return CMD_WARNING; - } + STR_TO_ADDR(f_teid_access_local.fixed.ip_addr.v4, session->tunend.access.local.addr); } ohc_access = (struct osmo_pfcp_ie_outer_header_creation){ .teid_present = true, - .teid = session->access.teid.remote, + .teid = session->tunend.access.remote.teid, .ip_addr.v4_present = true, }; osmo_pfcp_bits_set(ohc_access.desc_bits, OSMO_PFCP_OUTER_HEADER_CREATION_GTP_U_UDP_IPV4, true); - if (osmo_sockaddr_str_to_sockaddr(&session->access.gtp_ip, &ohc_access.ip_addr.v4.u.sas)) { - vty_out(vty, "Error in GTP IP towards Access%s", VTY_NEWLINE); - return CMD_WARNING; - } + STR_TO_ADDR(ohc_access.ip_addr.v4, session->tunend.access.remote.addr); cp_f_seid = (struct osmo_pfcp_ie_f_seid){ .seid = session->cp_seid, @@ -507,7 +565,7 @@ else osmo_pfcp_bits_set(aa.bits, OSMO_PFCP_APPLY_ACTION_FORW, true); - if (session->access.teid.local == 0) { + if (session->tunmap.access.local.teid == 0) { f_teid_access_local = (struct osmo_pfcp_ie_f_teid){ .choose_flag = true, .choose = { @@ -517,31 +575,25 @@ } else { f_teid_access_local = (struct osmo_pfcp_ie_f_teid){ .fixed = { - .teid = session->access.teid.local, + .teid = session->tunmap.access.local.teid, .ip_addr = { .v4_present = true, .v4 = osmo_pfcp_endpoint_get_cfg(g_pfcp_tool->ep)->local_addr, }, }, }; - if (osmo_sockaddr_str_to_sockaddr(&session->access.gtp_ip, &f_teid_access_local.fixed.ip_addr.v4.u.sas)) { - vty_out(vty, "Error in GTP IP towards Access%s", VTY_NEWLINE); - return CMD_WARNING; - } + STR_TO_ADDR(f_teid_access_local.fixed.ip_addr.v4, session->tunmap.access.local.addr); } ohc_access = (struct osmo_pfcp_ie_outer_header_creation){ .teid_present = true, - .teid = session->access.teid.remote, + .teid = session->tunmap.access.remote.teid, .ip_addr.v4_present = true, }; osmo_pfcp_bits_set(ohc_access.desc_bits, OSMO_PFCP_OUTER_HEADER_CREATION_GTP_U_UDP_IPV4, true); - if (osmo_sockaddr_str_to_sockaddr(&session->access.gtp_ip, &ohc_access.ip_addr.v4.u.sas)) { - vty_out(vty, "Error in GTP IP towards Access%s", VTY_NEWLINE); - return CMD_WARNING; - } + STR_TO_ADDR(ohc_access.ip_addr.v4, session->tunmap.access.remote.addr); - if (session->core.teid.local == 0) { + if (session->tunmap.core.local.teid == 0) { f_teid_core_local = (struct osmo_pfcp_ie_f_teid){ .choose_flag = true, .choose = { @@ -551,28 +603,21 @@ } else { f_teid_core_local = (struct osmo_pfcp_ie_f_teid){ .fixed = { - .teid = session->core.teid.local, + .teid = session->tunmap.core.local.teid, .ip_addr = { .v4_present = true, - .v4 = osmo_pfcp_endpoint_get_cfg(g_pfcp_tool->ep)->local_addr, }, }, }; - if (osmo_sockaddr_str_to_sockaddr(&session->core.gtp_ip, &f_teid_core_local.fixed.ip_addr.v4.u.sas)) { - vty_out(vty, "Error in GTP IP towards Core%s", VTY_NEWLINE); - return CMD_WARNING; - } + STR_TO_ADDR(f_teid_core_local.fixed.ip_addr.v4, session->tunmap.core.local.addr); } ohc_core = (struct osmo_pfcp_ie_outer_header_creation){ .teid_present = true, - .teid = session->core.teid.remote, + .teid = session->tunmap.core.remote.teid, .ip_addr.v4_present = true, }; osmo_pfcp_bits_set(ohc_core.desc_bits, OSMO_PFCP_OUTER_HEADER_CREATION_GTP_U_UDP_IPV4, true); - if (osmo_sockaddr_str_to_sockaddr(&session->core.gtp_ip, &ohc_core.ip_addr.v4.u.sas)) { - vty_out(vty, "Error in GTP IP towards Core%s", VTY_NEWLINE); - return CMD_WARNING; - } + STR_TO_ADDR(ohc_core.ip_addr.v4, session->tunmap.core.remote.addr); cp_f_seid = (struct osmo_pfcp_ie_f_seid){ .seid = session->cp_seid, @@ -660,7 +705,7 @@ "Set FAR to DROP = 1\n") { struct pfcp_tool_session *session = vty->index; - switch (session->gtp_action) { + switch (session->kind) { case UP_GTP_U_TUNEND: return session_tunend_tx_est_req(vty, argv, argc); case UP_GTP_U_TUNMAP: @@ -790,6 +835,6 @@ install_element(SESSION_NODE, &session_tx_mod_req_cmd); install_element(SESSION_NODE, &session_tx_del_req_cmd); install_element(SESSION_NODE, &s_ue_cmd); - install_element(SESSION_NODE, &s_gtp_cmd); - install_element(SESSION_NODE, &s_teid_cmd); + install_element(SESSION_NODE, &s_f_teid_cmd); + install_element(SESSION_NODE, &s_f_teid_choose_cmd); } -- To view, visit https://gerrit.osmocom.org/c/osmo-upf/+/31193 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-upf Gerrit-Branch: master Gerrit-Change-Id: I22cfaa4aedd465c81de85e673b9960eaf99c426b Gerrit-Change-Number: 31193 Gerrit-PatchSet: 5 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
Change in osmo-upf[master]: tunmap: prep new nft ruleset: log only mapping id
by neels 10 Feb '23

10 Feb '23
neels has submitted this change. ( https://gerrit.osmocom.org/c/osmo-upf/+/31164 ) Change subject: tunmap: prep new nft ruleset: log only mapping id ...................................................................... tunmap: prep new nft ruleset: log only mapping id Instead of logging a full nft chain/rule name like 'tunmap123', log only the id '123'. Rationale: with the new nft rulesets, there will be four distinct identifiers: tunmap-pre-123a tunmap-pre-123b tunmap-post-123a tunmap-post-123b so let's simplify. Related: SYS#6327 SYS#6264 Change-Id: Ic46ae5bd824a211668d4ac9a77b3597eaca17146 --- M src/osmo-upf/up_gtp_action.c 1 file changed, 4 insertions(+), 4 deletions(-) Approvals: neels: Looks good to me, approved laforge: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-upf/up_gtp_action.c b/src/osmo-upf/up_gtp_action.c index 238d652..68f5fb9 100644 --- a/src/osmo-upf/up_gtp_action.c +++ b/src/osmo-upf/up_gtp_action.c @@ -125,13 +125,13 @@ if (enable && a->tunmap.id != 0) { LOG_UP_GTP_ACTION(a, LOGL_ERROR, "Cannot enable: nft GTP tunnel mapping rule has been enabled before" - " as " NFT_CHAIN_NAME_PREFIX_TUNMAP "%u\n", a->tunmap.id); + " as nft rule id %u\n", a->tunmap.id); return -EALREADY; } if (!enable && a->tunmap.id == 0) { LOG_UP_GTP_ACTION(a, LOGL_ERROR, "Cannot disable: nft GTP tunnel mapping rule has not been enabled" - " (no " NFT_CHAIN_NAME_PREFIX_TUNMAP " id)\n"); + " (no nft rule id)\n"); return -ENOENT; } if (enable) @@ -140,11 +140,11 @@ rc = upf_nft_tunmap_delete(&a->tunmap); if (rc) { LOG_UP_GTP_ACTION(a, LOGL_ERROR, - "Failed to %s nft GTP tunnel mapping " NFT_CHAIN_NAME_PREFIX_TUNMAP "%u:" + "Failed to %s nft GTP tunnel mapping %u:" " %d %s\n", enable ? "enable" : "disable", a->tunmap.id, rc, strerror(-rc)); return rc; } - LOG_UP_GTP_ACTION(a, LOGL_NOTICE, "%s nft GTP tunnel mapping " NFT_CHAIN_NAME_PREFIX_TUNMAP "%u\n", + LOG_UP_GTP_ACTION(a, LOGL_NOTICE, "%s nft GTP tunnel mapping %u\n", enable ? "Enabled" : "Disabled", a->tunmap.id); if (!enable) a->tunmap.id = 0; -- To view, visit https://gerrit.osmocom.org/c/osmo-upf/+/31164 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-upf Gerrit-Branch: master Gerrit-Change-Id: Ic46ae5bd824a211668d4ac9a77b3597eaca17146 Gerrit-Change-Number: 31164 Gerrit-PatchSet: 2 Gerrit-Owner: neels <nhofmeyr(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-MessageType: merged
1 0
0 0
Change in osmo-upf[master]: tunmap: ensure nft table is removed on program exit
by neels 10 Feb '23

10 Feb '23
neels has submitted this change. ( https://gerrit.osmocom.org/c/osmo-upf/+/31166 ) Change subject: tunmap: ensure nft table is removed on program exit ...................................................................... tunmap: ensure nft table is removed on program exit Make the nft table owned by the osmo-upf process, so that any kind of graceful or ungraceful exit will drop all tunmap rules implicitly. Related: SYS#6327 SYS#6264 Change-Id: Ia26bb295849905ccfeaec801d7b187bf85f21366 --- M src/osmo-upf/upf_nft.c M tests/nft-rule.vty 2 files changed, 2 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified neels: Looks good to me, approved osmith: Looks good to me, but someone else must approve diff --git a/src/osmo-upf/upf_nft.c b/src/osmo-upf/upf_nft.c index ddd556b..9faeb1e 100644 --- a/src/osmo-upf/upf_nft.c +++ b/src/osmo-upf/upf_nft.c @@ -32,7 +32,7 @@ static char *upf_nft_ruleset_table_create(void *ctx, const char *table_name) { - return talloc_asprintf(ctx, "add table inet %s\n", table_name); + return talloc_asprintf(ctx, "add table inet %s { flags owner; };\n", table_name); } static char *upf_nft_ruleset_vmap_init(void *ctx, const char *table_name, int priority_pre, int priority_post) diff --git a/tests/nft-rule.vty b/tests/nft-rule.vty index c226191..0fe3648 100644 --- a/tests/nft-rule.vty +++ b/tests/nft-rule.vty @@ -4,7 +4,7 @@ OsmoUPF(config-tunmap)# show nft-rule tunmap example % init verdict map: -add table inet osmo-upf +add table inet osmo-upf { flags owner; }; add chain inet osmo-upf pre { type filter hook prerouting priority -300; policy accept; }; add chain inet osmo-upf post { type filter hook postrouting priority 400; policy accept; }; -- To view, visit https://gerrit.osmocom.org/c/osmo-upf/+/31166 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-upf Gerrit-Branch: master Gerrit-Change-Id: Ia26bb295849905ccfeaec801d7b187bf85f21366 Gerrit-Change-Number: 31166 Gerrit-PatchSet: 7 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 168
  • 169
  • 170
  • 171
  • 172
  • 173
  • 174
  • ...
  • 261
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.