pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/29036 )
Change subject: rsl: Reduce scope of variable ......................................................................
rsl: Reduce scope of variable
The function is length/complex enough, so having one extra strct in_addr declared the function top only used in one specific small path to print the variable is unnecesary. Let's move it to the conditional path where it is used to print the ip address.
Change-Id: I4c16bbca6a6779537517b6b196828b47eddaa516 --- M src/common/rsl.c 1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/36/29036/1
diff --git a/src/common/rsl.c b/src/common/rsl.c index 8cdb662..413c28d 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -2702,7 +2702,6 @@ int rc, inc_ip_port = 0; char *name; struct in_addr ia; - struct in_addr addr;
if (dch->c.msg_type == RSL_MT_IPAC_CRCX) name = "CRCX"; @@ -2721,6 +2720,7 @@
LOGPLCHAN(lchan, DRSL, LOGL_DEBUG, "IPAC_%s: ", name); if (TLVP_PRES_LEN(&tp, RSL_IE_IPAC_REMOTE_IP, 4)) { + struct in_addr addr; connect_ip = tlvp_val32_unal(&tp, RSL_IE_IPAC_REMOTE_IP); addr.s_addr = connect_ip; LOGPC(DRSL, LOGL_DEBUG, "connect_ip=%s ", inet_ntoa(addr));