neels has submitted this change. ( https://gerrit.osmocom.org/c/osmo-upf/+/30491 )
Change subject: nft: rename addr to addr_remote, add addr_local ......................................................................
nft: rename addr to addr_remote, add addr_local
Change-Id: I8d2ca99b17c26d1a869f4d84ad57157d29d9750b --- M src/osmo-upf/upf_nft.c 1 file changed, 9 insertions(+), 5 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 4a2ca23..1b7d9c0 100644 --- a/src/osmo-upf/upf_nft.c +++ b/src/osmo-upf/upf_nft.c @@ -98,9 +98,11 @@
struct upf_nft_args_peer { /* The source IP address in packets received from this peer */ - const struct osmo_sockaddr *addr; + const struct osmo_sockaddr *addr_remote; /* The TEID that we send to the peer in GTP packets. */ uint32_t teid_remote; + /* The local destination IP address in packets received from this peer */ + const struct osmo_sockaddr *addr_local; /* The TEID that the peer sends to us in GTP packets. */ uint32_t teid_local; }; @@ -129,14 +131,14 @@
/* Match on packets coming in from from_peer */ OSMO_STRBUF_PRINTF(sb, " ip saddr "); - OSMO_STRBUF_APPEND(sb, osmo_sockaddr_to_str_buf2, from_peer->addr); + OSMO_STRBUF_APPEND(sb, osmo_sockaddr_to_str_buf2, from_peer->addr_remote);
/* Match on the TEID in the header */ OSMO_STRBUF_PRINTF(sb, " @ih,32,32 0x%08x", from_peer->teid_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); + OSMO_STRBUF_APPEND(sb, osmo_sockaddr_to_str_buf2, to_peer->addr_remote);
/* Change the TEID in the header to the one to_peer expects */ OSMO_STRBUF_PRINTF(sb, " @ih,32,32 set 0x%08x", to_peer->teid_remote); @@ -187,13 +189,15 @@ .chain_id = tunmap->id, .priority = g_upf->nft.priority, .peer_a = { - .addr = &tunmap->access.gtp_remote_addr, + .addr_remote = &tunmap->access.gtp_remote_addr, .teid_remote = tunmap->access.remote_teid, + .addr_local = &tunmap->access.gtp_local_addr, .teid_local = tunmap->access.local_teid, }, .peer_b = { - .addr = &tunmap->core.gtp_remote_addr, + .addr_remote = &tunmap->core.gtp_remote_addr, .teid_remote = tunmap->core.remote_teid, + .addr_local = &tunmap->core.gtp_local_addr, .teid_local = tunmap->core.local_teid, }, };