diff options
Diffstat (limited to 'net/sctp/input.c')
-rw-r--r-- | net/sctp/input.c | 7 |
1 files changed, 5 insertions, 2 deletions
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) { |