struct list_head *pos;
struct list_head *temp;
struct sctp_transport *transport;
+ union sctp_addr tmp;
+
+ flip_to_n(&tmp, addr);
list_for_each_safe(pos, temp, &asoc->peer.transport_addr_list) {
transport = list_entry(pos, struct sctp_transport, transports);
- if (sctp_cmp_addr_exact(addr, &transport->ipaddr_h)) {
+ if (sctp_cmp_addr_exact(&tmp, &transport->ipaddr)) {
/* Do book keeping for removing the peer and free it. */
sctp_assoc_rm_peer(asoc, transport);
break;
{
struct sctp_transport *t;
struct list_head *pos;
+ union sctp_addr tmp;
+ flip_to_n(&tmp, address);
/* Cycle through all transports searching for a peer address. */
list_for_each(pos, &asoc->peer.transport_addr_list) {
t = list_entry(pos, struct sctp_transport, transports);
- if (sctp_cmp_addr_exact(address, &t->ipaddr_h))
+ if (sctp_cmp_addr_exact(&tmp, &t->ipaddr))
return t;
}
{
struct list_head *pos, *temp;
struct sctp_sockaddr_entry *addr;
+ union sctp_addr tmp;
+
+ flip_to_n(&tmp, del_addr);
list_for_each_safe(pos, temp, &bp->address_list) {
addr = list_entry(pos, struct sctp_sockaddr_entry, list);
- if (sctp_cmp_addr_exact(&addr->a_h, del_addr)) {
+ if (sctp_cmp_addr_exact(&addr->a, &tmp)) {
/* Found the exact match. */
list_del(pos);
kfree(addr);
{
struct sctp_sockaddr_entry *laddr;
struct list_head *pos;
+ union sctp_addr tmp;
+ flip_to_n(&tmp, addr);
list_for_each(pos, &bp->address_list) {
laddr = list_entry(pos, struct sctp_sockaddr_entry, list);
- if (opt->pf->cmp_addr(&laddr->a_h, addr, opt))
+ if (opt->pf->cmp_addr(&laddr->a, &tmp, opt))
return 1;
}
addr_buf = (union sctp_addr *)addrs;
for (i = 0; i < addrcnt; i++) {
- union sctp_addr tmp;
addr = (union sctp_addr *)addr_buf;
af = sctp_get_af_specific(addr->v4.sin_family);
if (!af)
return NULL;
- flip_to_h(&tmp, addr);
- if (opt->pf->cmp_addr(&laddr->a_h, &tmp, opt))
+ if (opt->pf->cmp_addr(&laddr->a, addr, opt))
break;
addr_buf += af->sockaddr_len;
if (epb->type == SCTP_EP_TYPE_ASSOCIATION) {
asoc = sctp_assoc(epb);
peer = asoc->peer.primary_path;
- primary = &peer->saddr_h;
+ primary = &peer->saddr;
}
list_for_each(pos, &epb->bind_addr.address_list) {
laddr = list_entry(pos, struct sctp_sockaddr_entry, list);
- addr = (union sctp_addr *)&laddr->a_h;
+ addr = &laddr->a;
af = sctp_get_af_specific(addr->sa.sa_family);
if (primary && af->cmp_addr(addr, primary)) {
seq_printf(seq, "*");
}
- af->seq_dump_addr(seq, &laddr->a);
+ af->seq_dump_addr(seq, addr);
}
}
struct list_head *pos;
struct sctp_transport *transport;
union sctp_addr *addr, *primary;
+ union sctp_addr tmp;
struct sctp_af *af;
primary = &(assoc->peer.primary_addr);
+ flip_to_n(&tmp, primary);
list_for_each(pos, &assoc->peer.transport_addr_list) {
transport = list_entry(pos, struct sctp_transport, transports);
- addr = (union sctp_addr *)&transport->ipaddr_h;
+ addr = &transport->ipaddr;
af = sctp_get_af_specific(addr->sa.sa_family);
- if (af->cmp_addr(addr, primary)) {
+ if (af->cmp_addr(addr, &tmp)) {
seq_printf(seq, "*");
}
- af->seq_dump_addr(seq, &transport->ipaddr);
+ af->seq_dump_addr(seq, addr);
}
}
*/
sctp_read_lock(addr_lock);
list_for_each(pos, &bp->address_list) {
+ union sctp_addr tmp;
laddr = list_entry(pos, struct sctp_sockaddr_entry,
list);
if (!laddr->use_as_src)
continue;
sctp_v4_dst_saddr(&dst_saddr, dst, bp->port);
- if (sctp_v4_cmp_addr(&dst_saddr, &laddr->a_h))
+ flip_to_n(&tmp, &dst_saddr);
+ if (sctp_v4_cmp_addr(&tmp, &laddr->a))
goto out_unlock;
}
sctp_read_unlock(addr_lock);
union sctp_addr addr;
struct list_head *pos;
union sctp_addr_param *addr_param;
-
+ union sctp_addr tmp, tmp_addr;
+
addr_param = (union sctp_addr_param *)
((void *)asconf_param + sizeof(sctp_addip_param_t));
return SCTP_ERROR_INV_PARAM;
af->from_addr_param(&addr, addr_param, asoc->peer.port, 0);
+ flip_to_n(&tmp_addr, &addr);
switch (asconf_param->param_hdr.type) {
case SCTP_PARAM_ADD_IP:
/* ADDIP 4.3 D9) If an endpoint receives an ADD IP address
* an Error Cause TLV set to the new error code 'Request to
* Delete Source IP Address'
*/
- if (sctp_cmp_addr_exact(sctp_source(asconf), &addr))
+ flip_to_n(&tmp, sctp_source(asconf));
+ if (sctp_cmp_addr_exact(&tmp, &tmp_addr))
return SCTP_ERROR_DEL_SRC_IP;
sctp_assoc_del_peer(asoc, &addr);
struct sctp_transport *transport;
struct sctp_sockaddr_entry *saddr;
int retval = 0;
+ union sctp_addr tmp;
addr_param = (union sctp_addr_param *)
((void *)asconf_param + sizeof(sctp_addip_param_t));
/* We have checked the packet before, so we do not check again. */
af = sctp_get_af_specific(param_type2af(addr_param->v4.param_hdr.type));
af->from_addr_param(&addr, addr_param, bp->port, 0);
+ flip_to_n(&tmp, &addr);
switch (asconf_param->param_hdr.type) {
case SCTP_PARAM_ADD_IP:
sctp_write_lock(&asoc->base.addr_lock);
list_for_each(pos, &bp->address_list) {
saddr = list_entry(pos, struct sctp_sockaddr_entry, list);
- if (sctp_cmp_addr_exact(&saddr->a_h, &addr))
+ if (sctp_cmp_addr_exact(&saddr->a, &tmp))
saddr->use_as_src = 1;
}
sctp_write_unlock(&asoc->base.addr_lock);
struct sctp_transport *t;
struct list_head *pos;
struct list_head *temp;
+ union sctp_addr tmp;
+ flip_to_n(&tmp, &asoc->peer.primary_addr);
list_for_each_safe(pos, temp, &asoc->peer.transport_addr_list) {
t = list_entry(pos, struct sctp_transport, transports);
- if (!sctp_cmp_addr_exact(&t->ipaddr_h,
- &asoc->peer.primary_addr)) {
+ if (!sctp_cmp_addr_exact(&t->ipaddr,
+ &tmp)) {
sctp_assoc_del_peer(asoc, &t->ipaddr_h);
}
}
list_for_each(pos2, &asoc->peer.transport_addr_list) {
addr = list_entry(pos2, struct sctp_transport,
transports);
- if (sctp_cmp_addr_exact(&new_addr->ipaddr_h,
- &addr->ipaddr_h)) {
+ if (sctp_cmp_addr_exact(&new_addr->ipaddr,
+ &addr->ipaddr)) {
found = 1;
break;
}
struct sctp_bind_addr *bp;
struct sctp_chunk *chunk;
union sctp_addr *laddr;
- union sctp_addr saveaddr;
void *addr_buf;
struct sctp_af *af;
struct list_head *pos, *pos1;
for (i = 0; i < addrcnt; i++) {
laddr = (union sctp_addr *)addr_buf;
af = sctp_get_af_specific(laddr->v4.sin_family);
- memcpy(&saveaddr, laddr, af->sockaddr_len);
- saveaddr.v4.sin_port = ntohs(saveaddr.v4.sin_port);
list_for_each(pos1, &bp->address_list) {
saddr = list_entry(pos1,
struct sctp_sockaddr_entry,
list);
- if (sctp_cmp_addr_exact(&saddr->a_h, &saveaddr))
+ if (sctp_cmp_addr_exact(&saddr->a, laddr))
saddr->use_as_src = 0;
}
addr_buf += af->sockaddr_len;