nft: rewrite source IP in outgoing GTP-U

Change-Id: I6d293c1dc69d1bab714564f48e3f85b769501d13
This commit is contained in:
Neels Hofmeyr 2022-12-05 16:25:44 +01:00 committed by neels
parent 341e130841
commit 95e56eaecb
1 changed files with 4 additions and 0 deletions

View File

@ -136,6 +136,10 @@ static int tunmap_single_direction(char *buf, size_t buflen,
/* Match on the TEID in the header */
OSMO_STRBUF_PRINTF(sb, " @ih,32,32 0x%08x", from_peer->teid_local);
/* Change outgoing address to local IP on outgoing interface */
OSMO_STRBUF_PRINTF(sb, " ip saddr set ");
OSMO_STRBUF_APPEND(sb, osmo_sockaddr_to_str_buf2, to_peer->addr_local);
/* Change destination address to to_peer */
OSMO_STRBUF_PRINTF(sb, " ip daddr set ");
OSMO_STRBUF_APPEND(sb, osmo_sockaddr_to_str_buf2, to_peer->addr_remote);