Skip to content

Commit

Permalink
router: fix F-TEID interface_type
Browse files Browse the repository at this point in the history
properly set interface_type for GTP-C and GTP-U
  • Loading branch information
acassen committed Aug 28, 2024
1 parent 7d5f37e commit 5694d33
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/gtp_router_hdl.c
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ gtpc_pkt_put_pco(pkt_buffer_t *pbuff, gtp_pco_t *pco, sipcp_t *ipcp)
}

static int
gtpc_pkt_put_f_teid(pkt_buffer_t *pbuff, gtp_teid_t *teid, uint8_t instance)
gtpc_pkt_put_f_teid(pkt_buffer_t *pbuff, gtp_teid_t *teid, uint8_t instance, uint8_t type)
{
gtp_ie_f_teid_t *f_teid;
uint16_t len = sizeof(gtp_ie_f_teid_t);
Expand All @@ -498,7 +498,7 @@ gtpc_pkt_put_f_teid(pkt_buffer_t *pbuff, gtp_teid_t *teid, uint8_t instance)
f_teid = (gtp_ie_f_teid_t *) pbuff->data;
f_teid->h.instance = instance;
f_teid->v4 = 1;
f_teid->interface_type = GTP_TEID_INTERFACE_TYPE_SGW_GTPC;
f_teid->interface_type = type;
f_teid->teid_grekey = teid->id;
f_teid->ipv4 = teid->ipv4;
pkt_buffer_put_data(pbuff, len);
Expand Down Expand Up @@ -581,7 +581,7 @@ gtpc_pkt_put_bearer_context(pkt_buffer_t *pbuff, gtp_session_t *s, gtp_teid_t *t

err = err ? : gtpc_pkt_put_eps_bearer_id(pbuff, apn->eps_bearer_id);
err = err ? : gtpc_pkt_put_cause(pbuff, GTP_CAUSE_REQUEST_ACCEPTED);
err = err ? : gtpc_pkt_put_f_teid(pbuff, teid, 2);
err = err ? : gtpc_pkt_put_f_teid(pbuff, teid, 2, GTP_TEID_INTERFACE_TYPE_SGW_GTPU);
err = err ? : gtpc_pkt_put_charging_id(pbuff, s->charging_id);
if (err)
return 1;
Expand Down Expand Up @@ -629,7 +629,7 @@ gtpc_build_create_session_response(pkt_buffer_t *pbuff, gtp_session_t *s, gtp_te
err = err ? : gtpc_pkt_put_recovery(pbuff);
err = err ? : gtpc_pkt_put_indication(pbuff, apn->indication_flags);
err = err ? : gtpc_pkt_put_pco(pbuff, apn->pco, ipcp);
err = err ? : gtpc_pkt_put_f_teid(pbuff, teid->peer_teid, 1);
err = err ? : gtpc_pkt_put_f_teid(pbuff, teid->peer_teid, 1, GTP_TEID_INTERFACE_TYPE_SGW_GTPC);
err = err ? : gtpc_pkt_put_apn_restriction(pbuff, apn);
err = err ? : gtpc_pkt_put_paa(pbuff, s->ipv4);
err = err ? : gtpc_pkt_put_bearer_context(pbuff, s, teid->peer_teid);
Expand Down

0 comments on commit 5694d33

Please sign in to comment.