Skip to content

Commit

Permalink
switch: fix dummy_teid handling
Browse files Browse the repository at this point in the history
when using GTP-C ingress/egress split configuration, echo-request messages MUST not be forwarded and
rather handled directly by receiving peer.
  • Loading branch information
acassen committed Jun 23, 2024
1 parent 5421be1 commit e1cb358
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.6
1.0.7pre0
2 changes: 1 addition & 1 deletion lib/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#define LOG_FACILITY_MAX 7
#define PROG "gtp-guard"
#define PROG_PID_FILE "/var/run/gtp-guard.pid"
#define VERSION_STRING PROG " v1.0.6 (2024/06/23)"
#define VERSION_STRING PROG " v1.0.7pre0 (2024/06/23)"
#define COPYRIGHT_STRING "Copyright (C) 2023-2024 Alexandre Cassen, <[email protected]>"


Expand Down
4 changes: 2 additions & 2 deletions src/gtp_switch.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ gtp_switch_ingress_process(gtp_server_worker_t *w, struct sockaddr_storage *addr

/* Set destination address */
gtp_switch_fwd_addr_get(teid, addr_from, &addr_to);
gtp_server_send(w, fd
, (teid->type == 0xff) ? (struct sockaddr_in *) addr_from : &addr_to);
gtp_server_send(w, TEID_IS_DUMMY(teid) ? w->fd : fd
, TEID_IS_DUMMY(teid) ? (struct sockaddr_in *) addr_from : &addr_to);
gtpc_switch_handle_post(w, teid);

return 0;
Expand Down
3 changes: 3 additions & 0 deletions src/include/gtp_teid.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ enum gtp_teid_flags {
GTP_TEID_FL_XDP_SET,
};

/* Defines */
#define TEID_IS_DUMMY(X) ((X)->type == 0xff)

/* GTP Connection tracking */
typedef struct _gtp_teid {
uint8_t version; /* GTPv1 or GTPv2 */
Expand Down

0 comments on commit e1cb358

Please sign in to comment.