lynxis lazus has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ggsn/+/40434?usp=email )
(
3 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: gtp: internal LOGP_WITH_ADDR macro: use pointer of peer ......................................................................
gtp: internal LOGP_WITH_ADDR macro: use pointer of peer
Using a pointer is more universal for the macro. Further the upcoming SGSN Context Req/Response/Ack code will use a peer pointer instead of the direct object.
Change-Id: Iab11a8b07eb177c479e1920cd7fa8be2099a4b7b --- M gtp/gsn.c M gtp/gtp.c 2 files changed, 3 insertions(+), 3 deletions(-)
Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved pespin: Looks good to me, but someone else must approve
diff --git a/gtp/gsn.c b/gtp/gsn.c index b8b752f..2409566 100644 --- a/gtp/gsn.c +++ b/gtp/gsn.c @@ -69,7 +69,7 @@
#define LOGP_WITH_ADDR(ss, level, addr, fmt, args...) \ LOGP(ss, level, "addr(%s:%d) " fmt, \ - inet_ntoa((addr).sin_addr), ntohs((addr).sin_port), \ + inet_ntoa((addr)->sin_addr), ntohs((addr)->sin_port), \ ##args)
static const struct rate_ctr_desc gsn_ctr_description[] = { @@ -453,7 +453,7 @@
if (bind(*fd, (struct sockaddr *)&addr, sizeof(addr)) < 0) { rate_ctr_inc2(gsn->ctrg, GSN_CTR_ERR_SOCKET); - LOGP_WITH_ADDR(DLGTP, LOGL_ERROR, addr, + LOGP_WITH_ADDR(DLGTP, LOGL_ERROR, &addr, "%s bind(fd=%d) failed: Error = %s\n", name, *fd, strerror(errno)); return -errno; diff --git a/gtp/gtp.c b/gtp/gtp.c index eb00d19..d17a4de 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -74,7 +74,7 @@
#define LOGP_WITH_ADDR(ss, level, addr, fmt, args...) \ LOGP(ss, level, "addr(%s:%d) " fmt, \ - inet_ntoa((addr).sin_addr), htons((addr).sin_port), \ + inet_ntoa((addr)->sin_addr), htons((addr)->sin_port), \ ##args);
TALLOC_CTX *tall_libgtp_ctx = NULL;