lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ggsn/+/40433?usp=email )
Change subject: gtp.c: no-op: use ntohs instead of htons ......................................................................
gtp.c: no-op: use ntohs instead of htons
Even the operation is the same, the sin_port is in network order.
Change-Id: Iebb031debfa7706f0ab682c94492b37573ae918d --- M gtp/gsn.c M gtp/gtp.c 2 files changed, 2 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/33/40433/1
diff --git a/gtp/gsn.c b/gtp/gsn.c index 7022212..b8b752f 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), htons((addr).sin_port), \ + inet_ntoa((addr).sin_addr), ntohs((addr).sin_port), \ ##args)
static const struct rate_ctr_desc gsn_ctr_description[] = { diff --git a/gtp/gtp.c b/gtp/gtp.c index 9f2d484..aaed27b 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -68,7 +68,7 @@ #define GTP_LOGPKG(pri, peer, pack, len, fmt, args...) \ logp2(DLGTP, pri, __FILE__, __LINE__, 0, \ "Packet from %s:%u, length: %d content: %s: " fmt, \ - inet_ntoa((peer)->sin_addr), htons((peer)->sin_port), \ + inet_ntoa((peer)->sin_addr), ntohs((peer)->sin_port), \ len, osmo_hexdump((const uint8_t *) pack, len), \ ##args);