[UPF] Improve logging around IP spoofing (#1441)

* [UPF] Fix Trailing whitespace

* [UPF] Improve logging around IP spoofing

Related: https://github.com/open5gs/open5gs/issues/1435
This commit is contained in:
Pau Espin 2022-03-16 13:59:50 +01:00 committed by GitHub
parent bf77318602
commit 7f6f35fe6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 11 deletions

View File

@ -427,8 +427,8 @@ static void _gtpv1_u_recv_cb(short when, ogs_socket_t fd, void *data)
if (src_addr[0] == sess->ipv4->addr[0]) {
/* Source IP address should be matched in uplink */
} else {
ogs_error("[DROP] Source IP-%d Spoofing SrcIf:%d DstIf:%d",
ip_h->ip_v, pdr->src_if, far->dst_if);
ogs_error("[DROP] Source IP-%d Spoofing APN:%s SrcIf:%d DstIf:%d TEID:0x%x",
ip_h->ip_v, pdr->dnn, pdr->src_if, far->dst_if, teid);
ogs_error(" SRC:%08X, UE:%08X",
be32toh(src_addr[0]), be32toh(sess->ipv4->addr[0]));
ogs_log_hexdump(OGS_LOG_ERROR, pkbuf->data, pkbuf->len);
@ -473,8 +473,8 @@ static void _gtpv1_u_recv_cb(short when, ogs_socket_t fd, void *data)
* 64 bit prefix should be matched
*/
} else {
ogs_error("[DROP] Source IP-%d Spoofing SrcIf:%d DstIf:%d",
ip_h->ip_v, pdr->src_if, far->dst_if);
ogs_error("[DROP] Source IP-%d Spoofing APN:%s SrcIf:%d DstIf:%d TEID:0x%x",
ip_h->ip_v, pdr->dnn, pdr->src_if, far->dst_if, teid);
ogs_error("SRC:%08x %08x %08x %08x",
be32toh(src_addr[0]), be32toh(src_addr[1]),
be32toh(src_addr[2]), be32toh(src_addr[3]));