neels has submitted this change. ( https://gerrit.osmocom.org/c/osmo-upf/+/30493 )
Change subject: nft: rewrite source IP in outgoing GTP-U ......................................................................
nft: rewrite source IP in outgoing GTP-U
Change-Id: I6d293c1dc69d1bab714564f48e3f85b769501d13 --- M src/osmo-upf/upf_nft.c 1 file changed, 4 insertions(+), 0 deletions(-)
Approvals: laforge: Looks good to me, approved Jenkins Builder: Verified
diff --git a/src/osmo-upf/upf_nft.c b/src/osmo-upf/upf_nft.c index 695ec20..a8ca90d 100644 --- a/src/osmo-upf/upf_nft.c +++ b/src/osmo-upf/upf_nft.c @@ -136,6 +136,10 @@ /* 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);