Callers updated.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
struct sctp_transport *peer;
struct sctp_sock *sp;
unsigned short port;
+ union sctp_addr tmp;
+ flip_to_n(&tmp, addr);
sp = sctp_sk(asoc->base.sk);
asoc->peer.port = port;
/* Check to see if this is a duplicate. */
- peer = sctp_assoc_lookup_paddr(asoc, addr);
+ peer = sctp_assoc_lookup_paddr(asoc, &tmp);
if (peer) {
if (peer->state == SCTP_UNKNOWN) {
if (peer_state == SCTP_ACTIVE)
{
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(&tmp, &t->ipaddr))
+ if (sctp_cmp_addr_exact(address, &t->ipaddr))
return t;
}
const union sctp_addr *paddr)
{
struct sctp_transport *transport;
- union sctp_addr tmp;
+ union sctp_addr tmp, tmp2;
flip_to_n(&tmp, laddr);
+ flip_to_n(&tmp2, paddr);
sctp_read_lock(&asoc->base.addr_lock);
if ((asoc->base.bind_addr.port == laddr->v4.sin_port) &&
(asoc->peer.port == paddr->v4.sin_port)) {
- transport = sctp_assoc_lookup_paddr(asoc, paddr);
+ transport = sctp_assoc_lookup_paddr(asoc, &tmp2);
if (!transport)
goto out;
/* Remove any peer addresses not present in the new association. */
list_for_each_safe(pos, temp, &asoc->peer.transport_addr_list) {
trans = list_entry(pos, struct sctp_transport, transports);
- if (!sctp_assoc_lookup_paddr(new, &trans->ipaddr_h))
+ if (!sctp_assoc_lookup_paddr(new, &trans->ipaddr))
sctp_assoc_del_peer(asoc, &trans->ipaddr);
}
list_for_each(pos, &new->peer.transport_addr_list) {
trans = list_entry(pos, struct sctp_transport,
transports);
- if (!sctp_assoc_lookup_paddr(asoc, &trans->ipaddr_h))
+ if (!sctp_assoc_lookup_paddr(asoc, &trans->ipaddr))
sctp_assoc_add_peer(asoc, &trans->ipaddr_h,
GFP_ATOMIC, trans->state);
}
int rport;
struct sctp_association *asoc;
struct list_head *pos;
+ union sctp_addr tmp;
+ flip_to_n(&tmp, paddr);
rport = paddr->v4.sin_port;
asoc = list_entry(pos, struct sctp_association, asocs);
if (rport == asoc->peer.port) {
sctp_read_lock(&asoc->base.addr_lock);
- *transport = sctp_assoc_lookup_paddr(asoc, paddr);
+ *transport = sctp_assoc_lookup_paddr(asoc, &tmp);
sctp_read_unlock(&asoc->base.addr_lock);
if (*transport)
sctp_assoc_del_peer(asoc, &tmp_addr);
break;
case SCTP_PARAM_SET_PRIMARY:
- peer = sctp_assoc_lookup_paddr(asoc, &addr);
+ peer = sctp_assoc_lookup_paddr(asoc, &tmp_addr);
if (!peer)
return SCTP_ERROR_INV_PARAM;
struct sctp_transport *link;
sctp_sender_hb_info_t *hbinfo;
unsigned long max_interval;
+ union sctp_addr tmp;
if (!sctp_vtag_verify(chunk, asoc))
return sctp_sf_pdiscard(ep, asoc, type, arg, commands);
}
from_addr = hbinfo->daddr;
- link = sctp_assoc_lookup_paddr(asoc, &from_addr);
+ flip_to_n(&tmp, &from_addr);
+ link = sctp_assoc_lookup_paddr(asoc, &tmp);
/* This should never happen, but lets log it if so. */
if (unlikely(!link)) {
struct sctp_association *new_asoc=NULL, *asoc=NULL;
struct sctp_transport *transport, *chunk_tp;
struct sctp_chunk *chunk;
- union sctp_addr to;
+ union sctp_addr to, tmp;
struct sockaddr *msg_name = NULL;
struct sctp_sndrcvinfo default_sinfo = { 0 };
struct sctp_sndrcvinfo *sinfo;
if (msg_namelen > sizeof(to))
msg_namelen = sizeof(to);
memcpy(&to, msg->msg_name, msg_namelen);
+ memcpy(&tmp, msg->msg_name, msg_namelen);
SCTP_DEBUG_PRINTK("Just memcpy'd. msg_name is "
"0x%x:%u.\n",
to.v4.sin_addr.s_addr, to.v4.sin_port);
*/
if ((sctp_style(sk, TCP) && msg_name) ||
(sinfo_flags & SCTP_ADDR_OVER)) {
- chunk_tp = sctp_assoc_lookup_paddr(asoc, &to);
+ chunk_tp = sctp_assoc_lookup_paddr(asoc, &tmp);
if (!chunk_tp) {
err = -EINVAL;
goto out_free;