diff --git a/src/osmo-pfcp-tool/pfcp_tool.c b/src/osmo-pfcp-tool/pfcp_tool.c index ff93cd0..ae77f64 100644 --- a/src/osmo-pfcp-tool/pfcp_tool.c +++ b/src/osmo-pfcp-tool/pfcp_tool.c @@ -159,13 +159,22 @@ void pfcp_tool_rx_msg(struct osmo_pfcp_endpoint *ep, struct osmo_pfcp_msg *m, st } } +static void copy_msg(struct osmo_pfcp_msg *dst, const struct osmo_pfcp_msg *m) +{ + *dst = *m; + dst->encoded = NULL; + dst->ctx.peer_use_token = NULL; + dst->ctx.session_use_token = NULL; + dst->ctx.resp_cb = NULL; +} + int peer_tx(struct pfcp_tool_peer *peer, struct osmo_pfcp_msg *m) { int rc; if (m->is_response) - peer->last_resp = *m; + copy_msg(&peer->last_resp, m); else - peer->last_req = *m; + copy_msg(&peer->last_req, m); rc = osmo_pfcp_endpoint_tx(g_pfcp_tool->ep, m); return rc; }