Change in ...osmo-sip-connector[master]: inet_ntoa() is deprecated, use inet_ntop() instead

2019-08-06 Thread keith
keith has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/c/osmo-sip-connector/+/15065 )

Change subject: inet_ntoa() is deprecated, use inet_ntop() instead
..

inet_ntoa() is deprecated, use inet_ntop() instead

Change-Id: If6a96ede7d5e73884c32fbfdb03052e2bda50a77
---
M src/mncc.c
M src/sdp.c
M src/sip.c
3 files changed, 17 insertions(+), 6 deletions(-)

Approvals:
  pespin: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/mncc.c b/src/mncc.c
index 7bffbd1..8f512d9 100644
--- a/src/mncc.c
+++ b/src/mncc.c
@@ -174,6 +174,7 @@
 {
struct gsm_mncc_rtp mncc = { 0, };
int rc;
+   char ip_addr[INET_ADDRSTRLEN];

/*
 * Send RTP CONNECT and we handle the general failure of it by
@@ -189,7 +190,8 @@
 * payload_type should be different..
 */
struct in_addr net = { .s_addr = other->ip };
-   LOGP(DMNCC, LOGL_DEBUG, "SEND rtp_connect: IP=(%s) PORT=(%u)\n", 
inet_ntoa(net), mncc.port);
+   inet_ntop(AF_INET, , ip_addr, sizeof(ip_addr));
+   LOGP(DMNCC, LOGL_DEBUG, "SEND rtp_connect: IP=(%s) PORT=(%u)\n", 
ip_addr, mncc.port);
rc = write(leg->conn->fd.fd, , sizeof(mncc));
if (rc != sizeof(mncc)) {
LOGP(DMNCC, LOGL_ERROR, "Failed to send message leg(%u)\n",
@@ -395,6 +397,7 @@
 {
const struct gsm_mncc_rtp *rtp;
struct mncc_call_leg *leg;
+   char ip_addr[INET_ADDRSTRLEN];

if (rc < sizeof(*rtp)) {
LOGP(DMNCC, LOGL_ERROR, "gsm_mncc_rtp of wrong size %d < %zu\n",
@@ -417,9 +420,10 @@

/* TODO.. now we can continue with the call */
struct in_addr net = { .s_addr = leg->base.ip };
+   inet_ntop(AF_INET, , ip_addr, sizeof(ip_addr));
LOGP(DMNCC, LOGL_DEBUG,
"RTP cnt leg(%u) ip(%s), port(%u) pt(%u) ptm(%u)\n",
-   leg->callref, inet_ntoa(net), leg->base.port,
+   leg->callref, ip_addr, leg->base.port,
leg->base.payload_type, leg->base.payload_msg_type);
stop_cmd_timer(leg, MNCC_RTP_CREATE);
continue_call(leg);
diff --git a/src/sdp.c b/src/sdp.c
index e2ed25e..56a41f7 100644
--- a/src/sdp.c
+++ b/src/sdp.c
@@ -207,7 +207,9 @@
struct in_addr net = { .s_addr = other->ip };
char *fmtp_str = NULL, *sdp;
char *mode_attribute;
+   char ip_addr[INET_ADDRSTRLEN];

+   inet_ntop(AF_INET, , ip_addr, sizeof(ip_addr));
leg->wanted_codec = app_media_name(other->payload_msg_type);

if (strcmp(leg->wanted_codec, "AMR") == 0)
@@ -241,7 +243,7 @@
"%s"
"a=rtpmap:%d %s/8000\r\n"
"%s",
-   inet_ntoa(net), inet_ntoa(net), /* never use 
diff. addr! */
+   ip_addr, ip_addr, /* never use diff. addr! */
other->port, other->payload_type,
fmtp_str ? fmtp_str : "",
other->payload_type,
diff --git a/src/sip.c b/src/sip.c
index 0179226..b652b4b 100644
--- a/src/sip.c
+++ b/src/sip.c
@@ -110,6 +110,7 @@
struct call *call;
struct sip_call_leg *leg;
const char *from = NULL, *to = NULL;
+   char ip_addr[INET_ADDRSTRLEN];

LOGP(DSIP, LOGL_DEBUG, "Incoming call(%s) handle(%p)\n", 
sip->sip_call_id->i_id, nh);

@@ -159,8 +160,9 @@
return;
}
struct in_addr net = { .s_addr = leg->base.ip };
+   inet_ntop(AF_INET, , ip_addr, sizeof(ip_addr));
LOGP(DSIP, LOGL_DEBUG, "SDP Extracted: IP=(%s) PORT=(%u) 
PAYLOAD=(%u).\n",
-  inet_ntoa(net),
+  ip_addr,
   leg->base.port,
   leg->base.payload_type);

@@ -186,6 +188,7 @@
sdp_mode_t mode = sdp_sendrecv;
uint32_t ip = leg->base.ip;
uint16_t port = leg->base.port;
+   char ip_addr[INET_ADDRSTRLEN];

LOGP(DSIP, LOGL_NOTICE, "re-INVITE for call %s\n", 
sip->sip_call_id->i_id);

@@ -205,7 +208,8 @@
}

struct in_addr net = { .s_addr = leg->base.ip };
-   LOGP(DSIP, LOGL_NOTICE, "pre re-INVITE have IP:port (%s:%u)\n", 
inet_ntoa(net), leg->base.port);
+   inet_ntop(AF_INET, , ip_addr, sizeof(ip_addr));
+   LOGP(DSIP, LOGL_NOTICE, "pre re-INVITE have IP:port (%s:%u)\n", 
ip_addr, leg->base.port);

if (mode == sdp_sendonly) {
/* SIP side places call on HOLD */
@@ -221,7 +225,8 @@
return;
}
struct in_addr net = { .s_addr = leg->base.ip };
-   LOGP(DSIP, LOGL_NOTICE, "Media IP:port in re-INVITE: 
(%s:%u)\n", inet_ntoa(net), leg->base.port);
+   inet_ntop(AF_INET, , ip_addr, sizeof(ip_addr));
+   LOGP(DSIP, LOGL_NOTICE, 

Change in ...osmo-sip-connector[master]: inet_ntoa() is deprecated, use inet_ntop() instead

2019-08-06 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-sip-connector/+/15065 )

Change subject: inet_ntoa() is deprecated, use inet_ntop() instead
..


Patch Set 5: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-sip-connector/+/15065
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sip-connector
Gerrit-Branch: master
Gerrit-Change-Id: If6a96ede7d5e73884c32fbfdb03052e2bda50a77
Gerrit-Change-Number: 15065
Gerrit-PatchSet: 5
Gerrit-Owner: keith 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Tue, 06 Aug 2019 14:54:01 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in ...osmo-sip-connector[master]: inet_ntoa() is deprecated, use inet_ntop() instead

2019-08-06 Thread keith
Hello pespin, Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/osmo-sip-connector/+/15065

to look at the new patch set (#5).

Change subject: inet_ntoa() is deprecated, use inet_ntop() instead
..

inet_ntoa() is deprecated, use inet_ntop() instead

Change-Id: If6a96ede7d5e73884c32fbfdb03052e2bda50a77
---
M src/mncc.c
M src/sdp.c
M src/sip.c
3 files changed, 17 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-sip-connector 
refs/changes/65/15065/5
--
To view, visit https://gerrit.osmocom.org/c/osmo-sip-connector/+/15065
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sip-connector
Gerrit-Branch: master
Gerrit-Change-Id: If6a96ede7d5e73884c32fbfdb03052e2bda50a77
Gerrit-Change-Number: 15065
Gerrit-PatchSet: 5
Gerrit-Owner: keith 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-MessageType: newpatchset


Change in ...osmo-sip-connector[master]: inet_ntoa() is deprecated, use inet_ntop() instead

2019-08-06 Thread keith
Hello pespin, Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/osmo-sip-connector/+/15065

to look at the new patch set (#4).

Change subject: inet_ntoa() is deprecated, use inet_ntop() instead
..

inet_ntoa() is deprecated, use inet_ntop() instead

Change-Id: If6a96ede7d5e73884c32fbfdb03052e2bda50a77
---
M src/mncc.c
M src/sdp.c
M src/sip.c
3 files changed, 17 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-sip-connector 
refs/changes/65/15065/4
--
To view, visit https://gerrit.osmocom.org/c/osmo-sip-connector/+/15065
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sip-connector
Gerrit-Branch: master
Gerrit-Change-Id: If6a96ede7d5e73884c32fbfdb03052e2bda50a77
Gerrit-Change-Number: 15065
Gerrit-PatchSet: 4
Gerrit-Owner: keith 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-MessageType: newpatchset


Change in ...osmo-sip-connector[master]: inet_ntoa() is deprecated, use inet_ntop() instead

2019-08-06 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-sip-connector/+/15065 )

Change subject: inet_ntoa() is deprecated, use inet_ntop() instead
..


Patch Set 3: Code-Review+1

(5 comments)

https://gerrit.osmocom.org/#/c/15065/3/src/mncc.c
File src/mncc.c:

https://gerrit.osmocom.org/#/c/15065/3/src/mncc.c@192
PS3, Line 192:  char ip_addr[INET_ADDRSTRLEN];
Please move this line to start of the function together with other variables, 
there's no specific need/reason to have it placed here.


https://gerrit.osmocom.org/#/c/15065/3/src/mncc.c@193
PS3, Line 193:  inet_ntop(AF_INET, , ip_addr, INET_ADDRSTRLEN);
As a tip, usually you want to use sizeof(ip_addr) here instead of 
INET_ADDRSTRLEN (this way if size of ip_addr changes later this lines doesn't 
need to be changed).


https://gerrit.osmocom.org/#/c/15065/3/src/mncc.c@422
PS3, Line 422:  char ip_addr[INET_ADDRSTRLEN];
Same comment.


https://gerrit.osmocom.org/#/c/15065/3/src/sdp.c
File src/sdp.c:

https://gerrit.osmocom.org/#/c/15065/3/src/sdp.c@211
PS3, Line 211:  inet_ntop(AF_INET, , ip_addr, INET_ADDRSTRLEN);
cosmetic: Usually leave an empty line between variable definition block and 
logic block.


https://gerrit.osmocom.org/#/c/15065/3/src/sip.c
File src/sip.c:

https://gerrit.osmocom.org/#/c/15065/3/src/sip.c@162
PS3, Line 162:  char ip_addr[INET_ADDRSTRLEN];
Same comments.



--
To view, visit https://gerrit.osmocom.org/c/osmo-sip-connector/+/15065
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sip-connector
Gerrit-Branch: master
Gerrit-Change-Id: If6a96ede7d5e73884c32fbfdb03052e2bda50a77
Gerrit-Change-Number: 15065
Gerrit-PatchSet: 3
Gerrit-Owner: keith 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Tue, 06 Aug 2019 14:18:06 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in ...osmo-sip-connector[master]: inet_ntoa() is deprecated, use inet_ntop() instead

2019-08-06 Thread keith
Hello Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/osmo-sip-connector/+/15065

to look at the new patch set (#3).

Change subject: inet_ntoa() is deprecated, use inet_ntop() instead
..

inet_ntoa() is deprecated, use inet_ntop() instead

Change-Id: If6a96ede7d5e73884c32fbfdb03052e2bda50a77
---
M src/mncc.c
M src/sdp.c
M src/sip.c
3 files changed, 17 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-sip-connector 
refs/changes/65/15065/3
--
To view, visit https://gerrit.osmocom.org/c/osmo-sip-connector/+/15065
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sip-connector
Gerrit-Branch: master
Gerrit-Change-Id: If6a96ede7d5e73884c32fbfdb03052e2bda50a77
Gerrit-Change-Number: 15065
Gerrit-PatchSet: 3
Gerrit-Owner: keith 
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: newpatchset


Change in ...osmo-sip-connector[master]: inet_ntoa() is deprecated, use inet_ntop() instead

2019-08-06 Thread keith
Hello Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/osmo-sip-connector/+/15065

to look at the new patch set (#2).

Change subject: inet_ntoa() is deprecated, use inet_ntop() instead
..

inet_ntoa() is deprecated, use inet_ntop() instead

Change-Id: If6a96ede7d5e73884c32fbfdb03052e2bda50a77
---
M src/mncc.c
M src/sdp.c
M src/sip.c
3 files changed, 17 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-sip-connector 
refs/changes/65/15065/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-sip-connector/+/15065
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sip-connector
Gerrit-Branch: master
Gerrit-Change-Id: If6a96ede7d5e73884c32fbfdb03052e2bda50a77
Gerrit-Change-Number: 15065
Gerrit-PatchSet: 2
Gerrit-Owner: keith 
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: newpatchset


Change in ...osmo-sip-connector[master]: inet_ntoa() is deprecated, use inet_ntop() instead

2019-08-06 Thread keith
keith has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-sip-connector/+/15065


Change subject: inet_ntoa() is deprecated, use inet_ntop() instead
..

inet_ntoa() is deprecated, use inet_ntop() instead

Change-Id: If6a96ede7d5e73884c32fbfdb03052e2bda50a77
---
M src/mncc.c
M src/sdp.c
M src/sip.c
3 files changed, 17 insertions(+), 6 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-sip-connector 
refs/changes/65/15065/1

diff --git a/src/mncc.c b/src/mncc.c
index 7bffbd1..0d78d05 100644
--- a/src/mncc.c
+++ b/src/mncc.c
@@ -189,7 +189,9 @@
 * payload_type should be different..
 */
struct in_addr net = { .s_addr = other->ip };
-   LOGP(DMNCC, LOGL_DEBUG, "SEND rtp_connect: IP=(%s) PORT=(%u)\n", 
inet_ntoa(net), mncc.port);
+   char ip_addr[INET_ADDRSTRLEN];
+   inet_ntop(AF_INET, , ip_addr, INET_ADDRSTRLEN);
+   LOGP(DMNCC, LOGL_DEBUG, "SEND rtp_connect: IP=(%s) PORT=(%u)\n", 
ip_addr, mncc.port);
rc = write(leg->conn->fd.fd, , sizeof(mncc));
if (rc != sizeof(mncc)) {
LOGP(DMNCC, LOGL_ERROR, "Failed to send message leg(%u)\n",
@@ -417,9 +419,11 @@

/* TODO.. now we can continue with the call */
struct in_addr net = { .s_addr = leg->base.ip };
+   char ip_addr[INET_ADDRSTRLEN];
+   inet_ntop(AF_INET, , ip_addr, INET_ADDRSTRLEN);
LOGP(DMNCC, LOGL_DEBUG,
"RTP cnt leg(%u) ip(%s), port(%u) pt(%u) ptm(%u)\n",
-   leg->callref, inet_ntoa(net), leg->base.port,
+   leg->callref, ip_addr, leg->base.port,
leg->base.payload_type, leg->base.payload_msg_type);
stop_cmd_timer(leg, MNCC_RTP_CREATE);
continue_call(leg);
diff --git a/src/sdp.c b/src/sdp.c
index e2ed25e..fda6c27 100644
--- a/src/sdp.c
+++ b/src/sdp.c
@@ -207,6 +207,8 @@
struct in_addr net = { .s_addr = other->ip };
char *fmtp_str = NULL, *sdp;
char *mode_attribute;
+   char ip_addr[INET_ADDRSTRLEN];
+   inet_ntop(AF_INET, , ip_addr, INET_ADDRSTRLEN);

leg->wanted_codec = app_media_name(other->payload_msg_type);

@@ -241,7 +243,7 @@
"%s"
"a=rtpmap:%d %s/8000\r\n"
"%s",
-   inet_ntoa(net), inet_ntoa(net), /* never use 
diff. addr! */
+   ip_addr, ip_addr,
other->port, other->payload_type,
fmtp_str ? fmtp_str : "",
other->payload_type,
diff --git a/src/sip.c b/src/sip.c
index 0179226..9366f18 100644
--- a/src/sip.c
+++ b/src/sip.c
@@ -159,8 +159,10 @@
return;
}
struct in_addr net = { .s_addr = leg->base.ip };
+   char ip_addr[INET_ADDRSTRLEN];
+   inet_ntop(AF_INET, , ip_addr, INET_ADDRSTRLEN);
LOGP(DSIP, LOGL_DEBUG, "SDP Extracted: IP=(%s) PORT=(%u) 
PAYLOAD=(%u).\n",
-  inet_ntoa(net),
+  ip_addr,
   leg->base.port,
   leg->base.payload_type);

@@ -186,6 +188,7 @@
sdp_mode_t mode = sdp_sendrecv;
uint32_t ip = leg->base.ip;
uint16_t port = leg->base.port;
+   char ip_addr[INET_ADDRSTRLEN];

LOGP(DSIP, LOGL_NOTICE, "re-INVITE for call %s\n", 
sip->sip_call_id->i_id);

@@ -205,7 +208,8 @@
}

struct in_addr net = { .s_addr = leg->base.ip };
-   LOGP(DSIP, LOGL_NOTICE, "pre re-INVITE have IP:port (%s:%u)\n", 
inet_ntoa(net), leg->base.port);
+   inet_ntop(AF_INET, , ip_addr, INET_ADDRSTRLEN);
+   LOGP(DSIP, LOGL_NOTICE, "pre re-INVITE have IP:port (%s:%u)\n", 
ip_addr, leg->base.port);

if (mode == sdp_sendonly) {
/* SIP side places call on HOLD */
@@ -221,7 +225,8 @@
return;
}
struct in_addr net = { .s_addr = leg->base.ip };
-   LOGP(DSIP, LOGL_NOTICE, "Media IP:port in re-INVITE: 
(%s:%u)\n", inet_ntoa(net), leg->base.port);
+   inet_ntop(AF_INET, , ip_addr, INET_ADDRSTRLEN);
+   LOGP(DSIP, LOGL_NOTICE, "Media IP:port in re-INVITE: 
(%s:%u)\n", ip_addr, leg->base.port);
if (ip != leg->base.ip || port != leg->base.port) {
LOGP(DSIP, LOGL_NOTICE, "re-INVITE changes media 
connection.\n");
if (other->update_rtp)

--
To view, visit https://gerrit.osmocom.org/c/osmo-sip-connector/+/15065
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sip-connector
Gerrit-Branch: master
Gerrit-Change-Id: If6a96ede7d5e73884c32fbfdb03052e2bda50a77
Gerrit-Change-Number: 15065
Gerrit-PatchSet: 1
Gerrit-Owner: keith 
Gerrit-MessageType: newchange