diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2006-11-20 20:07:06 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-12-03 00:26:37 -0500 |
commit | be29681edfbad72167df735e243e8621840dca4f (patch) | |
tree | efc92cc3520bfc222200d82f561ccb84c9f7c5d0 /net/sctp/associola.c | |
parent | 38a03145efcdbbcc60465fdffc0546208a52daf8 (diff) |
[SCTP]: Switch sctp_assoc_lookup_paddr() to net-endian.
Callers updated.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/associola.c')
-rw-r--r-- | net/sctp/associola.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/net/sctp/associola.c b/net/sctp/associola.c index ab3141f05921..3be8b6081a15 100644 --- a/net/sctp/associola.c +++ b/net/sctp/associola.c | |||
@@ -533,6 +533,8 @@ struct sctp_transport *sctp_assoc_add_peer(struct sctp_association *asoc, | |||
533 | struct sctp_transport *peer; | 533 | struct sctp_transport *peer; |
534 | struct sctp_sock *sp; | 534 | struct sctp_sock *sp; |
535 | unsigned short port; | 535 | unsigned short port; |
536 | union sctp_addr tmp; | ||
537 | flip_to_n(&tmp, addr); | ||
536 | 538 | ||
537 | sp = sctp_sk(asoc->base.sk); | 539 | sp = sctp_sk(asoc->base.sk); |
538 | 540 | ||
@@ -551,7 +553,7 @@ struct sctp_transport *sctp_assoc_add_peer(struct sctp_association *asoc, | |||
551 | asoc->peer.port = port; | 553 | asoc->peer.port = port; |
552 | 554 | ||
553 | /* Check to see if this is a duplicate. */ | 555 | /* Check to see if this is a duplicate. */ |
554 | peer = sctp_assoc_lookup_paddr(asoc, addr); | 556 | peer = sctp_assoc_lookup_paddr(asoc, &tmp); |
555 | if (peer) { | 557 | if (peer) { |
556 | if (peer->state == SCTP_UNKNOWN) { | 558 | if (peer->state == SCTP_UNKNOWN) { |
557 | if (peer_state == SCTP_ACTIVE) | 559 | if (peer_state == SCTP_ACTIVE) |
@@ -684,14 +686,12 @@ struct sctp_transport *sctp_assoc_lookup_paddr( | |||
684 | { | 686 | { |
685 | struct sctp_transport *t; | 687 | struct sctp_transport *t; |
686 | struct list_head *pos; | 688 | struct list_head *pos; |
687 | union sctp_addr tmp; | ||
688 | 689 | ||
689 | flip_to_n(&tmp, address); | ||
690 | /* Cycle through all transports searching for a peer address. */ | 690 | /* Cycle through all transports searching for a peer address. */ |
691 | 691 | ||
692 | list_for_each(pos, &asoc->peer.transport_addr_list) { | 692 | list_for_each(pos, &asoc->peer.transport_addr_list) { |
693 | t = list_entry(pos, struct sctp_transport, transports); | 693 | t = list_entry(pos, struct sctp_transport, transports); |
694 | if (sctp_cmp_addr_exact(&tmp, &t->ipaddr)) | 694 | if (sctp_cmp_addr_exact(address, &t->ipaddr)) |
695 | return t; | 695 | return t; |
696 | } | 696 | } |
697 | 697 | ||
@@ -927,14 +927,15 @@ struct sctp_transport *sctp_assoc_is_match(struct sctp_association *asoc, | |||
927 | const union sctp_addr *paddr) | 927 | const union sctp_addr *paddr) |
928 | { | 928 | { |
929 | struct sctp_transport *transport; | 929 | struct sctp_transport *transport; |
930 | union sctp_addr tmp; | 930 | union sctp_addr tmp, tmp2; |
931 | flip_to_n(&tmp, laddr); | 931 | flip_to_n(&tmp, laddr); |
932 | flip_to_n(&tmp2, paddr); | ||
932 | 933 | ||
933 | sctp_read_lock(&asoc->base.addr_lock); | 934 | sctp_read_lock(&asoc->base.addr_lock); |
934 | 935 | ||
935 | if ((asoc->base.bind_addr.port == laddr->v4.sin_port) && | 936 | if ((asoc->base.bind_addr.port == laddr->v4.sin_port) && |
936 | (asoc->peer.port == paddr->v4.sin_port)) { | 937 | (asoc->peer.port == paddr->v4.sin_port)) { |
937 | transport = sctp_assoc_lookup_paddr(asoc, paddr); | 938 | transport = sctp_assoc_lookup_paddr(asoc, &tmp2); |
938 | if (!transport) | 939 | if (!transport) |
939 | goto out; | 940 | goto out; |
940 | 941 | ||
@@ -1047,7 +1048,7 @@ void sctp_assoc_update(struct sctp_association *asoc, | |||
1047 | /* Remove any peer addresses not present in the new association. */ | 1048 | /* Remove any peer addresses not present in the new association. */ |
1048 | list_for_each_safe(pos, temp, &asoc->peer.transport_addr_list) { | 1049 | list_for_each_safe(pos, temp, &asoc->peer.transport_addr_list) { |
1049 | trans = list_entry(pos, struct sctp_transport, transports); | 1050 | trans = list_entry(pos, struct sctp_transport, transports); |
1050 | if (!sctp_assoc_lookup_paddr(new, &trans->ipaddr_h)) | 1051 | if (!sctp_assoc_lookup_paddr(new, &trans->ipaddr)) |
1051 | sctp_assoc_del_peer(asoc, &trans->ipaddr); | 1052 | sctp_assoc_del_peer(asoc, &trans->ipaddr); |
1052 | } | 1053 | } |
1053 | 1054 | ||
@@ -1071,7 +1072,7 @@ void sctp_assoc_update(struct sctp_association *asoc, | |||
1071 | list_for_each(pos, &new->peer.transport_addr_list) { | 1072 | list_for_each(pos, &new->peer.transport_addr_list) { |
1072 | trans = list_entry(pos, struct sctp_transport, | 1073 | trans = list_entry(pos, struct sctp_transport, |
1073 | transports); | 1074 | transports); |
1074 | if (!sctp_assoc_lookup_paddr(asoc, &trans->ipaddr_h)) | 1075 | if (!sctp_assoc_lookup_paddr(asoc, &trans->ipaddr)) |
1075 | sctp_assoc_add_peer(asoc, &trans->ipaddr_h, | 1076 | sctp_assoc_add_peer(asoc, &trans->ipaddr_h, |
1076 | GFP_ATOMIC, trans->state); | 1077 | GFP_ATOMIC, trans->state); |
1077 | } | 1078 | } |