mirror of
https://git.FreeBSD.org/src.git
synced 2024-11-23 07:31:31 +00:00
sctp: further cleanup
MFC after: 3 days
This commit is contained in:
parent
cb5e41b160
commit
02478e6591
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user