Skip to content

Commit e1cb358

Browse files
committed
switch: fix dummy_teid handling
when using GTP-C ingress/egress split configuration, echo-request messages MUST not be forwarded and rather handled directly by receiving peer.
1 parent 5421be1 commit e1cb358

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.6
1+
1.0.7pre0

lib/config.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#define LOG_FACILITY_MAX 7
2626
#define PROG "gtp-guard"
2727
#define PROG_PID_FILE "/var/run/gtp-guard.pid"
28-
#define VERSION_STRING PROG " v1.0.6 (2024/06/23)"
28+
#define VERSION_STRING PROG " v1.0.7pre0 (2024/06/23)"
2929
#define COPYRIGHT_STRING "Copyright (C) 2023-2024 Alexandre Cassen, <acassen@gmail.com>"
3030

3131

src/gtp_switch.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ gtp_switch_ingress_process(gtp_server_worker_t *w, struct sockaddr_storage *addr
137137

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

144144
return 0;

src/include/gtp_teid.h

+3
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ enum gtp_teid_flags {
4242
GTP_TEID_FL_XDP_SET,
4343
};
4444

45+
/* Defines */
46+
#define TEID_IS_DUMMY(X) ((X)->type == 0xff)
47+
4548
/* GTP Connection tracking */
4649
typedef struct _gtp_teid {
4750
uint8_t version; /* GTPv1 or GTPv2 */

0 commit comments

Comments
 (0)