diff options
-rw-r--r-- | gtp/gsn.c | 3 | ||||
-rw-r--r-- | gtp/gsn.h | 1 | ||||
-rw-r--r-- | gtp/gtp.c | 4 |
3 files changed, 7 insertions, 1 deletions
@@ -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" + }, {} }; @@ -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 { @@ -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; |