diff options
Diffstat (limited to 'net/sctp/input.c')
-rw-r--r-- | net/sctp/input.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/net/sctp/input.c b/net/sctp/input.c index 0e5ac5e42c96..3b4a552c9f18 100644 --- a/net/sctp/input.c +++ b/net/sctp/input.c | |||
@@ -127,7 +127,6 @@ 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, tmp2; | ||
131 | int family; | 130 | int family; |
132 | struct sctp_af *af; | 131 | struct sctp_af *af; |
133 | 132 | ||
@@ -179,13 +178,10 @@ int sctp_rcv(struct sk_buff *skb) | |||
179 | !af->addr_valid(&dest, NULL, skb)) | 178 | !af->addr_valid(&dest, NULL, skb)) |
180 | goto discard_it; | 179 | goto discard_it; |
181 | 180 | ||
182 | flip_to_n(&tmp, &dest); | 181 | asoc = __sctp_rcv_lookup(skb, &src, &dest, &transport); |
183 | flip_to_n(&tmp2, &src); | ||
184 | |||
185 | asoc = __sctp_rcv_lookup(skb, &tmp2, &tmp, &transport); | ||
186 | 182 | ||
187 | if (!asoc) | 183 | if (!asoc) |
188 | ep = __sctp_rcv_lookup_endpoint(&tmp); | 184 | ep = __sctp_rcv_lookup_endpoint(&dest); |
189 | 185 | ||
190 | /* Retrieve the common input handling substructure. */ | 186 | /* Retrieve the common input handling substructure. */ |
191 | rcvr = asoc ? &asoc->base : &ep->base; | 187 | rcvr = asoc ? &asoc->base : &ep->base; |
@@ -245,7 +241,7 @@ int sctp_rcv(struct sk_buff *skb) | |||
245 | chunk->sctp_hdr = sh; | 241 | chunk->sctp_hdr = sh; |
246 | 242 | ||
247 | /* Set the source and destination addresses of the incoming chunk. */ | 243 | /* Set the source and destination addresses of the incoming chunk. */ |
248 | sctp_init_addrs(chunk, &tmp2, &tmp); | 244 | sctp_init_addrs(chunk, &src, &dest); |
249 | 245 | ||
250 | /* Remember where we came from. */ | 246 | /* Remember where we came from. */ |
251 | chunk->transport = transport; | 247 | chunk->transport = transport; |
@@ -444,7 +440,6 @@ struct sock *sctp_err_lookup(int family, struct sk_buff *skb, | |||
444 | struct sock *sk = NULL; | 440 | struct sock *sk = NULL; |
445 | struct sctp_association *asoc; | 441 | struct sctp_association *asoc; |
446 | struct sctp_transport *transport = NULL; | 442 | struct sctp_transport *transport = NULL; |
447 | union sctp_addr tmp, tmp2; | ||
448 | 443 | ||
449 | *app = NULL; *tpp = NULL; | 444 | *app = NULL; *tpp = NULL; |
450 | 445 | ||
@@ -456,13 +451,11 @@ struct sock *sctp_err_lookup(int family, struct sk_buff *skb, | |||
456 | /* Initialize local addresses for lookups. */ | 451 | /* Initialize local addresses for lookups. */ |
457 | af->from_skb(&saddr, skb, 1); | 452 | af->from_skb(&saddr, skb, 1); |
458 | af->from_skb(&daddr, skb, 0); | 453 | af->from_skb(&daddr, skb, 0); |
459 | flip_to_n(&tmp, &saddr); | ||
460 | flip_to_n(&tmp2, &daddr); | ||
461 | 454 | ||
462 | /* Look for an association that matches the incoming ICMP error | 455 | /* Look for an association that matches the incoming ICMP error |
463 | * packet. | 456 | * packet. |
464 | */ | 457 | */ |
465 | asoc = __sctp_lookup_association(&tmp, &tmp2, &transport); | 458 | asoc = __sctp_lookup_association(&saddr, &daddr, &transport); |
466 | if (!asoc) | 459 | if (!asoc) |
467 | return NULL; | 460 | return NULL; |
468 | 461 | ||