This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
laforge gerrit-no-reply at lists.osmocom.orglaforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/22559 )
Change subject: ns2: Properly report packet drops in FR code
......................................................................
ns2: Properly report packet drops in FR code
When the FR code decides to drop a packet (ENOBUFS from the AF_PACKET
socket for non-signaling packet), let's report that back via the
frame_relay code into the generic NS2 code.
This way the generic NS2 code always knows if a packet was actually
successfully transmitted, or if it was dropped for some reason.
Change-Id: I4bb517fd04af69dbe6da628b132d57994ab3e5a4
---
M src/gb/gprs_ns2_fr.c
1 file changed, 6 insertions(+), 5 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/59/22559/1
diff --git a/src/gb/gprs_ns2_fr.c b/src/gb/gprs_ns2_fr.c
index 854eccf..ba76c71 100644
--- a/src/gb/gprs_ns2_fr.c
+++ b/src/gb/gprs_ns2_fr.c
@@ -320,7 +320,7 @@
#define LMI_Q933A_DLCI 0
/* enqueue to backlog (LMI, signaling) or drop (userdata msg) */
-static void backlog_enqueue_or_free(struct priv_bind *priv, struct msgb *msg)
+static int backlog_enqueue_or_free(struct priv_bind *priv, struct msgb *msg)
{
uint8_t dlci = msg->data[0];
uint8_t ns_pdu_type;
@@ -333,7 +333,7 @@
/* enqueue Q.933 LMI at head of queue */
llist_add(&msg->list, &priv->backlog.list);
osmo_timer_schedule(&priv->backlog.timer, 0, priv->backlog.retry_us);
- return;
+ return 0;
}
if (msgb_length(msg) < 3)
goto out_free;
@@ -343,11 +343,12 @@
/* enqueue NS signaling traffic at tail of queue */
llist_add_tail(&msg->list, &priv->backlog.list);
osmo_timer_schedule(&priv->backlog.timer, 0, priv->backlog.retry_us);
- return;
+ return 0;
}
out_free:
msgb_free(msg);
+ return -1;
}
static void fr_backlog_timer_cb(void *data)
@@ -387,11 +388,11 @@
rc = fr_netif_write_one(bind, msg);
if (rc < 0) {
/* enqueue to backlog in case it fails */
- backlog_enqueue_or_free(priv, msg);
+ return backlog_enqueue_or_free(priv, msg);
}
} else {
/* enqueue to backlog */
- backlog_enqueue_or_free(priv, msg);
+ return backlog_enqueue_or_free(priv, msg);
}
return 0;
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/22559
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I4bb517fd04af69dbe6da628b132d57994ab3e5a4
Gerrit-Change-Number: 22559
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210130/d1d56cf8/attachment.htm>