diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2006-11-20 20:08:09 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-12-03 00:26:40 -0500 |
commit | 1c7d1fc14974f44809b22521bd9796411d8ba440 (patch) | |
tree | 11e7c6f95ca995ccb7941adc5912ee82eb52b130 | |
parent | c9a08505ec0a0260fc94a823c014cc3970f72d25 (diff) |
[SCTP]: Switch sctp_endpoint_is_match() to net-endian.
The only caller (__sctp_rcv_lookup_endpoint()) also switched,
its caller adjusted
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/sctp/endpointola.c | 6 | ||||
-rw-r--r-- | net/sctp/input.c | 7 |
2 files changed, 7 insertions, 6 deletions
diff --git a/net/sctp/endpointola.c b/net/sctp/endpointola.c index 7c781d663603..c543f3250645 100644 --- a/net/sctp/endpointola.c +++ b/net/sctp/endpointola.c | |||
@@ -228,12 +228,10 @@ struct sctp_endpoint *sctp_endpoint_is_match(struct sctp_endpoint *ep, | |||
228 | const union sctp_addr *laddr) | 228 | const union sctp_addr *laddr) |
229 | { | 229 | { |
230 | struct sctp_endpoint *retval; | 230 | struct sctp_endpoint *retval; |
231 | union sctp_addr tmp; | ||
232 | flip_to_n(&tmp, laddr); | ||
233 | 231 | ||
234 | sctp_read_lock(&ep->base.addr_lock); | 232 | sctp_read_lock(&ep->base.addr_lock); |
235 | if (ep->base.bind_addr.port == laddr->v4.sin_port) { | 233 | if (htons(ep->base.bind_addr.port) == laddr->v4.sin_port) { |
236 | if (sctp_bind_addr_match(&ep->base.bind_addr, &tmp, | 234 | if (sctp_bind_addr_match(&ep->base.bind_addr, laddr, |
237 | sctp_sk(ep->base.sk))) { | 235 | sctp_sk(ep->base.sk))) { |
238 | retval = ep; | 236 | retval = ep; |
239 | goto out; | 237 | goto out; |
diff --git a/net/sctp/input.c b/net/sctp/input.c index 6d82f400d13c..1bb3f264da1f 100644 --- a/net/sctp/input.c +++ b/net/sctp/input.c | |||
@@ -127,6 +127,7 @@ int sctp_rcv(struct sk_buff *skb) | |||
127 | struct sctphdr *sh; | 127 | struct sctphdr *sh; |
128 | union sctp_addr src; | 128 | union sctp_addr src; |
129 | union sctp_addr dest; | 129 | union sctp_addr dest; |
130 | union sctp_addr tmp; | ||
130 | int family; | 131 | int family; |
131 | struct sctp_af *af; | 132 | struct sctp_af *af; |
132 | 133 | ||
@@ -180,8 +181,10 @@ int sctp_rcv(struct sk_buff *skb) | |||
180 | 181 | ||
181 | asoc = __sctp_rcv_lookup(skb, &src, &dest, &transport); | 182 | asoc = __sctp_rcv_lookup(skb, &src, &dest, &transport); |
182 | 183 | ||
184 | flip_to_n(&tmp, &dest); | ||
185 | |||
183 | if (!asoc) | 186 | if (!asoc) |
184 | ep = __sctp_rcv_lookup_endpoint(&dest); | 187 | ep = __sctp_rcv_lookup_endpoint(&tmp); |
185 | 188 | ||
186 | /* Retrieve the common input handling substructure. */ | 189 | /* Retrieve the common input handling substructure. */ |
187 | rcvr = asoc ? &asoc->base : &ep->base; | 190 | rcvr = asoc ? &asoc->base : &ep->base; |
@@ -726,7 +729,7 @@ static struct sctp_endpoint *__sctp_rcv_lookup_endpoint(const union sctp_addr *l | |||
726 | struct sctp_endpoint *ep; | 729 | struct sctp_endpoint *ep; |
727 | int hash; | 730 | int hash; |
728 | 731 | ||
729 | hash = sctp_ep_hashfn(laddr->v4.sin_port); | 732 | hash = sctp_ep_hashfn(ntohs(laddr->v4.sin_port)); |
730 | head = &sctp_ep_hashtable[hash]; | 733 | head = &sctp_ep_hashtable[hash]; |
731 | read_lock(&head->lock); | 734 | read_lock(&head->lock); |
732 | for (epb = head->chain; epb; epb = epb->next) { | 735 | for (epb = head->chain; epb; epb = epb->next) { |