aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Tuexen <tuexen@FreeBSD.org>2024-10-25 11:47:43 +0000
committerMichael Tuexen <tuexen@FreeBSD.org>2024-10-25 11:47:43 +0000
commit02478e65910ab1ef53511ebb2271cdcf0e9a14cf (patch)
treea6e6c2f8f5213892bca060e679550952618c0f52
parentcb5e41b160838880de7d03100afa02e4edee5a9e (diff)
downloadsrc-02478e65910a.tar.gz
src-02478e65910a.zip
sctp: further cleanup
MFC after: 3 days
-rw-r--r--sys/netinet/sctp_pcb.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c
index 3b59a72e1f1a..112242a0e7e3 100644
--- a/sys/netinet/sctp_pcb.c
+++ b/sys/netinet/sctp_pcb.c
@@ -455,7 +455,6 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, void *ifn, uint32_t ifn_index,
struct sctp_ifalist *hash_addr_head;
struct sctp_ifnlist *hash_ifn_head;
uint32_t hash_of_addr;
- int new_ifn_af = 0;
#ifdef SCTP_DEBUG
SCTPDBG(SCTP_DEBUG_PCB4, "vrf_id 0x%x: adding address: ", vrf_id);
@@ -519,7 +518,6 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, void *ifn, uint32_t ifn_index,
LIST_INSERT_HEAD(hash_ifn_head, sctp_ifnp, next_bucket);
LIST_INSERT_HEAD(&vrf->ifnlist, sctp_ifnp, next_ifn);
atomic_add_int(&SCTP_BASE_INFO(ipi_count_ifns), 1);
- new_ifn_af = 1;
}
sctp_ifap = sctp_find_ifa_by_addr(addr, vrf->vrf_id, SCTP_ADDR_LOCKED);
if (sctp_ifap) {
@@ -529,7 +527,7 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, void *ifn, uint32_t ifn_index,
SCTPDBG(SCTP_DEBUG_PCB4, "Using existing ifn %s (0x%x) for ifa %p\n",
sctp_ifap->ifn_p->ifn_name, ifn_index,
(void *)sctp_ifap);
- if (new_ifn_af) {
+ if (new_sctp_ifnp == NULL) {
/* Remove the created one that we don't want */
sctp_delete_ifn(sctp_ifnp);
}
@@ -597,8 +595,8 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, void *ifn, uint32_t ifn_index,
sctp_ifap->src_is_priv = 1;
}
sctp_ifnp->num_v4++;
- if (new_ifn_af)
- new_ifn_af = AF_INET;
+ if (new_sctp_ifnp == NULL)
+ sctp_ifnp->registered_af = AF_INET;
break;
}
#endif
@@ -617,13 +615,12 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, void *ifn, uint32_t ifn_index,
sctp_ifap->src_is_priv = 1;
}
sctp_ifnp->num_v6++;
- if (new_ifn_af)
- new_ifn_af = AF_INET6;
+ if (new_sctp_ifnp == NULL)
+ sctp_ifnp->registered_af = AF_INET6;
break;
}
#endif
default:
- new_ifn_af = 0;
break;
}
hash_of_addr = sctp_get_ifa_hash_val(&sctp_ifap->address.sa);
@@ -639,9 +636,6 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, void *ifn, uint32_t ifn_index,
sctp_ifnp->ifa_count++;
vrf->total_ifa_count++;
atomic_add_int(&SCTP_BASE_INFO(ipi_count_ifas), 1);
- if (new_ifn_af) {
- sctp_ifnp->registered_af = new_ifn_af;
- }
SCTP_IPI_ADDR_WUNLOCK();
if (new_sctp_ifnp != NULL) {
SCTP_FREE(new_sctp_ifnp, SCTP_M_IFN);