osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/38735?usp=email )
Change subject: Make compatible with private pfcp structs ......................................................................
Make compatible with private pfcp structs
Adjust OsmoHNBGW to build with newer versions of libosmo-pfcp, where osmo_pfcp_cp_peer was made private. This based on Pau's patch 1ac1d127 ("hnbgw: Avoid using struct osmo_pfcp_cp_peer fields directly").
Related: OS#6617 Change-Id: I188e76307deadd9328430afff54dc287eda51370 --- M configure.ac M src/osmo-hnbgw/context_map_sccp.c M src/osmo-hnbgw/ps_rab_fsm.c 3 files changed, 16 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/35/38735/1
diff --git a/configure.ac b/configure.ac index b6f013e..ac1fc0f 100644 --- a/configure.ac +++ b/configure.ac @@ -228,6 +228,12 @@ AC_MSG_RESULT([CFLAGS="$CFLAGS"]) AC_MSG_RESULT([CPPFLAGS="$CPPFLAGS"])
+# OS#6617 +AC_CHECK_DECL([osmo_pfcp_cp_peer_next_seid], + [AC_DEFINE(PFCP_PRIVATE_STRUCTS, [1], ["OS#6617"])], + [], + [[#include <osmocom/pfcp/pfcp_cp_peer.h>]]) + dnl Generate the output AM_CONFIG_HEADER(config.h)
diff --git a/src/osmo-hnbgw/context_map_sccp.c b/src/osmo-hnbgw/context_map_sccp.c index 511577c..a92b3d6 100644 --- a/src/osmo-hnbgw/context_map_sccp.c +++ b/src/osmo-hnbgw/context_map_sccp.c @@ -241,7 +241,11 @@ if (hnb_gw_is_gtp_mapping_enabled()) { LOGP(DMAIN, LOGL_DEBUG, "RAB Assignment: setting up GTP tunnel mapping via UPF %s\n", +#ifdef PFCP_PRIVATE_STRUCTS + osmo_sockaddr_to_str_c(OTC_SELECT, osmo_pfcp_cp_peer_get_remote_addr(g_hnbgw->pfcp.cp_peer))); +#else osmo_sockaddr_to_str_c(OTC_SELECT, &g_hnbgw->pfcp.cp_peer->remote_addr)); +#endif return hnbgw_gtpmap_rx_rab_ass_req(map, ranap_msg, message); } /* If no UPF is configured, directly forward the message as-is (no GTP mapping). */ diff --git a/src/osmo-hnbgw/ps_rab_fsm.c b/src/osmo-hnbgw/ps_rab_fsm.c index 8905540..bc85e2f 100644 --- a/src/osmo-hnbgw/ps_rab_fsm.c +++ b/src/osmo-hnbgw/ps_rab_fsm.c @@ -17,6 +17,8 @@
#include <errno.h>
+#include "config.h" + #include <osmocom/core/tdef.h>
#include <osmocom/pfcp/pfcp_endpoint.h> @@ -320,7 +322,11 @@ m->h.seid = 0;
/* Make a new CP-SEID, our local reference for the PFCP session. */ +#ifdef PFCP_PRIVATE_STRUCTS + rab->cp_seid = osmo_pfcp_cp_peer_next_seid(g_hnbgw->pfcp.cp_peer); +#else rab->cp_seid = osmo_pfcp_next_seid(&g_hnbgw->pfcp.cp_peer->next_seid_state); +#endif cp_f_seid = (struct osmo_pfcp_ie_f_seid){ .seid = rab->cp_seid, };