aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/associola.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2006-12-05 09:37:56 -0500
committerDavid Howells <dhowells@warthog.cambridge.redhat.com>2006-12-05 09:37:56 -0500
commit4c1ac1b49122b805adfa4efc620592f68dccf5db (patch)
tree87557f4bc2fd4fe65b7570489c2f610c45c0adcd /net/sctp/associola.c
parentc4028958b6ecad064b1a6303a6a5906d4fe48d73 (diff)
parentd916faace3efc0bf19fe9a615a1ab8fa1a24cd93 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts: drivers/infiniband/core/iwcm.c drivers/net/chelsio/cxgb2.c drivers/net/wireless/bcm43xx/bcm43xx_main.c drivers/net/wireless/prism54/islpci_eth.c drivers/usb/core/hub.h drivers/usb/input/hid-core.c net/core/netpoll.c Fix up merge failures with Linus's head and fix new compilation failures. Signed-Off-By: David Howells <dhowells@redhat.com>
Diffstat (limited to 'net/sctp/associola.c')
-rw-r--r--net/sctp/associola.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/net/sctp/associola.c b/net/sctp/associola.c
index 88124696ba60..ad0057db0f91 100644
--- a/net/sctp/associola.c
+++ b/net/sctp/associola.c
@@ -486,7 +486,7 @@ void sctp_assoc_rm_peer(struct sctp_association *asoc,
486 " port: %d\n", 486 " port: %d\n",
487 asoc, 487 asoc,
488 (&peer->ipaddr), 488 (&peer->ipaddr),
489 peer->ipaddr.v4.sin_port); 489 ntohs(peer->ipaddr.v4.sin_port));
490 490
491 /* If we are to remove the current retran_path, update it 491 /* If we are to remove the current retran_path, update it
492 * to the next peer before removing this peer from the list. 492 * to the next peer before removing this peer from the list.
@@ -535,13 +535,13 @@ struct sctp_transport *sctp_assoc_add_peer(struct sctp_association *asoc,
535 sp = sctp_sk(asoc->base.sk); 535 sp = sctp_sk(asoc->base.sk);
536 536
537 /* AF_INET and AF_INET6 share common port field. */ 537 /* AF_INET and AF_INET6 share common port field. */
538 port = addr->v4.sin_port; 538 port = ntohs(addr->v4.sin_port);
539 539
540 SCTP_DEBUG_PRINTK_IPADDR("sctp_assoc_add_peer:association %p addr: ", 540 SCTP_DEBUG_PRINTK_IPADDR("sctp_assoc_add_peer:association %p addr: ",
541 " port: %d state:%d\n", 541 " port: %d state:%d\n",
542 asoc, 542 asoc,
543 addr, 543 addr,
544 addr->v4.sin_port, 544 port,
545 peer_state); 545 peer_state);
546 546
547 /* Set the port if it has not been set yet. */ 547 /* Set the port if it has not been set yet. */
@@ -707,6 +707,7 @@ void sctp_assoc_control_transport(struct sctp_association *asoc,
707 struct sctp_transport *first; 707 struct sctp_transport *first;
708 struct sctp_transport *second; 708 struct sctp_transport *second;
709 struct sctp_ulpevent *event; 709 struct sctp_ulpevent *event;
710 struct sockaddr_storage addr;
710 struct list_head *pos; 711 struct list_head *pos;
711 int spc_state = 0; 712 int spc_state = 0;
712 713
@@ -729,8 +730,9 @@ void sctp_assoc_control_transport(struct sctp_association *asoc,
729 /* Generate and send a SCTP_PEER_ADDR_CHANGE notification to the 730 /* Generate and send a SCTP_PEER_ADDR_CHANGE notification to the
730 * user. 731 * user.
731 */ 732 */
732 event = sctp_ulpevent_make_peer_addr_change(asoc, 733 memset(&addr, 0, sizeof(struct sockaddr_storage));
733 (struct sockaddr_storage *) &transport->ipaddr, 734 memcpy(&addr, &transport->ipaddr, transport->af_specific->sockaddr_len);
735 event = sctp_ulpevent_make_peer_addr_change(asoc, &addr,
734 0, spc_state, error, GFP_ATOMIC); 736 0, spc_state, error, GFP_ATOMIC);
735 if (event) 737 if (event)
736 sctp_ulpq_tail_event(&asoc->ulpq, event); 738 sctp_ulpq_tail_event(&asoc->ulpq, event);
@@ -866,7 +868,7 @@ struct sctp_transport *sctp_assoc_lookup_tsn(struct sctp_association *asoc,
866 struct list_head *entry, *pos; 868 struct list_head *entry, *pos;
867 struct sctp_transport *transport; 869 struct sctp_transport *transport;
868 struct sctp_chunk *chunk; 870 struct sctp_chunk *chunk;
869 __u32 key = htonl(tsn); 871 __be32 key = htonl(tsn);
870 872
871 match = NULL; 873 match = NULL;
872 874
@@ -924,8 +926,8 @@ struct sctp_transport *sctp_assoc_is_match(struct sctp_association *asoc,
924 926
925 sctp_read_lock(&asoc->base.addr_lock); 927 sctp_read_lock(&asoc->base.addr_lock);
926 928
927 if ((asoc->base.bind_addr.port == laddr->v4.sin_port) && 929 if ((htons(asoc->base.bind_addr.port) == laddr->v4.sin_port) &&
928 (asoc->peer.port == paddr->v4.sin_port)) { 930 (htons(asoc->peer.port) == paddr->v4.sin_port)) {
929 transport = sctp_assoc_lookup_paddr(asoc, paddr); 931 transport = sctp_assoc_lookup_paddr(asoc, paddr);
930 if (!transport) 932 if (!transport)
931 goto out; 933 goto out;
@@ -1136,7 +1138,7 @@ void sctp_assoc_update_retran_path(struct sctp_association *asoc)
1136 " port: %d\n", 1138 " port: %d\n",
1137 asoc, 1139 asoc,
1138 (&t->ipaddr), 1140 (&t->ipaddr),
1139 t->ipaddr.v4.sin_port); 1141 ntohs(t->ipaddr.v4.sin_port));
1140} 1142}
1141 1143
1142/* Choose the transport for sending a INIT packet. */ 1144/* Choose the transport for sending a INIT packet. */
@@ -1161,7 +1163,7 @@ struct sctp_transport *sctp_assoc_choose_init_transport(
1161 " port: %d\n", 1163 " port: %d\n",
1162 asoc, 1164 asoc,
1163 (&t->ipaddr), 1165 (&t->ipaddr),
1164 t->ipaddr.v4.sin_port); 1166 ntohs(t->ipaddr.v4.sin_port));
1165 1167
1166 return t; 1168 return t;
1167} 1169}