diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2022-08-11 18:39:07 +0200 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2022-08-11 23:04:46 +0200 |
commit | fff806bc923093c471a305002a47d2aa9efaca96 (patch) | |
tree | 481e9ef5aec54e7991eb8207c4ced80089d561c6 | |
parent | 7593cc743de4bdb98adc39ed90da3abdce1bb772 (diff) |
rsl: Reduce scope of variable
The function is long/complex enough, so having one extra struct 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
-rw-r--r-- | src/common/rsl.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common/rsl.c b/src/common/rsl.c index 8cdb6625..413c28d5 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -2702,7 +2702,6 @@ static int rsl_rx_ipac_XXcx(struct msgb *msg) 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 @@ static int rsl_rx_ipac_XXcx(struct msgb *msg) 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)); |