aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gtp/gsn.c3
-rw-r--r--gtp/gsn.h1
-rw-r--r--gtp/gtp.c4
3 files changed, 7 insertions, 1 deletions
diff --git a/gtp/gsn.c b/gtp/gsn.c
index da30fc9..ce66244 100644
--- a/gtp/gsn.c
+++ b/gtp/gsn.c
@@ -108,6 +108,9 @@ struct osmo_tdef gtp_T_defs[] = {
{ .T = GTP_GSN_TIMER_N3_REQUESTS, .default_val = 3, .unit = OSMO_TDEF_CUSTOM,
.desc = "Counter N3-REQUESTS holds the maximum number of attempts made by GTP to send a request message"
},
+ { .T = GTP_GSN_TIMER_T3_HOLD_RESPONSE, .default_val = 5 * 3 /* (GTP_GSN_TIMER_T3_RESPONSE * GTP_GSN_TIMER_N3_REQUESTS) */, .unit = OSMO_TDEF_S,
+ .desc = "Time a GTP respoonse message is kept cached to re-transmit it when a duplicate request is received. Value is generally equal to (T3-RESPONSE * N3-REQUESTS) set at the peer"
+ },
{}
};
diff --git a/gtp/gsn.h b/gtp/gsn.h
index 3b9cb1d..8e47ce3 100644
--- a/gtp/gsn.h
+++ b/gtp/gsn.h
@@ -67,6 +67,7 @@ enum gsn_rate_ctr_keys {
enum gtp_gsn_timers {
GTP_GSN_TIMER_T3_RESPONSE = 3,
GTP_GSN_TIMER_N3_REQUESTS = 1003,
+ GTP_GSN_TIMER_T3_HOLD_RESPONSE = -3,
};
struct gsn_t {
diff --git a/gtp/gtp.c b/gtp/gtp.c
index f32461c..1ebc6dc 100644
--- a/gtp/gtp.c
+++ b/gtp/gtp.c
@@ -499,11 +499,13 @@ static int gtp_resp(uint8_t version, struct gsn_t *gsn, struct pdp_t *pdp,
LOGP(DLGTP, LOGL_ERROR, "Retransmit resp queue is full (seq=%" PRIu16 ")\n",
seq);
} else {
+ unsigned int t3_hold_resp;
LOGP(DLGTP, LOGL_DEBUG, "Registering seq=%" PRIu16
" in restransmit resp queue\n", seq);
+ t3_hold_resp = osmo_tdef_get(gsn->tdef, GTP_GSN_TIMER_T3_HOLD_RESPONSE, OSMO_TDEF_S, -1);
memcpy(&qmsg->p, packet, sizeof(union gtp_packet));
qmsg->l = len;
- qmsg->timeout = time(NULL) + 60; /* When to timeout */
+ qmsg->timeout = time(NULL) + t3_hold_resp; /* When to timeout */
qmsg->retrans = 0; /* No retransmissions so far */
qmsg->cbp = NULL;
qmsg->type = 0;