Date: Thu, 31 Oct 2024 14:05:28 GMT From: Michael Tuexen <tuexen@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: d27f63fa8cbf - stable/14 - sctp: another cleanup Message-ID: <202410311405.49VE5SYV050389@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=d27f63fa8cbfe4ea576c39233a602d96953dc444 commit d27f63fa8cbfe4ea576c39233a602d96953dc444 Author: Michael Tuexen <tuexen@FreeBSD.org> AuthorDate: 2024-10-27 14:01:45 +0000 Commit: Michael Tuexen <tuexen@FreeBSD.org> CommitDate: 2024-10-31 11:44:02 +0000 sctp: another cleanup No functional change intended. (cherry picked from commit d08713dcdb158b2f55a885e7cfbbe410272c55a2) --- sys/netinet/sctp_pcb.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index 90eb5822cbb7..0030c5385390 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -543,7 +543,7 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, void *ifn, uint32_t ifn_index, } else { /* * The last IFN gets the address, remove the - * old one + * old one. */ SCTPDBG(SCTP_DEBUG_PCB4, "Moving ifa %p from %s (0x%x) to %s (0x%x)\n", @@ -691,13 +691,14 @@ sctp_del_addr_from_vrf(uint32_t vrf_id, struct sockaddr *addr, uint32_t ifn_index, const char *if_name) { struct sctp_vrf *vrf; - struct sctp_ifa *sctp_ifap = NULL; + struct sctp_ifa *sctp_ifap; SCTP_IPI_ADDR_WLOCK(); vrf = sctp_find_vrf(vrf_id); if (vrf == NULL) { SCTPDBG(SCTP_DEBUG_PCB4, "Can't find vrf_id 0x%x\n", vrf_id); - goto out_now; + SCTP_IPI_ADDR_WUNLOCK(); + return; } #ifdef SCTP_DEBUG @@ -705,10 +706,10 @@ sctp_del_addr_from_vrf(uint32_t vrf_id, struct sockaddr *addr, SCTPDBG_ADDR(SCTP_DEBUG_PCB4, addr); #endif sctp_ifap = sctp_find_ifa_by_addr(addr, vrf->vrf_id, SCTP_ADDR_LOCKED); - if (sctp_ifap) { + if (sctp_ifap != NULL) { /* Validate the delete */ if (sctp_ifap->ifn_p) { - int valid = 0; + bool valid = false; /*- * The name has priority over the ifn_index @@ -717,13 +718,13 @@ sctp_del_addr_from_vrf(uint32_t vrf_id, struct sockaddr *addr, if (if_name) { if (strncmp(if_name, sctp_ifap->ifn_p->ifn_name, SCTP_IFNAMSIZ) == 0) { /* They match its a correct delete */ - valid = 1; + valid = true; } } if (!valid) { /* last ditch check ifn_index */ if (ifn_index == sctp_ifap->ifn_p->ifn_index) { - valid = 1; + valid = true; } } if (!valid) { @@ -757,9 +758,8 @@ sctp_del_addr_from_vrf(uint32_t vrf_id, struct sockaddr *addr, } #endif -out_now: SCTP_IPI_ADDR_WUNLOCK(); - if (sctp_ifap) { + if (sctp_ifap != NULL) { struct sctp_laddr *wi; wi = SCTP_ZONE_GET(SCTP_BASE_INFO(ipi_zone_laddr), struct sctp_laddr);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202410311405.49VE5SYV050389>