diff options
Diffstat (limited to 'net/sctp')
-rw-r--r-- | net/sctp/associola.c | 22 | ||||
-rw-r--r-- | net/sctp/bind_addr.c | 4 | ||||
-rw-r--r-- | net/sctp/endpointola.c | 11 | ||||
-rw-r--r-- | net/sctp/input.c | 6 | ||||
-rw-r--r-- | net/sctp/ipv6.c | 24 | ||||
-rw-r--r-- | net/sctp/outqueue.c | 4 | ||||
-rw-r--r-- | net/sctp/proc.c | 6 | ||||
-rw-r--r-- | net/sctp/protocol.c | 24 | ||||
-rw-r--r-- | net/sctp/sm_make_chunk.c | 65 | ||||
-rw-r--r-- | net/sctp/sm_sideeffect.c | 8 | ||||
-rw-r--r-- | net/sctp/sm_statefuns.c | 55 | ||||
-rw-r--r-- | net/sctp/sm_statetable.c | 696 | ||||
-rw-r--r-- | net/sctp/socket.c | 77 | ||||
-rw-r--r-- | net/sctp/tsnmap.c | 9 | ||||
-rw-r--r-- | net/sctp/ulpevent.c | 2 |
15 files changed, 479 insertions, 534 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 | } |
diff --git a/net/sctp/bind_addr.c b/net/sctp/bind_addr.c index 2b9c12a170e5..00994158e496 100644 --- a/net/sctp/bind_addr.c +++ b/net/sctp/bind_addr.c | |||
@@ -161,7 +161,7 @@ int sctp_add_bind_addr(struct sctp_bind_addr *bp, union sctp_addr *new, | |||
161 | * Both v4 and v6 have the port at the same offset. | 161 | * Both v4 and v6 have the port at the same offset. |
162 | */ | 162 | */ |
163 | if (!addr->a.v4.sin_port) | 163 | if (!addr->a.v4.sin_port) |
164 | addr->a.v4.sin_port = bp->port; | 164 | addr->a.v4.sin_port = htons(bp->port); |
165 | 165 | ||
166 | addr->use_as_src = use_as_src; | 166 | addr->use_as_src = use_as_src; |
167 | 167 | ||
@@ -275,7 +275,7 @@ int sctp_raw_to_bind_addrs(struct sctp_bind_addr *bp, __u8 *raw_addr_list, | |||
275 | break; | 275 | break; |
276 | } | 276 | } |
277 | 277 | ||
278 | af->from_addr_param(&addr, rawaddr, port, 0); | 278 | af->from_addr_param(&addr, rawaddr, htons(port), 0); |
279 | retval = sctp_add_bind_addr(bp, &addr, 1, gfp); | 279 | retval = sctp_add_bind_addr(bp, &addr, 1, gfp); |
280 | if (retval) { | 280 | if (retval) { |
281 | /* Can't finish building the list, clean up. */ | 281 | /* Can't finish building the list, clean up. */ |
diff --git a/net/sctp/endpointola.c b/net/sctp/endpointola.c index a2b553721514..129756908da4 100644 --- a/net/sctp/endpointola.c +++ b/net/sctp/endpointola.c | |||
@@ -72,6 +72,10 @@ static struct sctp_endpoint *sctp_endpoint_init(struct sctp_endpoint *ep, | |||
72 | { | 72 | { |
73 | memset(ep, 0, sizeof(struct sctp_endpoint)); | 73 | memset(ep, 0, sizeof(struct sctp_endpoint)); |
74 | 74 | ||
75 | ep->digest = kzalloc(SCTP_SIGNATURE_SIZE, gfp); | ||
76 | if (!ep->digest) | ||
77 | return NULL; | ||
78 | |||
75 | /* Initialize the base structure. */ | 79 | /* Initialize the base structure. */ |
76 | /* What type of endpoint are we? */ | 80 | /* What type of endpoint are we? */ |
77 | ep->base.type = SCTP_EP_TYPE_SOCKET; | 81 | ep->base.type = SCTP_EP_TYPE_SOCKET; |
@@ -181,6 +185,9 @@ static void sctp_endpoint_destroy(struct sctp_endpoint *ep) | |||
181 | /* Free up the HMAC transform. */ | 185 | /* Free up the HMAC transform. */ |
182 | crypto_free_hash(sctp_sk(ep->base.sk)->hmac); | 186 | crypto_free_hash(sctp_sk(ep->base.sk)->hmac); |
183 | 187 | ||
188 | /* Free the digest buffer */ | ||
189 | kfree(ep->digest); | ||
190 | |||
184 | /* Cleanup. */ | 191 | /* Cleanup. */ |
185 | sctp_inq_free(&ep->base.inqueue); | 192 | sctp_inq_free(&ep->base.inqueue); |
186 | sctp_bind_addr_free(&ep->base.bind_addr); | 193 | sctp_bind_addr_free(&ep->base.bind_addr); |
@@ -222,7 +229,7 @@ struct sctp_endpoint *sctp_endpoint_is_match(struct sctp_endpoint *ep, | |||
222 | struct sctp_endpoint *retval; | 229 | struct sctp_endpoint *retval; |
223 | 230 | ||
224 | sctp_read_lock(&ep->base.addr_lock); | 231 | sctp_read_lock(&ep->base.addr_lock); |
225 | if (ep->base.bind_addr.port == laddr->v4.sin_port) { | 232 | if (htons(ep->base.bind_addr.port) == laddr->v4.sin_port) { |
226 | if (sctp_bind_addr_match(&ep->base.bind_addr, laddr, | 233 | if (sctp_bind_addr_match(&ep->base.bind_addr, laddr, |
227 | sctp_sk(ep->base.sk))) { | 234 | sctp_sk(ep->base.sk))) { |
228 | retval = ep; | 235 | retval = ep; |
@@ -250,7 +257,7 @@ static struct sctp_association *__sctp_endpoint_lookup_assoc( | |||
250 | struct sctp_association *asoc; | 257 | struct sctp_association *asoc; |
251 | struct list_head *pos; | 258 | struct list_head *pos; |
252 | 259 | ||
253 | rport = paddr->v4.sin_port; | 260 | rport = ntohs(paddr->v4.sin_port); |
254 | 261 | ||
255 | list_for_each(pos, &ep->asocs) { | 262 | list_for_each(pos, &ep->asocs) { |
256 | asoc = list_entry(pos, struct sctp_association, asocs); | 263 | asoc = list_entry(pos, struct sctp_association, asocs); |
diff --git a/net/sctp/input.c b/net/sctp/input.c index 6d82f400d13c..33111873a488 100644 --- a/net/sctp/input.c +++ b/net/sctp/input.c | |||
@@ -726,7 +726,7 @@ static struct sctp_endpoint *__sctp_rcv_lookup_endpoint(const union sctp_addr *l | |||
726 | struct sctp_endpoint *ep; | 726 | struct sctp_endpoint *ep; |
727 | int hash; | 727 | int hash; |
728 | 728 | ||
729 | hash = sctp_ep_hashfn(laddr->v4.sin_port); | 729 | hash = sctp_ep_hashfn(ntohs(laddr->v4.sin_port)); |
730 | head = &sctp_ep_hashtable[hash]; | 730 | head = &sctp_ep_hashtable[hash]; |
731 | read_lock(&head->lock); | 731 | read_lock(&head->lock); |
732 | for (epb = head->chain; epb; epb = epb->next) { | 732 | for (epb = head->chain; epb; epb = epb->next) { |
@@ -830,7 +830,7 @@ static struct sctp_association *__sctp_lookup_association( | |||
830 | /* Optimize here for direct hit, only listening connections can | 830 | /* Optimize here for direct hit, only listening connections can |
831 | * have wildcards anyways. | 831 | * have wildcards anyways. |
832 | */ | 832 | */ |
833 | hash = sctp_assoc_hashfn(local->v4.sin_port, peer->v4.sin_port); | 833 | hash = sctp_assoc_hashfn(ntohs(local->v4.sin_port), ntohs(peer->v4.sin_port)); |
834 | head = &sctp_assoc_hashtable[hash]; | 834 | head = &sctp_assoc_hashtable[hash]; |
835 | read_lock(&head->lock); | 835 | read_lock(&head->lock); |
836 | for (epb = head->chain; epb; epb = epb->next) { | 836 | for (epb = head->chain; epb; epb = epb->next) { |
@@ -957,7 +957,7 @@ static struct sctp_association *__sctp_rcv_init_lookup(struct sk_buff *skb, | |||
957 | if (!af) | 957 | if (!af) |
958 | continue; | 958 | continue; |
959 | 959 | ||
960 | af->from_addr_param(paddr, params.addr, ntohs(sh->source), 0); | 960 | af->from_addr_param(paddr, params.addr, sh->source, 0); |
961 | 961 | ||
962 | asoc = __sctp_lookup_association(laddr, paddr, &transport); | 962 | asoc = __sctp_lookup_association(laddr, paddr, &transport); |
963 | if (asoc) | 963 | if (asoc) |
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c index 78071c6e6cf1..3c3e560087ca 100644 --- a/net/sctp/ipv6.c +++ b/net/sctp/ipv6.c | |||
@@ -84,7 +84,7 @@ static struct notifier_block sctp_inet6addr_notifier = { | |||
84 | 84 | ||
85 | /* ICMP error handler. */ | 85 | /* ICMP error handler. */ |
86 | SCTP_STATIC void sctp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, | 86 | SCTP_STATIC void sctp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, |
87 | int type, int code, int offset, __u32 info) | 87 | int type, int code, int offset, __be32 info) |
88 | { | 88 | { |
89 | struct inet6_dev *idev; | 89 | struct inet6_dev *idev; |
90 | struct ipv6hdr *iph = (struct ipv6hdr *)skb->data; | 90 | struct ipv6hdr *iph = (struct ipv6hdr *)skb->data; |
@@ -170,8 +170,6 @@ static int sctp_v6_xmit(struct sk_buff *skb, struct sctp_transport *transport, | |||
170 | fl.oif = transport->saddr.v6.sin6_scope_id; | 170 | fl.oif = transport->saddr.v6.sin6_scope_id; |
171 | else | 171 | else |
172 | fl.oif = sk->sk_bound_dev_if; | 172 | fl.oif = sk->sk_bound_dev_if; |
173 | fl.fl_ip_sport = inet_sk(sk)->sport; | ||
174 | fl.fl_ip_dport = transport->ipaddr.v6.sin6_port; | ||
175 | 173 | ||
176 | if (np->opt && np->opt->srcrt) { | 174 | if (np->opt && np->opt->srcrt) { |
177 | struct rt0_hdr *rt0 = (struct rt0_hdr *) np->opt->srcrt; | 175 | struct rt0_hdr *rt0 = (struct rt0_hdr *) np->opt->srcrt; |
@@ -239,7 +237,7 @@ static inline int sctp_v6_addr_match_len(union sctp_addr *s1, | |||
239 | int i, j; | 237 | int i, j; |
240 | 238 | ||
241 | for (i = 0; i < 4 ; i++) { | 239 | for (i = 0; i < 4 ; i++) { |
242 | __u32 a1xora2; | 240 | __be32 a1xora2; |
243 | 241 | ||
244 | a1xora2 = a1->s6_addr32[i] ^ a2->s6_addr32[i]; | 242 | a1xora2 = a1->s6_addr32[i] ^ a2->s6_addr32[i]; |
245 | 243 | ||
@@ -350,7 +348,7 @@ static void sctp_v6_from_skb(union sctp_addr *addr,struct sk_buff *skb, | |||
350 | int is_saddr) | 348 | int is_saddr) |
351 | { | 349 | { |
352 | void *from; | 350 | void *from; |
353 | __u16 *port; | 351 | __be16 *port; |
354 | struct sctphdr *sh; | 352 | struct sctphdr *sh; |
355 | 353 | ||
356 | port = &addr->v6.sin6_port; | 354 | port = &addr->v6.sin6_port; |
@@ -360,10 +358,10 @@ static void sctp_v6_from_skb(union sctp_addr *addr,struct sk_buff *skb, | |||
360 | 358 | ||
361 | sh = (struct sctphdr *) skb->h.raw; | 359 | sh = (struct sctphdr *) skb->h.raw; |
362 | if (is_saddr) { | 360 | if (is_saddr) { |
363 | *port = ntohs(sh->source); | 361 | *port = sh->source; |
364 | from = &skb->nh.ipv6h->saddr; | 362 | from = &skb->nh.ipv6h->saddr; |
365 | } else { | 363 | } else { |
366 | *port = ntohs(sh->dest); | 364 | *port = sh->dest; |
367 | from = &skb->nh.ipv6h->daddr; | 365 | from = &skb->nh.ipv6h->daddr; |
368 | } | 366 | } |
369 | ipv6_addr_copy(&addr->v6.sin6_addr, from); | 367 | ipv6_addr_copy(&addr->v6.sin6_addr, from); |
@@ -373,7 +371,7 @@ static void sctp_v6_from_skb(union sctp_addr *addr,struct sk_buff *skb, | |||
373 | static void sctp_v6_from_sk(union sctp_addr *addr, struct sock *sk) | 371 | static void sctp_v6_from_sk(union sctp_addr *addr, struct sock *sk) |
374 | { | 372 | { |
375 | addr->v6.sin6_family = AF_INET6; | 373 | addr->v6.sin6_family = AF_INET6; |
376 | addr->v6.sin6_port = inet_sk(sk)->num; | 374 | addr->v6.sin6_port = 0; |
377 | addr->v6.sin6_addr = inet6_sk(sk)->rcv_saddr; | 375 | addr->v6.sin6_addr = inet6_sk(sk)->rcv_saddr; |
378 | } | 376 | } |
379 | 377 | ||
@@ -407,7 +405,7 @@ static void sctp_v6_to_sk_daddr(union sctp_addr *addr, struct sock *sk) | |||
407 | /* Initialize a sctp_addr from an address parameter. */ | 405 | /* Initialize a sctp_addr from an address parameter. */ |
408 | static void sctp_v6_from_addr_param(union sctp_addr *addr, | 406 | static void sctp_v6_from_addr_param(union sctp_addr *addr, |
409 | union sctp_addr_param *param, | 407 | union sctp_addr_param *param, |
410 | __u16 port, int iif) | 408 | __be16 port, int iif) |
411 | { | 409 | { |
412 | addr->v6.sin6_family = AF_INET6; | 410 | addr->v6.sin6_family = AF_INET6; |
413 | addr->v6.sin6_port = port; | 411 | addr->v6.sin6_port = port; |
@@ -425,7 +423,7 @@ static int sctp_v6_to_addr_param(const union sctp_addr *addr, | |||
425 | int length = sizeof(sctp_ipv6addr_param_t); | 423 | int length = sizeof(sctp_ipv6addr_param_t); |
426 | 424 | ||
427 | param->v6.param_hdr.type = SCTP_PARAM_IPV6_ADDRESS; | 425 | param->v6.param_hdr.type = SCTP_PARAM_IPV6_ADDRESS; |
428 | param->v6.param_hdr.length = ntohs(length); | 426 | param->v6.param_hdr.length = htons(length); |
429 | ipv6_addr_copy(¶m->v6.addr, &addr->v6.sin6_addr); | 427 | ipv6_addr_copy(¶m->v6.addr, &addr->v6.sin6_addr); |
430 | 428 | ||
431 | return length; | 429 | return length; |
@@ -433,7 +431,7 @@ static int sctp_v6_to_addr_param(const union sctp_addr *addr, | |||
433 | 431 | ||
434 | /* Initialize a sctp_addr from a dst_entry. */ | 432 | /* Initialize a sctp_addr from a dst_entry. */ |
435 | static void sctp_v6_dst_saddr(union sctp_addr *addr, struct dst_entry *dst, | 433 | static void sctp_v6_dst_saddr(union sctp_addr *addr, struct dst_entry *dst, |
436 | unsigned short port) | 434 | __be16 port) |
437 | { | 435 | { |
438 | struct rt6_info *rt = (struct rt6_info *)dst; | 436 | struct rt6_info *rt = (struct rt6_info *)dst; |
439 | addr->sa.sa_family = AF_INET6; | 437 | addr->sa.sa_family = AF_INET6; |
@@ -480,7 +478,7 @@ static int sctp_v6_cmp_addr(const union sctp_addr *addr1, | |||
480 | } | 478 | } |
481 | 479 | ||
482 | /* Initialize addr struct to INADDR_ANY. */ | 480 | /* Initialize addr struct to INADDR_ANY. */ |
483 | static void sctp_v6_inaddr_any(union sctp_addr *addr, unsigned short port) | 481 | static void sctp_v6_inaddr_any(union sctp_addr *addr, __be16 port) |
484 | { | 482 | { |
485 | memset(addr, 0x00, sizeof(union sctp_addr)); | 483 | memset(addr, 0x00, sizeof(union sctp_addr)); |
486 | addr->v6.sin6_family = AF_INET6; | 484 | addr->v6.sin6_family = AF_INET6; |
@@ -855,7 +853,7 @@ static int sctp_inet6_send_verify(struct sctp_sock *opt, union sctp_addr *addr) | |||
855 | * Returns number of addresses supported. | 853 | * Returns number of addresses supported. |
856 | */ | 854 | */ |
857 | static int sctp_inet6_supported_addrs(const struct sctp_sock *opt, | 855 | static int sctp_inet6_supported_addrs(const struct sctp_sock *opt, |
858 | __u16 *types) | 856 | __be16 *types) |
859 | { | 857 | { |
860 | types[0] = SCTP_PARAM_IPV4_ADDRESS; | 858 | types[0] = SCTP_PARAM_IPV4_ADDRESS; |
861 | types[1] = SCTP_PARAM_IPV6_ADDRESS; | 859 | types[1] = SCTP_PARAM_IPV6_ADDRESS; |
diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c index 739582415bf6..fba567a7cb64 100644 --- a/net/sctp/outqueue.c +++ b/net/sctp/outqueue.c | |||
@@ -1065,7 +1065,7 @@ int sctp_outq_sack(struct sctp_outq *q, struct sctp_sackhdr *sack) | |||
1065 | * A) Initialize the cacc_saw_newack to 0 for all destination | 1065 | * A) Initialize the cacc_saw_newack to 0 for all destination |
1066 | * addresses. | 1066 | * addresses. |
1067 | */ | 1067 | */ |
1068 | if (sack->num_gap_ack_blocks > 0 && | 1068 | if (sack->num_gap_ack_blocks && |
1069 | primary->cacc.changeover_active) { | 1069 | primary->cacc.changeover_active) { |
1070 | list_for_each(pos, transport_list) { | 1070 | list_for_each(pos, transport_list) { |
1071 | transport = list_entry(pos, struct sctp_transport, | 1071 | transport = list_entry(pos, struct sctp_transport, |
@@ -1632,7 +1632,7 @@ pass: | |||
1632 | } | 1632 | } |
1633 | 1633 | ||
1634 | static inline int sctp_get_skip_pos(struct sctp_fwdtsn_skip *skiplist, | 1634 | static inline int sctp_get_skip_pos(struct sctp_fwdtsn_skip *skiplist, |
1635 | int nskips, __u16 stream) | 1635 | int nskips, __be16 stream) |
1636 | { | 1636 | { |
1637 | int i; | 1637 | int i; |
1638 | 1638 | ||
diff --git a/net/sctp/proc.c b/net/sctp/proc.c index 7f49e769080e..b3493bdbcacb 100644 --- a/net/sctp/proc.c +++ b/net/sctp/proc.c | |||
@@ -160,7 +160,7 @@ static void sctp_seq_dump_local_addrs(struct seq_file *seq, struct sctp_ep_commo | |||
160 | 160 | ||
161 | list_for_each(pos, &epb->bind_addr.address_list) { | 161 | list_for_each(pos, &epb->bind_addr.address_list) { |
162 | laddr = list_entry(pos, struct sctp_sockaddr_entry, list); | 162 | laddr = list_entry(pos, struct sctp_sockaddr_entry, list); |
163 | addr = (union sctp_addr *)&laddr->a; | 163 | addr = &laddr->a; |
164 | af = sctp_get_af_specific(addr->sa.sa_family); | 164 | af = sctp_get_af_specific(addr->sa.sa_family); |
165 | if (primary && af->cmp_addr(addr, primary)) { | 165 | if (primary && af->cmp_addr(addr, primary)) { |
166 | seq_printf(seq, "*"); | 166 | seq_printf(seq, "*"); |
@@ -177,10 +177,10 @@ static void sctp_seq_dump_remote_addrs(struct seq_file *seq, struct sctp_associa | |||
177 | union sctp_addr *addr, *primary; | 177 | union sctp_addr *addr, *primary; |
178 | struct sctp_af *af; | 178 | struct sctp_af *af; |
179 | 179 | ||
180 | primary = &(assoc->peer.primary_addr); | 180 | primary = &assoc->peer.primary_addr; |
181 | list_for_each(pos, &assoc->peer.transport_addr_list) { | 181 | list_for_each(pos, &assoc->peer.transport_addr_list) { |
182 | transport = list_entry(pos, struct sctp_transport, transports); | 182 | transport = list_entry(pos, struct sctp_transport, transports); |
183 | addr = (union sctp_addr *)&transport->ipaddr; | 183 | addr = &transport->ipaddr; |
184 | af = sctp_get_af_specific(addr->sa.sa_family); | 184 | af = sctp_get_af_specific(addr->sa.sa_family); |
185 | if (af->cmp_addr(addr, primary)) { | 185 | if (af->cmp_addr(addr, primary)) { |
186 | seq_printf(seq, "*"); | 186 | seq_printf(seq, "*"); |
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c index 5b4f82fd98f8..11f3b549f4a4 100644 --- a/net/sctp/protocol.c +++ b/net/sctp/protocol.c | |||
@@ -251,7 +251,7 @@ static void sctp_v4_from_skb(union sctp_addr *addr, struct sk_buff *skb, | |||
251 | int is_saddr) | 251 | int is_saddr) |
252 | { | 252 | { |
253 | void *from; | 253 | void *from; |
254 | __u16 *port; | 254 | __be16 *port; |
255 | struct sctphdr *sh; | 255 | struct sctphdr *sh; |
256 | 256 | ||
257 | port = &addr->v4.sin_port; | 257 | port = &addr->v4.sin_port; |
@@ -259,10 +259,10 @@ static void sctp_v4_from_skb(union sctp_addr *addr, struct sk_buff *skb, | |||
259 | 259 | ||
260 | sh = (struct sctphdr *) skb->h.raw; | 260 | sh = (struct sctphdr *) skb->h.raw; |
261 | if (is_saddr) { | 261 | if (is_saddr) { |
262 | *port = ntohs(sh->source); | 262 | *port = sh->source; |
263 | from = &skb->nh.iph->saddr; | 263 | from = &skb->nh.iph->saddr; |
264 | } else { | 264 | } else { |
265 | *port = ntohs(sh->dest); | 265 | *port = sh->dest; |
266 | from = &skb->nh.iph->daddr; | 266 | from = &skb->nh.iph->daddr; |
267 | } | 267 | } |
268 | memcpy(&addr->v4.sin_addr.s_addr, from, sizeof(struct in_addr)); | 268 | memcpy(&addr->v4.sin_addr.s_addr, from, sizeof(struct in_addr)); |
@@ -272,7 +272,7 @@ static void sctp_v4_from_skb(union sctp_addr *addr, struct sk_buff *skb, | |||
272 | static void sctp_v4_from_sk(union sctp_addr *addr, struct sock *sk) | 272 | static void sctp_v4_from_sk(union sctp_addr *addr, struct sock *sk) |
273 | { | 273 | { |
274 | addr->v4.sin_family = AF_INET; | 274 | addr->v4.sin_family = AF_INET; |
275 | addr->v4.sin_port = inet_sk(sk)->num; | 275 | addr->v4.sin_port = 0; |
276 | addr->v4.sin_addr.s_addr = inet_sk(sk)->rcv_saddr; | 276 | addr->v4.sin_addr.s_addr = inet_sk(sk)->rcv_saddr; |
277 | } | 277 | } |
278 | 278 | ||
@@ -291,7 +291,7 @@ static void sctp_v4_to_sk_daddr(union sctp_addr *addr, struct sock *sk) | |||
291 | /* Initialize a sctp_addr from an address parameter. */ | 291 | /* Initialize a sctp_addr from an address parameter. */ |
292 | static void sctp_v4_from_addr_param(union sctp_addr *addr, | 292 | static void sctp_v4_from_addr_param(union sctp_addr *addr, |
293 | union sctp_addr_param *param, | 293 | union sctp_addr_param *param, |
294 | __u16 port, int iif) | 294 | __be16 port, int iif) |
295 | { | 295 | { |
296 | addr->v4.sin_family = AF_INET; | 296 | addr->v4.sin_family = AF_INET; |
297 | addr->v4.sin_port = port; | 297 | addr->v4.sin_port = port; |
@@ -307,7 +307,7 @@ static int sctp_v4_to_addr_param(const union sctp_addr *addr, | |||
307 | int length = sizeof(sctp_ipv4addr_param_t); | 307 | int length = sizeof(sctp_ipv4addr_param_t); |
308 | 308 | ||
309 | param->v4.param_hdr.type = SCTP_PARAM_IPV4_ADDRESS; | 309 | param->v4.param_hdr.type = SCTP_PARAM_IPV4_ADDRESS; |
310 | param->v4.param_hdr.length = ntohs(length); | 310 | param->v4.param_hdr.length = htons(length); |
311 | param->v4.addr.s_addr = addr->v4.sin_addr.s_addr; | 311 | param->v4.addr.s_addr = addr->v4.sin_addr.s_addr; |
312 | 312 | ||
313 | return length; | 313 | return length; |
@@ -315,7 +315,7 @@ static int sctp_v4_to_addr_param(const union sctp_addr *addr, | |||
315 | 315 | ||
316 | /* Initialize a sctp_addr from a dst_entry. */ | 316 | /* Initialize a sctp_addr from a dst_entry. */ |
317 | static void sctp_v4_dst_saddr(union sctp_addr *saddr, struct dst_entry *dst, | 317 | static void sctp_v4_dst_saddr(union sctp_addr *saddr, struct dst_entry *dst, |
318 | unsigned short port) | 318 | __be16 port) |
319 | { | 319 | { |
320 | struct rtable *rt = (struct rtable *)dst; | 320 | struct rtable *rt = (struct rtable *)dst; |
321 | saddr->v4.sin_family = AF_INET; | 321 | saddr->v4.sin_family = AF_INET; |
@@ -338,7 +338,7 @@ static int sctp_v4_cmp_addr(const union sctp_addr *addr1, | |||
338 | } | 338 | } |
339 | 339 | ||
340 | /* Initialize addr struct to INADDR_ANY. */ | 340 | /* Initialize addr struct to INADDR_ANY. */ |
341 | static void sctp_v4_inaddr_any(union sctp_addr *addr, unsigned short port) | 341 | static void sctp_v4_inaddr_any(union sctp_addr *addr, __be16 port) |
342 | { | 342 | { |
343 | addr->v4.sin_family = AF_INET; | 343 | addr->v4.sin_family = AF_INET; |
344 | addr->v4.sin_addr.s_addr = INADDR_ANY; | 344 | addr->v4.sin_addr.s_addr = INADDR_ANY; |
@@ -481,7 +481,7 @@ static struct dst_entry *sctp_v4_get_dst(struct sctp_association *asoc, | |||
481 | list); | 481 | list); |
482 | if (!laddr->use_as_src) | 482 | if (!laddr->use_as_src) |
483 | continue; | 483 | continue; |
484 | sctp_v4_dst_saddr(&dst_saddr, dst, bp->port); | 484 | sctp_v4_dst_saddr(&dst_saddr, dst, htons(bp->port)); |
485 | if (sctp_v4_cmp_addr(&dst_saddr, &laddr->a)) | 485 | if (sctp_v4_cmp_addr(&dst_saddr, &laddr->a)) |
486 | goto out_unlock; | 486 | goto out_unlock; |
487 | } | 487 | } |
@@ -538,7 +538,7 @@ static void sctp_v4_get_saddr(struct sctp_association *asoc, | |||
538 | 538 | ||
539 | if (rt) { | 539 | if (rt) { |
540 | saddr->v4.sin_family = AF_INET; | 540 | saddr->v4.sin_family = AF_INET; |
541 | saddr->v4.sin_port = asoc->base.bind_addr.port; | 541 | saddr->v4.sin_port = htons(asoc->base.bind_addr.port); |
542 | saddr->v4.sin_addr.s_addr = rt->rt_src; | 542 | saddr->v4.sin_addr.s_addr = rt->rt_src; |
543 | } | 543 | } |
544 | } | 544 | } |
@@ -791,7 +791,7 @@ static int sctp_inet_send_verify(struct sctp_sock *opt, union sctp_addr *addr) | |||
791 | * chunks. Returns number of addresses supported. | 791 | * chunks. Returns number of addresses supported. |
792 | */ | 792 | */ |
793 | static int sctp_inet_supported_addrs(const struct sctp_sock *opt, | 793 | static int sctp_inet_supported_addrs(const struct sctp_sock *opt, |
794 | __u16 *types) | 794 | __be16 *types) |
795 | { | 795 | { |
796 | types[0] = SCTP_PARAM_IPV4_ADDRESS; | 796 | types[0] = SCTP_PARAM_IPV4_ADDRESS; |
797 | return 1; | 797 | return 1; |
@@ -808,7 +808,7 @@ static inline int sctp_v4_xmit(struct sk_buff *skb, | |||
808 | NIPQUAD(((struct rtable *)skb->dst)->rt_dst)); | 808 | NIPQUAD(((struct rtable *)skb->dst)->rt_dst)); |
809 | 809 | ||
810 | SCTP_INC_STATS(SCTP_MIB_OUTSCTPPACKS); | 810 | SCTP_INC_STATS(SCTP_MIB_OUTSCTPPACKS); |
811 | return ip_queue_xmit(skb, ipfragok); | 811 | return ip_queue_xmit(skb, skb->sk, ipfragok); |
812 | } | 812 | } |
813 | 813 | ||
814 | static struct sctp_af sctp_ipv4_specific; | 814 | static struct sctp_af sctp_ipv4_specific; |
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c index 507dff72c585..04954e5f6846 100644 --- a/net/sctp/sm_make_chunk.c +++ b/net/sctp/sm_make_chunk.c | |||
@@ -111,7 +111,7 @@ static const struct sctp_paramhdr prsctp_param = { | |||
111 | * provided chunk, as most cause codes will be embedded inside an | 111 | * provided chunk, as most cause codes will be embedded inside an |
112 | * abort chunk. | 112 | * abort chunk. |
113 | */ | 113 | */ |
114 | void sctp_init_cause(struct sctp_chunk *chunk, __u16 cause_code, | 114 | void sctp_init_cause(struct sctp_chunk *chunk, __be16 cause_code, |
115 | const void *payload, size_t paylen) | 115 | const void *payload, size_t paylen) |
116 | { | 116 | { |
117 | sctp_errhdr_t err; | 117 | sctp_errhdr_t err; |
@@ -183,7 +183,7 @@ struct sctp_chunk *sctp_make_init(const struct sctp_association *asoc, | |||
183 | int num_types, addrs_len = 0; | 183 | int num_types, addrs_len = 0; |
184 | struct sctp_sock *sp; | 184 | struct sctp_sock *sp; |
185 | sctp_supported_addrs_param_t sat; | 185 | sctp_supported_addrs_param_t sat; |
186 | __u16 types[2]; | 186 | __be16 types[2]; |
187 | sctp_adaption_ind_param_t aiparam; | 187 | sctp_adaption_ind_param_t aiparam; |
188 | 188 | ||
189 | /* RFC 2960 3.3.2 Initiation (INIT) (1) | 189 | /* RFC 2960 3.3.2 Initiation (INIT) (1) |
@@ -775,7 +775,7 @@ struct sctp_chunk *sctp_make_abort_no_data( | |||
775 | const struct sctp_chunk *chunk, __u32 tsn) | 775 | const struct sctp_chunk *chunk, __u32 tsn) |
776 | { | 776 | { |
777 | struct sctp_chunk *retval; | 777 | struct sctp_chunk *retval; |
778 | __u32 payload; | 778 | __be32 payload; |
779 | 779 | ||
780 | retval = sctp_make_abort(asoc, chunk, sizeof(sctp_errhdr_t) | 780 | retval = sctp_make_abort(asoc, chunk, sizeof(sctp_errhdr_t) |
781 | + sizeof(tsn)); | 781 | + sizeof(tsn)); |
@@ -951,7 +951,7 @@ nodata: | |||
951 | /* Create an Operation Error chunk. */ | 951 | /* Create an Operation Error chunk. */ |
952 | struct sctp_chunk *sctp_make_op_error(const struct sctp_association *asoc, | 952 | struct sctp_chunk *sctp_make_op_error(const struct sctp_association *asoc, |
953 | const struct sctp_chunk *chunk, | 953 | const struct sctp_chunk *chunk, |
954 | __u16 cause_code, const void *payload, | 954 | __be16 cause_code, const void *payload, |
955 | size_t paylen) | 955 | size_t paylen) |
956 | { | 956 | { |
957 | struct sctp_chunk *retval; | 957 | struct sctp_chunk *retval; |
@@ -1190,15 +1190,14 @@ void sctp_chunk_assign_ssn(struct sctp_chunk *chunk) | |||
1190 | if (chunk->chunk_hdr->flags & SCTP_DATA_UNORDERED) { | 1190 | if (chunk->chunk_hdr->flags & SCTP_DATA_UNORDERED) { |
1191 | ssn = 0; | 1191 | ssn = 0; |
1192 | } else { | 1192 | } else { |
1193 | sid = htons(chunk->subh.data_hdr->stream); | 1193 | sid = ntohs(chunk->subh.data_hdr->stream); |
1194 | if (chunk->chunk_hdr->flags & SCTP_DATA_LAST_FRAG) | 1194 | if (chunk->chunk_hdr->flags & SCTP_DATA_LAST_FRAG) |
1195 | ssn = sctp_ssn_next(&chunk->asoc->ssnmap->out, sid); | 1195 | ssn = sctp_ssn_next(&chunk->asoc->ssnmap->out, sid); |
1196 | else | 1196 | else |
1197 | ssn = sctp_ssn_peek(&chunk->asoc->ssnmap->out, sid); | 1197 | ssn = sctp_ssn_peek(&chunk->asoc->ssnmap->out, sid); |
1198 | ssn = htons(ssn); | ||
1199 | } | 1198 | } |
1200 | 1199 | ||
1201 | chunk->subh.data_hdr->ssn = ssn; | 1200 | chunk->subh.data_hdr->ssn = htons(ssn); |
1202 | chunk->has_ssn = 1; | 1201 | chunk->has_ssn = 1; |
1203 | } | 1202 | } |
1204 | 1203 | ||
@@ -1280,15 +1279,13 @@ static sctp_cookie_param_t *sctp_pack_cookie(const struct sctp_endpoint *ep, | |||
1280 | - (bodysize % SCTP_COOKIE_MULTIPLE); | 1279 | - (bodysize % SCTP_COOKIE_MULTIPLE); |
1281 | *cookie_len = headersize + bodysize; | 1280 | *cookie_len = headersize + bodysize; |
1282 | 1281 | ||
1283 | retval = kmalloc(*cookie_len, GFP_ATOMIC); | ||
1284 | |||
1285 | if (!retval) | ||
1286 | goto nodata; | ||
1287 | |||
1288 | /* Clear this memory since we are sending this data structure | 1282 | /* Clear this memory since we are sending this data structure |
1289 | * out on the network. | 1283 | * out on the network. |
1290 | */ | 1284 | */ |
1291 | memset(retval, 0x00, *cookie_len); | 1285 | retval = kzalloc(*cookie_len, GFP_ATOMIC); |
1286 | if (!retval) | ||
1287 | goto nodata; | ||
1288 | |||
1292 | cookie = (struct sctp_signed_cookie *) retval->body; | 1289 | cookie = (struct sctp_signed_cookie *) retval->body; |
1293 | 1290 | ||
1294 | /* Set up the parameter header. */ | 1291 | /* Set up the parameter header. */ |
@@ -1438,7 +1435,7 @@ no_hmac: | |||
1438 | goto fail; | 1435 | goto fail; |
1439 | } | 1436 | } |
1440 | 1437 | ||
1441 | if (ntohs(chunk->sctp_hdr->source) != bear_cookie->peer_addr.v4.sin_port || | 1438 | if (chunk->sctp_hdr->source != bear_cookie->peer_addr.v4.sin_port || |
1442 | ntohs(chunk->sctp_hdr->dest) != bear_cookie->my_port) { | 1439 | ntohs(chunk->sctp_hdr->dest) != bear_cookie->my_port) { |
1443 | *error = -SCTP_IERROR_BAD_PORTS; | 1440 | *error = -SCTP_IERROR_BAD_PORTS; |
1444 | goto fail; | 1441 | goto fail; |
@@ -1473,10 +1470,10 @@ no_hmac: | |||
1473 | suseconds_t usecs = (tv.tv_sec - | 1470 | suseconds_t usecs = (tv.tv_sec - |
1474 | bear_cookie->expiration.tv_sec) * 1000000L + | 1471 | bear_cookie->expiration.tv_sec) * 1000000L + |
1475 | tv.tv_usec - bear_cookie->expiration.tv_usec; | 1472 | tv.tv_usec - bear_cookie->expiration.tv_usec; |
1473 | __be32 n = htonl(usecs); | ||
1476 | 1474 | ||
1477 | usecs = htonl(usecs); | ||
1478 | sctp_init_cause(*errp, SCTP_ERROR_STALE_COOKIE, | 1475 | sctp_init_cause(*errp, SCTP_ERROR_STALE_COOKIE, |
1479 | &usecs, sizeof(usecs)); | 1476 | &n, sizeof(n)); |
1480 | *error = -SCTP_IERROR_STALE_COOKIE; | 1477 | *error = -SCTP_IERROR_STALE_COOKIE; |
1481 | } else | 1478 | } else |
1482 | *error = -SCTP_IERROR_NOMEM; | 1479 | *error = -SCTP_IERROR_NOMEM; |
@@ -1539,8 +1536,8 @@ malformed: | |||
1539 | ********************************************************************/ | 1536 | ********************************************************************/ |
1540 | 1537 | ||
1541 | struct __sctp_missing { | 1538 | struct __sctp_missing { |
1542 | __u32 num_missing; | 1539 | __be32 num_missing; |
1543 | __u16 type; | 1540 | __be16 type; |
1544 | } __attribute__((packed)); | 1541 | } __attribute__((packed)); |
1545 | 1542 | ||
1546 | /* | 1543 | /* |
@@ -1852,9 +1849,10 @@ int sctp_process_init(struct sctp_association *asoc, sctp_cid_t cid, | |||
1852 | * added as the primary transport. The source address seems to | 1849 | * added as the primary transport. The source address seems to |
1853 | * be a a better choice than any of the embedded addresses. | 1850 | * be a a better choice than any of the embedded addresses. |
1854 | */ | 1851 | */ |
1855 | if (peer_addr) | 1852 | if (peer_addr) { |
1856 | if(!sctp_assoc_add_peer(asoc, peer_addr, gfp, SCTP_ACTIVE)) | 1853 | if(!sctp_assoc_add_peer(asoc, peer_addr, gfp, SCTP_ACTIVE)) |
1857 | goto nomem; | 1854 | goto nomem; |
1855 | } | ||
1858 | 1856 | ||
1859 | /* Process the initialization parameters. */ | 1857 | /* Process the initialization parameters. */ |
1860 | 1858 | ||
@@ -1910,10 +1908,9 @@ int sctp_process_init(struct sctp_association *asoc, sctp_cid_t cid, | |||
1910 | /* Copy cookie in case we need to resend COOKIE-ECHO. */ | 1908 | /* Copy cookie in case we need to resend COOKIE-ECHO. */ |
1911 | cookie = asoc->peer.cookie; | 1909 | cookie = asoc->peer.cookie; |
1912 | if (cookie) { | 1910 | if (cookie) { |
1913 | asoc->peer.cookie = kmalloc(asoc->peer.cookie_len, gfp); | 1911 | asoc->peer.cookie = kmemdup(cookie, asoc->peer.cookie_len, gfp); |
1914 | if (!asoc->peer.cookie) | 1912 | if (!asoc->peer.cookie) |
1915 | goto clean_up; | 1913 | goto clean_up; |
1916 | memcpy(asoc->peer.cookie, cookie, asoc->peer.cookie_len); | ||
1917 | } | 1914 | } |
1918 | 1915 | ||
1919 | /* RFC 2960 7.2.1 The initial value of ssthresh MAY be arbitrarily | 1916 | /* RFC 2960 7.2.1 The initial value of ssthresh MAY be arbitrarily |
@@ -2027,7 +2024,7 @@ static int sctp_process_param(struct sctp_association *asoc, | |||
2027 | /* Fall through. */ | 2024 | /* Fall through. */ |
2028 | case SCTP_PARAM_IPV4_ADDRESS: | 2025 | case SCTP_PARAM_IPV4_ADDRESS: |
2029 | af = sctp_get_af_specific(param_type2af(param.p->type)); | 2026 | af = sctp_get_af_specific(param_type2af(param.p->type)); |
2030 | af->from_addr_param(&addr, param.addr, asoc->peer.port, 0); | 2027 | af->from_addr_param(&addr, param.addr, htons(asoc->peer.port), 0); |
2031 | scope = sctp_scope(peer_addr); | 2028 | scope = sctp_scope(peer_addr); |
2032 | if (sctp_in_scope(&addr, scope)) | 2029 | if (sctp_in_scope(&addr, scope)) |
2033 | if (!sctp_assoc_add_peer(asoc, &addr, gfp, SCTP_UNCONFIRMED)) | 2030 | if (!sctp_assoc_add_peer(asoc, &addr, gfp, SCTP_UNCONFIRMED)) |
@@ -2230,7 +2227,7 @@ struct sctp_chunk *sctp_make_asconf_update_ip(struct sctp_association *asoc, | |||
2230 | union sctp_addr *laddr, | 2227 | union sctp_addr *laddr, |
2231 | struct sockaddr *addrs, | 2228 | struct sockaddr *addrs, |
2232 | int addrcnt, | 2229 | int addrcnt, |
2233 | __u16 flags) | 2230 | __be16 flags) |
2234 | { | 2231 | { |
2235 | sctp_addip_param_t param; | 2232 | sctp_addip_param_t param; |
2236 | struct sctp_chunk *retval; | 2233 | struct sctp_chunk *retval; |
@@ -2363,14 +2360,14 @@ static struct sctp_chunk *sctp_make_asconf_ack(const struct sctp_association *as | |||
2363 | } | 2360 | } |
2364 | 2361 | ||
2365 | /* Add response parameters to an ASCONF_ACK chunk. */ | 2362 | /* Add response parameters to an ASCONF_ACK chunk. */ |
2366 | static void sctp_add_asconf_response(struct sctp_chunk *chunk, __u32 crr_id, | 2363 | static void sctp_add_asconf_response(struct sctp_chunk *chunk, __be32 crr_id, |
2367 | __u16 err_code, sctp_addip_param_t *asconf_param) | 2364 | __be16 err_code, sctp_addip_param_t *asconf_param) |
2368 | { | 2365 | { |
2369 | sctp_addip_param_t ack_param; | 2366 | sctp_addip_param_t ack_param; |
2370 | sctp_errhdr_t err_param; | 2367 | sctp_errhdr_t err_param; |
2371 | int asconf_param_len = 0; | 2368 | int asconf_param_len = 0; |
2372 | int err_param_len = 0; | 2369 | int err_param_len = 0; |
2373 | __u16 response_type; | 2370 | __be16 response_type; |
2374 | 2371 | ||
2375 | if (SCTP_ERROR_NO_ERROR == err_code) { | 2372 | if (SCTP_ERROR_NO_ERROR == err_code) { |
2376 | response_type = SCTP_PARAM_SUCCESS_REPORT; | 2373 | response_type = SCTP_PARAM_SUCCESS_REPORT; |
@@ -2404,7 +2401,7 @@ static void sctp_add_asconf_response(struct sctp_chunk *chunk, __u32 crr_id, | |||
2404 | } | 2401 | } |
2405 | 2402 | ||
2406 | /* Process a asconf parameter. */ | 2403 | /* Process a asconf parameter. */ |
2407 | static __u16 sctp_process_asconf_param(struct sctp_association *asoc, | 2404 | static __be16 sctp_process_asconf_param(struct sctp_association *asoc, |
2408 | struct sctp_chunk *asconf, | 2405 | struct sctp_chunk *asconf, |
2409 | sctp_addip_param_t *asconf_param) | 2406 | sctp_addip_param_t *asconf_param) |
2410 | { | 2407 | { |
@@ -2413,7 +2410,7 @@ static __u16 sctp_process_asconf_param(struct sctp_association *asoc, | |||
2413 | union sctp_addr addr; | 2410 | union sctp_addr addr; |
2414 | struct list_head *pos; | 2411 | struct list_head *pos; |
2415 | union sctp_addr_param *addr_param; | 2412 | union sctp_addr_param *addr_param; |
2416 | 2413 | ||
2417 | addr_param = (union sctp_addr_param *) | 2414 | addr_param = (union sctp_addr_param *) |
2418 | ((void *)asconf_param + sizeof(sctp_addip_param_t)); | 2415 | ((void *)asconf_param + sizeof(sctp_addip_param_t)); |
2419 | 2416 | ||
@@ -2421,7 +2418,7 @@ static __u16 sctp_process_asconf_param(struct sctp_association *asoc, | |||
2421 | if (unlikely(!af)) | 2418 | if (unlikely(!af)) |
2422 | return SCTP_ERROR_INV_PARAM; | 2419 | return SCTP_ERROR_INV_PARAM; |
2423 | 2420 | ||
2424 | af->from_addr_param(&addr, addr_param, asoc->peer.port, 0); | 2421 | af->from_addr_param(&addr, addr_param, htons(asoc->peer.port), 0); |
2425 | switch (asconf_param->param_hdr.type) { | 2422 | switch (asconf_param->param_hdr.type) { |
2426 | case SCTP_PARAM_ADD_IP: | 2423 | case SCTP_PARAM_ADD_IP: |
2427 | /* ADDIP 4.3 D9) If an endpoint receives an ADD IP address | 2424 | /* ADDIP 4.3 D9) If an endpoint receives an ADD IP address |
@@ -2487,7 +2484,7 @@ struct sctp_chunk *sctp_process_asconf(struct sctp_association *asoc, | |||
2487 | sctp_addip_param_t *asconf_param; | 2484 | sctp_addip_param_t *asconf_param; |
2488 | struct sctp_chunk *asconf_ack; | 2485 | struct sctp_chunk *asconf_ack; |
2489 | 2486 | ||
2490 | __u16 err_code; | 2487 | __be16 err_code; |
2491 | int length = 0; | 2488 | int length = 0; |
2492 | int chunk_len = asconf->skb->len; | 2489 | int chunk_len = asconf->skb->len; |
2493 | __u32 serial; | 2490 | __u32 serial; |
@@ -2586,7 +2583,7 @@ static int sctp_asconf_param_success(struct sctp_association *asoc, | |||
2586 | 2583 | ||
2587 | /* We have checked the packet before, so we do not check again. */ | 2584 | /* We have checked the packet before, so we do not check again. */ |
2588 | af = sctp_get_af_specific(param_type2af(addr_param->v4.param_hdr.type)); | 2585 | af = sctp_get_af_specific(param_type2af(addr_param->v4.param_hdr.type)); |
2589 | af->from_addr_param(&addr, addr_param, bp->port, 0); | 2586 | af->from_addr_param(&addr, addr_param, htons(bp->port), 0); |
2590 | 2587 | ||
2591 | switch (asconf_param->param_hdr.type) { | 2588 | switch (asconf_param->param_hdr.type) { |
2592 | case SCTP_PARAM_ADD_IP: | 2589 | case SCTP_PARAM_ADD_IP: |
@@ -2630,7 +2627,7 @@ static int sctp_asconf_param_success(struct sctp_association *asoc, | |||
2630 | * All TLVs after the failed response are considered unsuccessful unless a | 2627 | * All TLVs after the failed response are considered unsuccessful unless a |
2631 | * specific success indication is present for the parameter. | 2628 | * specific success indication is present for the parameter. |
2632 | */ | 2629 | */ |
2633 | static __u16 sctp_get_asconf_response(struct sctp_chunk *asconf_ack, | 2630 | static __be16 sctp_get_asconf_response(struct sctp_chunk *asconf_ack, |
2634 | sctp_addip_param_t *asconf_param, | 2631 | sctp_addip_param_t *asconf_param, |
2635 | int no_err) | 2632 | int no_err) |
2636 | { | 2633 | { |
@@ -2638,7 +2635,7 @@ static __u16 sctp_get_asconf_response(struct sctp_chunk *asconf_ack, | |||
2638 | sctp_errhdr_t *err_param; | 2635 | sctp_errhdr_t *err_param; |
2639 | int length; | 2636 | int length; |
2640 | int asconf_ack_len = asconf_ack->skb->len; | 2637 | int asconf_ack_len = asconf_ack->skb->len; |
2641 | __u16 err_code; | 2638 | __be16 err_code; |
2642 | 2639 | ||
2643 | if (no_err) | 2640 | if (no_err) |
2644 | err_code = SCTP_ERROR_NO_ERROR; | 2641 | err_code = SCTP_ERROR_NO_ERROR; |
@@ -2694,7 +2691,7 @@ int sctp_process_asconf_ack(struct sctp_association *asoc, | |||
2694 | int all_param_pass = 0; | 2691 | int all_param_pass = 0; |
2695 | int no_err = 1; | 2692 | int no_err = 1; |
2696 | int retval = 0; | 2693 | int retval = 0; |
2697 | __u16 err_code = SCTP_ERROR_NO_ERROR; | 2694 | __be16 err_code = SCTP_ERROR_NO_ERROR; |
2698 | 2695 | ||
2699 | /* Skip the chunkhdr and addiphdr from the last asconf sent and store | 2696 | /* Skip the chunkhdr and addiphdr from the last asconf sent and store |
2700 | * a pointer to address parameter. | 2697 | * a pointer to address parameter. |
diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c index 9c10bdec1afe..7bbc6156e455 100644 --- a/net/sctp/sm_sideeffect.c +++ b/net/sctp/sm_sideeffect.c | |||
@@ -442,7 +442,7 @@ static void sctp_do_8_2_transport_strike(struct sctp_association *asoc, | |||
442 | " transport IP: port:%d failed.\n", | 442 | " transport IP: port:%d failed.\n", |
443 | asoc, | 443 | asoc, |
444 | (&transport->ipaddr), | 444 | (&transport->ipaddr), |
445 | transport->ipaddr.v4.sin_port); | 445 | ntohs(transport->ipaddr.v4.sin_port)); |
446 | sctp_assoc_control_transport(asoc, transport, | 446 | sctp_assoc_control_transport(asoc, transport, |
447 | SCTP_TRANSPORT_DOWN, | 447 | SCTP_TRANSPORT_DOWN, |
448 | SCTP_FAILED_THRESHOLD); | 448 | SCTP_FAILED_THRESHOLD); |
@@ -1360,12 +1360,12 @@ static int sctp_cmd_interpreter(sctp_event_t event_type, | |||
1360 | break; | 1360 | break; |
1361 | 1361 | ||
1362 | case SCTP_CMD_INIT_FAILED: | 1362 | case SCTP_CMD_INIT_FAILED: |
1363 | sctp_cmd_init_failed(commands, asoc, cmd->obj.u32); | 1363 | sctp_cmd_init_failed(commands, asoc, cmd->obj.err); |
1364 | break; | 1364 | break; |
1365 | 1365 | ||
1366 | case SCTP_CMD_ASSOC_FAILED: | 1366 | case SCTP_CMD_ASSOC_FAILED: |
1367 | sctp_cmd_assoc_failed(commands, asoc, event_type, | 1367 | sctp_cmd_assoc_failed(commands, asoc, event_type, |
1368 | subtype, chunk, cmd->obj.u32); | 1368 | subtype, chunk, cmd->obj.err); |
1369 | break; | 1369 | break; |
1370 | 1370 | ||
1371 | case SCTP_CMD_INIT_COUNTER_INC: | 1371 | case SCTP_CMD_INIT_COUNTER_INC: |
@@ -1420,7 +1420,7 @@ static int sctp_cmd_interpreter(sctp_event_t event_type, | |||
1420 | 1420 | ||
1421 | case SCTP_CMD_PROCESS_CTSN: | 1421 | case SCTP_CMD_PROCESS_CTSN: |
1422 | /* Dummy up a SACK for processing. */ | 1422 | /* Dummy up a SACK for processing. */ |
1423 | sackh.cum_tsn_ack = cmd->obj.u32; | 1423 | sackh.cum_tsn_ack = cmd->obj.be32; |
1424 | sackh.a_rwnd = 0; | 1424 | sackh.a_rwnd = 0; |
1425 | sackh.num_gap_ack_blocks = 0; | 1425 | sackh.num_gap_ack_blocks = 0; |
1426 | sackh.num_dup_tsns = 0; | 1426 | sackh.num_dup_tsns = 0; |
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c index 1c42fe983a5b..27cc444aaf11 100644 --- a/net/sctp/sm_statefuns.c +++ b/net/sctp/sm_statefuns.c | |||
@@ -93,7 +93,7 @@ static sctp_disposition_t sctp_sf_shut_8_4_5(const struct sctp_endpoint *ep, | |||
93 | static struct sctp_sackhdr *sctp_sm_pull_sack(struct sctp_chunk *chunk); | 93 | static struct sctp_sackhdr *sctp_sm_pull_sack(struct sctp_chunk *chunk); |
94 | 94 | ||
95 | static sctp_disposition_t sctp_stop_t1_and_abort(sctp_cmd_seq_t *commands, | 95 | static sctp_disposition_t sctp_stop_t1_and_abort(sctp_cmd_seq_t *commands, |
96 | __u16 error, int sk_err, | 96 | __be16 error, int sk_err, |
97 | const struct sctp_association *asoc, | 97 | const struct sctp_association *asoc, |
98 | struct sctp_transport *transport); | 98 | struct sctp_transport *transport); |
99 | 99 | ||
@@ -443,7 +443,7 @@ sctp_disposition_t sctp_sf_do_5_1C_ack(const struct sctp_endpoint *ep, | |||
443 | __u32 init_tag; | 443 | __u32 init_tag; |
444 | struct sctp_chunk *err_chunk; | 444 | struct sctp_chunk *err_chunk; |
445 | struct sctp_packet *packet; | 445 | struct sctp_packet *packet; |
446 | __u16 error; | 446 | sctp_error_t error; |
447 | 447 | ||
448 | if (!sctp_vtag_verify(chunk, asoc)) | 448 | if (!sctp_vtag_verify(chunk, asoc)) |
449 | return sctp_sf_pdiscard(ep, asoc, type, arg, commands); | 449 | return sctp_sf_pdiscard(ep, asoc, type, arg, commands); |
@@ -886,7 +886,7 @@ sctp_disposition_t sctp_sf_sendbeat_8_3(const struct sctp_endpoint *ep, | |||
886 | SCTP_ERROR(ETIMEDOUT)); | 886 | SCTP_ERROR(ETIMEDOUT)); |
887 | /* CMD_ASSOC_FAILED calls CMD_DELETE_TCB. */ | 887 | /* CMD_ASSOC_FAILED calls CMD_DELETE_TCB. */ |
888 | sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, | 888 | sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, |
889 | SCTP_U32(SCTP_ERROR_NO_ERROR)); | 889 | SCTP_PERR(SCTP_ERROR_NO_ERROR)); |
890 | SCTP_INC_STATS(SCTP_MIB_ABORTEDS); | 890 | SCTP_INC_STATS(SCTP_MIB_ABORTEDS); |
891 | SCTP_DEC_STATS(SCTP_MIB_CURRESTAB); | 891 | SCTP_DEC_STATS(SCTP_MIB_CURRESTAB); |
892 | return SCTP_DISPOSITION_DELETE_TCB; | 892 | return SCTP_DISPOSITION_DELETE_TCB; |
@@ -2138,7 +2138,7 @@ static sctp_disposition_t sctp_sf_do_5_2_6_stale(const struct sctp_endpoint *ep, | |||
2138 | sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, | 2138 | sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, |
2139 | SCTP_ERROR(ETIMEDOUT)); | 2139 | SCTP_ERROR(ETIMEDOUT)); |
2140 | sctp_add_cmd_sf(commands, SCTP_CMD_INIT_FAILED, | 2140 | sctp_add_cmd_sf(commands, SCTP_CMD_INIT_FAILED, |
2141 | SCTP_U32(SCTP_ERROR_STALE_COOKIE)); | 2141 | SCTP_PERR(SCTP_ERROR_STALE_COOKIE)); |
2142 | return SCTP_DISPOSITION_DELETE_TCB; | 2142 | return SCTP_DISPOSITION_DELETE_TCB; |
2143 | } | 2143 | } |
2144 | 2144 | ||
@@ -2158,7 +2158,7 @@ static sctp_disposition_t sctp_sf_do_5_2_6_stale(const struct sctp_endpoint *ep, | |||
2158 | * to give ample time to retransmit the new cookie and thus | 2158 | * to give ample time to retransmit the new cookie and thus |
2159 | * yield a higher probability of success on the reattempt. | 2159 | * yield a higher probability of success on the reattempt. |
2160 | */ | 2160 | */ |
2161 | stale = ntohl(*(suseconds_t *)((u8 *)err + sizeof(sctp_errhdr_t))); | 2161 | stale = ntohl(*(__be32 *)((u8 *)err + sizeof(sctp_errhdr_t))); |
2162 | stale = (stale * 2) / 1000; | 2162 | stale = (stale * 2) / 1000; |
2163 | 2163 | ||
2164 | bht.param_hdr.type = SCTP_PARAM_COOKIE_PRESERVATIVE; | 2164 | bht.param_hdr.type = SCTP_PARAM_COOKIE_PRESERVATIVE; |
@@ -2250,7 +2250,7 @@ sctp_disposition_t sctp_sf_do_9_1_abort(const struct sctp_endpoint *ep, | |||
2250 | { | 2250 | { |
2251 | struct sctp_chunk *chunk = arg; | 2251 | struct sctp_chunk *chunk = arg; |
2252 | unsigned len; | 2252 | unsigned len; |
2253 | __u16 error = SCTP_ERROR_NO_ERROR; | 2253 | __be16 error = SCTP_ERROR_NO_ERROR; |
2254 | 2254 | ||
2255 | if (!sctp_vtag_verify_either(chunk, asoc)) | 2255 | if (!sctp_vtag_verify_either(chunk, asoc)) |
2256 | return sctp_sf_pdiscard(ep, asoc, type, arg, commands); | 2256 | return sctp_sf_pdiscard(ep, asoc, type, arg, commands); |
@@ -2275,7 +2275,7 @@ sctp_disposition_t sctp_sf_do_9_1_abort(const struct sctp_endpoint *ep, | |||
2275 | 2275 | ||
2276 | sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, SCTP_ERROR(ECONNRESET)); | 2276 | sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, SCTP_ERROR(ECONNRESET)); |
2277 | /* ASSOC_FAILED will DELETE_TCB. */ | 2277 | /* ASSOC_FAILED will DELETE_TCB. */ |
2278 | sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, SCTP_U32(error)); | 2278 | sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, SCTP_PERR(error)); |
2279 | SCTP_INC_STATS(SCTP_MIB_ABORTEDS); | 2279 | SCTP_INC_STATS(SCTP_MIB_ABORTEDS); |
2280 | SCTP_DEC_STATS(SCTP_MIB_CURRESTAB); | 2280 | SCTP_DEC_STATS(SCTP_MIB_CURRESTAB); |
2281 | 2281 | ||
@@ -2295,7 +2295,7 @@ sctp_disposition_t sctp_sf_cookie_wait_abort(const struct sctp_endpoint *ep, | |||
2295 | { | 2295 | { |
2296 | struct sctp_chunk *chunk = arg; | 2296 | struct sctp_chunk *chunk = arg; |
2297 | unsigned len; | 2297 | unsigned len; |
2298 | __u16 error = SCTP_ERROR_NO_ERROR; | 2298 | __be16 error = SCTP_ERROR_NO_ERROR; |
2299 | 2299 | ||
2300 | if (!sctp_vtag_verify_either(chunk, asoc)) | 2300 | if (!sctp_vtag_verify_either(chunk, asoc)) |
2301 | return sctp_sf_pdiscard(ep, asoc, type, arg, commands); | 2301 | return sctp_sf_pdiscard(ep, asoc, type, arg, commands); |
@@ -2357,7 +2357,7 @@ sctp_disposition_t sctp_sf_cookie_echoed_abort(const struct sctp_endpoint *ep, | |||
2357 | * This is common code called by several sctp_sf_*_abort() functions above. | 2357 | * This is common code called by several sctp_sf_*_abort() functions above. |
2358 | */ | 2358 | */ |
2359 | static sctp_disposition_t sctp_stop_t1_and_abort(sctp_cmd_seq_t *commands, | 2359 | static sctp_disposition_t sctp_stop_t1_and_abort(sctp_cmd_seq_t *commands, |
2360 | __u16 error, int sk_err, | 2360 | __be16 error, int sk_err, |
2361 | const struct sctp_association *asoc, | 2361 | const struct sctp_association *asoc, |
2362 | struct sctp_transport *transport) | 2362 | struct sctp_transport *transport) |
2363 | { | 2363 | { |
@@ -2370,7 +2370,7 @@ static sctp_disposition_t sctp_stop_t1_and_abort(sctp_cmd_seq_t *commands, | |||
2370 | sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, SCTP_ERROR(sk_err)); | 2370 | sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, SCTP_ERROR(sk_err)); |
2371 | /* CMD_INIT_FAILED will DELETE_TCB. */ | 2371 | /* CMD_INIT_FAILED will DELETE_TCB. */ |
2372 | sctp_add_cmd_sf(commands, SCTP_CMD_INIT_FAILED, | 2372 | sctp_add_cmd_sf(commands, SCTP_CMD_INIT_FAILED, |
2373 | SCTP_U32(error)); | 2373 | SCTP_PERR(error)); |
2374 | return SCTP_DISPOSITION_ABORT; | 2374 | return SCTP_DISPOSITION_ABORT; |
2375 | } | 2375 | } |
2376 | 2376 | ||
@@ -2466,7 +2466,7 @@ sctp_disposition_t sctp_sf_do_9_2_shutdown(const struct sctp_endpoint *ep, | |||
2466 | * received by the SHUTDOWN sender. | 2466 | * received by the SHUTDOWN sender. |
2467 | */ | 2467 | */ |
2468 | sctp_add_cmd_sf(commands, SCTP_CMD_PROCESS_CTSN, | 2468 | sctp_add_cmd_sf(commands, SCTP_CMD_PROCESS_CTSN, |
2469 | SCTP_U32(chunk->subh.shutdown_hdr->cum_tsn_ack)); | 2469 | SCTP_BE32(chunk->subh.shutdown_hdr->cum_tsn_ack)); |
2470 | 2470 | ||
2471 | out: | 2471 | out: |
2472 | return disposition; | 2472 | return disposition; |
@@ -2545,6 +2545,7 @@ sctp_disposition_t sctp_sf_do_ecn_cwr(const struct sctp_endpoint *ep, | |||
2545 | { | 2545 | { |
2546 | sctp_cwrhdr_t *cwr; | 2546 | sctp_cwrhdr_t *cwr; |
2547 | struct sctp_chunk *chunk = arg; | 2547 | struct sctp_chunk *chunk = arg; |
2548 | u32 lowest_tsn; | ||
2548 | 2549 | ||
2549 | if (!sctp_vtag_verify(chunk, asoc)) | 2550 | if (!sctp_vtag_verify(chunk, asoc)) |
2550 | return sctp_sf_pdiscard(ep, asoc, type, arg, commands); | 2551 | return sctp_sf_pdiscard(ep, asoc, type, arg, commands); |
@@ -2556,14 +2557,14 @@ sctp_disposition_t sctp_sf_do_ecn_cwr(const struct sctp_endpoint *ep, | |||
2556 | cwr = (sctp_cwrhdr_t *) chunk->skb->data; | 2557 | cwr = (sctp_cwrhdr_t *) chunk->skb->data; |
2557 | skb_pull(chunk->skb, sizeof(sctp_cwrhdr_t)); | 2558 | skb_pull(chunk->skb, sizeof(sctp_cwrhdr_t)); |
2558 | 2559 | ||
2559 | cwr->lowest_tsn = ntohl(cwr->lowest_tsn); | 2560 | lowest_tsn = ntohl(cwr->lowest_tsn); |
2560 | 2561 | ||
2561 | /* Does this CWR ack the last sent congestion notification? */ | 2562 | /* Does this CWR ack the last sent congestion notification? */ |
2562 | if (TSN_lte(asoc->last_ecne_tsn, cwr->lowest_tsn)) { | 2563 | if (TSN_lte(asoc->last_ecne_tsn, lowest_tsn)) { |
2563 | /* Stop sending ECNE. */ | 2564 | /* Stop sending ECNE. */ |
2564 | sctp_add_cmd_sf(commands, | 2565 | sctp_add_cmd_sf(commands, |
2565 | SCTP_CMD_ECN_CWR, | 2566 | SCTP_CMD_ECN_CWR, |
2566 | SCTP_U32(cwr->lowest_tsn)); | 2567 | SCTP_U32(lowest_tsn)); |
2567 | } | 2568 | } |
2568 | return SCTP_DISPOSITION_CONSUME; | 2569 | return SCTP_DISPOSITION_CONSUME; |
2569 | } | 2570 | } |
@@ -3360,7 +3361,7 @@ sctp_disposition_t sctp_sf_do_asconf_ack(const struct sctp_endpoint *ep, | |||
3360 | sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, | 3361 | sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, |
3361 | SCTP_ERROR(ECONNABORTED)); | 3362 | SCTP_ERROR(ECONNABORTED)); |
3362 | sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, | 3363 | sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, |
3363 | SCTP_U32(SCTP_ERROR_ASCONF_ACK)); | 3364 | SCTP_PERR(SCTP_ERROR_ASCONF_ACK)); |
3364 | SCTP_INC_STATS(SCTP_MIB_ABORTEDS); | 3365 | SCTP_INC_STATS(SCTP_MIB_ABORTEDS); |
3365 | SCTP_DEC_STATS(SCTP_MIB_CURRESTAB); | 3366 | SCTP_DEC_STATS(SCTP_MIB_CURRESTAB); |
3366 | return SCTP_DISPOSITION_ABORT; | 3367 | return SCTP_DISPOSITION_ABORT; |
@@ -3388,7 +3389,7 @@ sctp_disposition_t sctp_sf_do_asconf_ack(const struct sctp_endpoint *ep, | |||
3388 | sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, | 3389 | sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, |
3389 | SCTP_ERROR(ECONNABORTED)); | 3390 | SCTP_ERROR(ECONNABORTED)); |
3390 | sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, | 3391 | sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, |
3391 | SCTP_U32(SCTP_ERROR_ASCONF_ACK)); | 3392 | SCTP_PERR(SCTP_ERROR_ASCONF_ACK)); |
3392 | SCTP_INC_STATS(SCTP_MIB_ABORTEDS); | 3393 | SCTP_INC_STATS(SCTP_MIB_ABORTEDS); |
3393 | SCTP_DEC_STATS(SCTP_MIB_CURRESTAB); | 3394 | SCTP_DEC_STATS(SCTP_MIB_CURRESTAB); |
3394 | return SCTP_DISPOSITION_ABORT; | 3395 | return SCTP_DISPOSITION_ABORT; |
@@ -3743,12 +3744,12 @@ static sctp_disposition_t sctp_sf_violation_chunklen( | |||
3743 | sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, | 3744 | sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, |
3744 | SCTP_ERROR(ECONNREFUSED)); | 3745 | SCTP_ERROR(ECONNREFUSED)); |
3745 | sctp_add_cmd_sf(commands, SCTP_CMD_INIT_FAILED, | 3746 | sctp_add_cmd_sf(commands, SCTP_CMD_INIT_FAILED, |
3746 | SCTP_U32(SCTP_ERROR_PROTO_VIOLATION)); | 3747 | SCTP_PERR(SCTP_ERROR_PROTO_VIOLATION)); |
3747 | } else { | 3748 | } else { |
3748 | sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, | 3749 | sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, |
3749 | SCTP_ERROR(ECONNABORTED)); | 3750 | SCTP_ERROR(ECONNABORTED)); |
3750 | sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, | 3751 | sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, |
3751 | SCTP_U32(SCTP_ERROR_PROTO_VIOLATION)); | 3752 | SCTP_PERR(SCTP_ERROR_PROTO_VIOLATION)); |
3752 | SCTP_DEC_STATS(SCTP_MIB_CURRESTAB); | 3753 | SCTP_DEC_STATS(SCTP_MIB_CURRESTAB); |
3753 | } | 3754 | } |
3754 | 3755 | ||
@@ -4062,7 +4063,7 @@ sctp_disposition_t sctp_sf_do_9_1_prm_abort( | |||
4062 | SCTP_ERROR(ECONNABORTED)); | 4063 | SCTP_ERROR(ECONNABORTED)); |
4063 | /* Delete the established association. */ | 4064 | /* Delete the established association. */ |
4064 | sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, | 4065 | sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, |
4065 | SCTP_U32(SCTP_ERROR_USER_ABORT)); | 4066 | SCTP_PERR(SCTP_ERROR_USER_ABORT)); |
4066 | 4067 | ||
4067 | SCTP_INC_STATS(SCTP_MIB_ABORTEDS); | 4068 | SCTP_INC_STATS(SCTP_MIB_ABORTEDS); |
4068 | SCTP_DEC_STATS(SCTP_MIB_CURRESTAB); | 4069 | SCTP_DEC_STATS(SCTP_MIB_CURRESTAB); |
@@ -4199,7 +4200,7 @@ sctp_disposition_t sctp_sf_cookie_wait_prm_abort( | |||
4199 | SCTP_ERROR(ECONNREFUSED)); | 4200 | SCTP_ERROR(ECONNREFUSED)); |
4200 | /* Delete the established association. */ | 4201 | /* Delete the established association. */ |
4201 | sctp_add_cmd_sf(commands, SCTP_CMD_INIT_FAILED, | 4202 | sctp_add_cmd_sf(commands, SCTP_CMD_INIT_FAILED, |
4202 | SCTP_U32(SCTP_ERROR_USER_ABORT)); | 4203 | SCTP_PERR(SCTP_ERROR_USER_ABORT)); |
4203 | 4204 | ||
4204 | return retval; | 4205 | return retval; |
4205 | } | 4206 | } |
@@ -4571,7 +4572,7 @@ sctp_disposition_t sctp_sf_do_6_3_3_rtx(const struct sctp_endpoint *ep, | |||
4571 | SCTP_ERROR(ETIMEDOUT)); | 4572 | SCTP_ERROR(ETIMEDOUT)); |
4572 | /* CMD_ASSOC_FAILED calls CMD_DELETE_TCB. */ | 4573 | /* CMD_ASSOC_FAILED calls CMD_DELETE_TCB. */ |
4573 | sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, | 4574 | sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, |
4574 | SCTP_U32(SCTP_ERROR_NO_ERROR)); | 4575 | SCTP_PERR(SCTP_ERROR_NO_ERROR)); |
4575 | SCTP_INC_STATS(SCTP_MIB_ABORTEDS); | 4576 | SCTP_INC_STATS(SCTP_MIB_ABORTEDS); |
4576 | SCTP_DEC_STATS(SCTP_MIB_CURRESTAB); | 4577 | SCTP_DEC_STATS(SCTP_MIB_CURRESTAB); |
4577 | return SCTP_DISPOSITION_DELETE_TCB; | 4578 | return SCTP_DISPOSITION_DELETE_TCB; |
@@ -4693,7 +4694,7 @@ sctp_disposition_t sctp_sf_t1_init_timer_expire(const struct sctp_endpoint *ep, | |||
4693 | sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, | 4694 | sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, |
4694 | SCTP_ERROR(ETIMEDOUT)); | 4695 | SCTP_ERROR(ETIMEDOUT)); |
4695 | sctp_add_cmd_sf(commands, SCTP_CMD_INIT_FAILED, | 4696 | sctp_add_cmd_sf(commands, SCTP_CMD_INIT_FAILED, |
4696 | SCTP_U32(SCTP_ERROR_NO_ERROR)); | 4697 | SCTP_PERR(SCTP_ERROR_NO_ERROR)); |
4697 | return SCTP_DISPOSITION_DELETE_TCB; | 4698 | return SCTP_DISPOSITION_DELETE_TCB; |
4698 | } | 4699 | } |
4699 | 4700 | ||
@@ -4745,7 +4746,7 @@ sctp_disposition_t sctp_sf_t1_cookie_timer_expire(const struct sctp_endpoint *ep | |||
4745 | sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, | 4746 | sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, |
4746 | SCTP_ERROR(ETIMEDOUT)); | 4747 | SCTP_ERROR(ETIMEDOUT)); |
4747 | sctp_add_cmd_sf(commands, SCTP_CMD_INIT_FAILED, | 4748 | sctp_add_cmd_sf(commands, SCTP_CMD_INIT_FAILED, |
4748 | SCTP_U32(SCTP_ERROR_NO_ERROR)); | 4749 | SCTP_PERR(SCTP_ERROR_NO_ERROR)); |
4749 | return SCTP_DISPOSITION_DELETE_TCB; | 4750 | return SCTP_DISPOSITION_DELETE_TCB; |
4750 | } | 4751 | } |
4751 | 4752 | ||
@@ -4781,7 +4782,7 @@ sctp_disposition_t sctp_sf_t2_timer_expire(const struct sctp_endpoint *ep, | |||
4781 | SCTP_ERROR(ETIMEDOUT)); | 4782 | SCTP_ERROR(ETIMEDOUT)); |
4782 | /* Note: CMD_ASSOC_FAILED calls CMD_DELETE_TCB. */ | 4783 | /* Note: CMD_ASSOC_FAILED calls CMD_DELETE_TCB. */ |
4783 | sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, | 4784 | sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, |
4784 | SCTP_U32(SCTP_ERROR_NO_ERROR)); | 4785 | SCTP_PERR(SCTP_ERROR_NO_ERROR)); |
4785 | SCTP_INC_STATS(SCTP_MIB_ABORTEDS); | 4786 | SCTP_INC_STATS(SCTP_MIB_ABORTEDS); |
4786 | SCTP_DEC_STATS(SCTP_MIB_CURRESTAB); | 4787 | SCTP_DEC_STATS(SCTP_MIB_CURRESTAB); |
4787 | return SCTP_DISPOSITION_DELETE_TCB; | 4788 | return SCTP_DISPOSITION_DELETE_TCB; |
@@ -4859,7 +4860,7 @@ sctp_disposition_t sctp_sf_t4_timer_expire( | |||
4859 | sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, | 4860 | sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, |
4860 | SCTP_ERROR(ETIMEDOUT)); | 4861 | SCTP_ERROR(ETIMEDOUT)); |
4861 | sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, | 4862 | sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, |
4862 | SCTP_U32(SCTP_ERROR_NO_ERROR)); | 4863 | SCTP_PERR(SCTP_ERROR_NO_ERROR)); |
4863 | SCTP_INC_STATS(SCTP_MIB_ABORTEDS); | 4864 | SCTP_INC_STATS(SCTP_MIB_ABORTEDS); |
4864 | SCTP_INC_STATS(SCTP_MIB_CURRESTAB); | 4865 | SCTP_INC_STATS(SCTP_MIB_CURRESTAB); |
4865 | return SCTP_DISPOSITION_ABORT; | 4866 | return SCTP_DISPOSITION_ABORT; |
@@ -4915,7 +4916,7 @@ sctp_disposition_t sctp_sf_t5_timer_expire(const struct sctp_endpoint *ep, | |||
4915 | sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, | 4916 | sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, |
4916 | SCTP_ERROR(ETIMEDOUT)); | 4917 | SCTP_ERROR(ETIMEDOUT)); |
4917 | sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, | 4918 | sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, |
4918 | SCTP_U32(SCTP_ERROR_NO_ERROR)); | 4919 | SCTP_PERR(SCTP_ERROR_NO_ERROR)); |
4919 | 4920 | ||
4920 | return SCTP_DISPOSITION_DELETE_TCB; | 4921 | return SCTP_DISPOSITION_DELETE_TCB; |
4921 | nomem: | 4922 | nomem: |
@@ -5365,7 +5366,7 @@ static int sctp_eat_data(const struct sctp_association *asoc, | |||
5365 | sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, | 5366 | sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, |
5366 | SCTP_ERROR(ECONNABORTED)); | 5367 | SCTP_ERROR(ECONNABORTED)); |
5367 | sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, | 5368 | sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, |
5368 | SCTP_U32(SCTP_ERROR_NO_DATA)); | 5369 | SCTP_PERR(SCTP_ERROR_NO_DATA)); |
5369 | SCTP_INC_STATS(SCTP_MIB_ABORTEDS); | 5370 | SCTP_INC_STATS(SCTP_MIB_ABORTEDS); |
5370 | SCTP_DEC_STATS(SCTP_MIB_CURRESTAB); | 5371 | SCTP_DEC_STATS(SCTP_MIB_CURRESTAB); |
5371 | return SCTP_IERROR_NO_DATA; | 5372 | return SCTP_IERROR_NO_DATA; |
diff --git a/net/sctp/sm_statetable.c b/net/sctp/sm_statetable.c index 8bcca5676151..733dd87b3a7d 100644 --- a/net/sctp/sm_statetable.c +++ b/net/sctp/sm_statetable.c | |||
@@ -104,325 +104,322 @@ const sctp_sm_table_entry_t *sctp_sm_lookup_event(sctp_event_t event_type, | |||
104 | }; | 104 | }; |
105 | } | 105 | } |
106 | 106 | ||
107 | #define TYPE_SCTP_FUNC(func) {.fn = func, .name = #func} | ||
108 | |||
107 | #define TYPE_SCTP_DATA { \ | 109 | #define TYPE_SCTP_DATA { \ |
108 | /* SCTP_STATE_EMPTY */ \ | 110 | /* SCTP_STATE_EMPTY */ \ |
109 | {.fn = sctp_sf_ootb, .name = "sctp_sf_ootb"}, \ | 111 | TYPE_SCTP_FUNC(sctp_sf_ootb), \ |
110 | /* SCTP_STATE_CLOSED */ \ | 112 | /* SCTP_STATE_CLOSED */ \ |
111 | {.fn = sctp_sf_tabort_8_4_8, .name = "sctp_sf_tabort_8_4_8"}, \ | 113 | TYPE_SCTP_FUNC(sctp_sf_tabort_8_4_8), \ |
112 | /* SCTP_STATE_COOKIE_WAIT */ \ | 114 | /* SCTP_STATE_COOKIE_WAIT */ \ |
113 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 115 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
114 | /* SCTP_STATE_COOKIE_ECHOED */ \ | 116 | /* SCTP_STATE_COOKIE_ECHOED */ \ |
115 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 117 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
116 | /* SCTP_STATE_ESTABLISHED */ \ | 118 | /* SCTP_STATE_ESTABLISHED */ \ |
117 | {.fn = sctp_sf_eat_data_6_2, .name = "sctp_sf_eat_data_6_2"}, \ | 119 | TYPE_SCTP_FUNC(sctp_sf_eat_data_6_2), \ |
118 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ | 120 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ |
119 | {.fn = sctp_sf_eat_data_6_2, .name = "sctp_sf_eat_data_6_2"}, \ | 121 | TYPE_SCTP_FUNC(sctp_sf_eat_data_6_2), \ |
120 | /* SCTP_STATE_SHUTDOWN_SENT */ \ | 122 | /* SCTP_STATE_SHUTDOWN_SENT */ \ |
121 | {.fn = sctp_sf_eat_data_fast_4_4, .name = "sctp_sf_eat_data_fast_4_4"}, \ | 123 | TYPE_SCTP_FUNC(sctp_sf_eat_data_fast_4_4), \ |
122 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ | 124 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ |
123 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 125 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
124 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ | 126 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ |
125 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 127 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
126 | } /* TYPE_SCTP_DATA */ | 128 | } /* TYPE_SCTP_DATA */ |
127 | 129 | ||
128 | #define TYPE_SCTP_INIT { \ | 130 | #define TYPE_SCTP_INIT { \ |
129 | /* SCTP_STATE_EMPTY */ \ | 131 | /* SCTP_STATE_EMPTY */ \ |
130 | {.fn = sctp_sf_bug, .name = "sctp_sf_bug"}, \ | 132 | TYPE_SCTP_FUNC(sctp_sf_bug), \ |
131 | /* SCTP_STATE_CLOSED */ \ | 133 | /* SCTP_STATE_CLOSED */ \ |
132 | {.fn = sctp_sf_do_5_1B_init, .name = "sctp_sf_do_5_1B_init"}, \ | 134 | TYPE_SCTP_FUNC(sctp_sf_do_5_1B_init), \ |
133 | /* SCTP_STATE_COOKIE_WAIT */ \ | 135 | /* SCTP_STATE_COOKIE_WAIT */ \ |
134 | {.fn = sctp_sf_do_5_2_1_siminit, .name = "sctp_sf_do_5_2_1_siminit"}, \ | 136 | TYPE_SCTP_FUNC(sctp_sf_do_5_2_1_siminit), \ |
135 | /* SCTP_STATE_COOKIE_ECHOED */ \ | 137 | /* SCTP_STATE_COOKIE_ECHOED */ \ |
136 | {.fn = sctp_sf_do_5_2_1_siminit, .name = "sctp_sf_do_5_2_1_siminit"}, \ | 138 | TYPE_SCTP_FUNC(sctp_sf_do_5_2_1_siminit), \ |
137 | /* SCTP_STATE_ESTABLISHED */ \ | 139 | /* SCTP_STATE_ESTABLISHED */ \ |
138 | {.fn = sctp_sf_do_5_2_2_dupinit, .name = "sctp_sf_do_5_2_2_dupinit"}, \ | 140 | TYPE_SCTP_FUNC(sctp_sf_do_5_2_2_dupinit), \ |
139 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ | 141 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ |
140 | {.fn = sctp_sf_do_5_2_2_dupinit, .name = "sctp_sf_do_5_2_2_dupinit"}, \ | 142 | TYPE_SCTP_FUNC(sctp_sf_do_5_2_2_dupinit), \ |
141 | /* SCTP_STATE_SHUTDOWN_SENT */ \ | 143 | /* SCTP_STATE_SHUTDOWN_SENT */ \ |
142 | {.fn = sctp_sf_do_5_2_2_dupinit, .name = "sctp_sf_do_5_2_2_dupinit"}, \ | 144 | TYPE_SCTP_FUNC(sctp_sf_do_5_2_2_dupinit), \ |
143 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ | 145 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ |
144 | {.fn = sctp_sf_do_5_2_2_dupinit, .name = "sctp_sf_do_5_2_2_dupinit"}, \ | 146 | TYPE_SCTP_FUNC(sctp_sf_do_5_2_2_dupinit), \ |
145 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ | 147 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ |
146 | {.fn = sctp_sf_do_9_2_reshutack, .name = "sctp_sf_do_9_2_reshutack"}, \ | 148 | TYPE_SCTP_FUNC(sctp_sf_do_9_2_reshutack), \ |
147 | } /* TYPE_SCTP_INIT */ | 149 | } /* TYPE_SCTP_INIT */ |
148 | 150 | ||
149 | #define TYPE_SCTP_INIT_ACK { \ | 151 | #define TYPE_SCTP_INIT_ACK { \ |
150 | /* SCTP_STATE_EMPTY */ \ | 152 | /* SCTP_STATE_EMPTY */ \ |
151 | {.fn = sctp_sf_ootb, .name = "sctp_sf_ootb"}, \ | 153 | TYPE_SCTP_FUNC(sctp_sf_ootb), \ |
152 | /* SCTP_STATE_CLOSED */ \ | 154 | /* SCTP_STATE_CLOSED */ \ |
153 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 155 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
154 | /* SCTP_STATE_COOKIE_WAIT */ \ | 156 | /* SCTP_STATE_COOKIE_WAIT */ \ |
155 | {.fn = sctp_sf_do_5_1C_ack, .name = "sctp_sf_do_5_1C_ack"}, \ | 157 | TYPE_SCTP_FUNC(sctp_sf_do_5_1C_ack), \ |
156 | /* SCTP_STATE_COOKIE_ECHOED */ \ | 158 | /* SCTP_STATE_COOKIE_ECHOED */ \ |
157 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 159 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
158 | /* SCTP_STATE_ESTABLISHED */ \ | 160 | /* SCTP_STATE_ESTABLISHED */ \ |
159 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 161 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
160 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ | 162 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ |
161 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 163 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
162 | /* SCTP_STATE_SHUTDOWN_SENT */ \ | 164 | /* SCTP_STATE_SHUTDOWN_SENT */ \ |
163 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 165 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
164 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ | 166 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ |
165 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 167 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
166 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ | 168 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ |
167 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 169 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
168 | } /* TYPE_SCTP_INIT_ACK */ | 170 | } /* TYPE_SCTP_INIT_ACK */ |
169 | 171 | ||
170 | #define TYPE_SCTP_SACK { \ | 172 | #define TYPE_SCTP_SACK { \ |
171 | /* SCTP_STATE_EMPTY */ \ | 173 | /* SCTP_STATE_EMPTY */ \ |
172 | {.fn = sctp_sf_ootb, .name = "sctp_sf_ootb"}, \ | 174 | TYPE_SCTP_FUNC(sctp_sf_ootb), \ |
173 | /* SCTP_STATE_CLOSED */ \ | 175 | /* SCTP_STATE_CLOSED */ \ |
174 | {.fn = sctp_sf_tabort_8_4_8, .name = "sctp_sf_tabort_8_4_8"}, \ | 176 | TYPE_SCTP_FUNC(sctp_sf_tabort_8_4_8), \ |
175 | /* SCTP_STATE_COOKIE_WAIT */ \ | 177 | /* SCTP_STATE_COOKIE_WAIT */ \ |
176 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 178 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
177 | /* SCTP_STATE_COOKIE_ECHOED */ \ | 179 | /* SCTP_STATE_COOKIE_ECHOED */ \ |
178 | {.fn = sctp_sf_eat_sack_6_2, .name = "sctp_sf_eat_sack_6_2"}, \ | 180 | TYPE_SCTP_FUNC(sctp_sf_eat_sack_6_2), \ |
179 | /* SCTP_STATE_ESTABLISHED */ \ | 181 | /* SCTP_STATE_ESTABLISHED */ \ |
180 | {.fn = sctp_sf_eat_sack_6_2, .name = "sctp_sf_eat_sack_6_2"}, \ | 182 | TYPE_SCTP_FUNC(sctp_sf_eat_sack_6_2), \ |
181 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ | 183 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ |
182 | {.fn = sctp_sf_eat_sack_6_2, .name = "sctp_sf_eat_sack_6_2"}, \ | 184 | TYPE_SCTP_FUNC(sctp_sf_eat_sack_6_2), \ |
183 | /* SCTP_STATE_SHUTDOWN_SENT */ \ | 185 | /* SCTP_STATE_SHUTDOWN_SENT */ \ |
184 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 186 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
185 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ | 187 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ |
186 | {.fn = sctp_sf_eat_sack_6_2, .name = "sctp_sf_eat_sack_6_2"}, \ | 188 | TYPE_SCTP_FUNC(sctp_sf_eat_sack_6_2), \ |
187 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ | 189 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ |
188 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 190 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
189 | } /* TYPE_SCTP_SACK */ | 191 | } /* TYPE_SCTP_SACK */ |
190 | 192 | ||
191 | #define TYPE_SCTP_HEARTBEAT { \ | 193 | #define TYPE_SCTP_HEARTBEAT { \ |
192 | /* SCTP_STATE_EMPTY */ \ | 194 | /* SCTP_STATE_EMPTY */ \ |
193 | {.fn = sctp_sf_ootb, .name = "sctp_sf_ootb"}, \ | 195 | TYPE_SCTP_FUNC(sctp_sf_ootb), \ |
194 | /* SCTP_STATE_CLOSED */ \ | 196 | /* SCTP_STATE_CLOSED */ \ |
195 | {.fn = sctp_sf_tabort_8_4_8, .name = "sctp_sf_tabort_8_4_8"}, \ | 197 | TYPE_SCTP_FUNC(sctp_sf_tabort_8_4_8), \ |
196 | /* SCTP_STATE_COOKIE_WAIT */ \ | 198 | /* SCTP_STATE_COOKIE_WAIT */ \ |
197 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 199 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
198 | /* SCTP_STATE_COOKIE_ECHOED */ \ | 200 | /* SCTP_STATE_COOKIE_ECHOED */ \ |
199 | {.fn = sctp_sf_beat_8_3, .name = "sctp_sf_beat_8_3"}, \ | 201 | TYPE_SCTP_FUNC(sctp_sf_beat_8_3), \ |
200 | /* SCTP_STATE_ESTABLISHED */ \ | 202 | /* SCTP_STATE_ESTABLISHED */ \ |
201 | {.fn = sctp_sf_beat_8_3, .name = "sctp_sf_beat_8_3"}, \ | 203 | TYPE_SCTP_FUNC(sctp_sf_beat_8_3), \ |
202 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ | 204 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ |
203 | {.fn = sctp_sf_beat_8_3, .name = "sctp_sf_beat_8_3"}, \ | 205 | TYPE_SCTP_FUNC(sctp_sf_beat_8_3), \ |
204 | /* SCTP_STATE_SHUTDOWN_SENT */ \ | 206 | /* SCTP_STATE_SHUTDOWN_SENT */ \ |
205 | {.fn = sctp_sf_beat_8_3, .name = "sctp_sf_beat_8_3"}, \ | 207 | TYPE_SCTP_FUNC(sctp_sf_beat_8_3), \ |
206 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ | 208 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ |
207 | {.fn = sctp_sf_beat_8_3, .name = "sctp_sf_beat_8_3"}, \ | 209 | TYPE_SCTP_FUNC(sctp_sf_beat_8_3), \ |
208 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ | 210 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ |
209 | /* This should not happen, but we are nice. */ \ | 211 | /* This should not happen, but we are nice. */ \ |
210 | {.fn = sctp_sf_beat_8_3, .name = "sctp_sf_beat_8_3"}, \ | 212 | TYPE_SCTP_FUNC(sctp_sf_beat_8_3), \ |
211 | } /* TYPE_SCTP_HEARTBEAT */ | 213 | } /* TYPE_SCTP_HEARTBEAT */ |
212 | 214 | ||
213 | #define TYPE_SCTP_HEARTBEAT_ACK { \ | 215 | #define TYPE_SCTP_HEARTBEAT_ACK { \ |
214 | /* SCTP_STATE_EMPTY */ \ | 216 | /* SCTP_STATE_EMPTY */ \ |
215 | {.fn = sctp_sf_ootb, .name = "sctp_sf_ootb"}, \ | 217 | TYPE_SCTP_FUNC(sctp_sf_ootb), \ |
216 | /* SCTP_STATE_CLOSED */ \ | 218 | /* SCTP_STATE_CLOSED */ \ |
217 | {.fn = sctp_sf_tabort_8_4_8, .name = "sctp_sf_tabort_8_4_8"}, \ | 219 | TYPE_SCTP_FUNC(sctp_sf_tabort_8_4_8), \ |
218 | /* SCTP_STATE_COOKIE_WAIT */ \ | 220 | /* SCTP_STATE_COOKIE_WAIT */ \ |
219 | {.fn = sctp_sf_violation, .name = "sctp_sf_violation"}, \ | 221 | TYPE_SCTP_FUNC(sctp_sf_violation), \ |
220 | /* SCTP_STATE_COOKIE_ECHOED */ \ | 222 | /* SCTP_STATE_COOKIE_ECHOED */ \ |
221 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 223 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
222 | /* SCTP_STATE_ESTABLISHED */ \ | 224 | /* SCTP_STATE_ESTABLISHED */ \ |
223 | {.fn = sctp_sf_backbeat_8_3, .name = "sctp_sf_backbeat_8_3"}, \ | 225 | TYPE_SCTP_FUNC(sctp_sf_backbeat_8_3), \ |
224 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ | 226 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ |
225 | {.fn = sctp_sf_backbeat_8_3, .name = "sctp_sf_backbeat_8_3"}, \ | 227 | TYPE_SCTP_FUNC(sctp_sf_backbeat_8_3), \ |
226 | /* SCTP_STATE_SHUTDOWN_SENT */ \ | 228 | /* SCTP_STATE_SHUTDOWN_SENT */ \ |
227 | {.fn = sctp_sf_backbeat_8_3, .name = "sctp_sf_backbeat_8_3"}, \ | 229 | TYPE_SCTP_FUNC(sctp_sf_backbeat_8_3), \ |
228 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ | 230 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ |
229 | {.fn = sctp_sf_backbeat_8_3, .name = "sctp_sf_backbeat_8_3"}, \ | 231 | TYPE_SCTP_FUNC(sctp_sf_backbeat_8_3), \ |
230 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ | 232 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ |
231 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 233 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
232 | } /* TYPE_SCTP_HEARTBEAT_ACK */ | 234 | } /* TYPE_SCTP_HEARTBEAT_ACK */ |
233 | 235 | ||
234 | #define TYPE_SCTP_ABORT { \ | 236 | #define TYPE_SCTP_ABORT { \ |
235 | /* SCTP_STATE_EMPTY */ \ | 237 | /* SCTP_STATE_EMPTY */ \ |
236 | {.fn = sctp_sf_ootb, .name = "sctp_sf_ootb"}, \ | 238 | TYPE_SCTP_FUNC(sctp_sf_ootb), \ |
237 | /* SCTP_STATE_CLOSED */ \ | 239 | /* SCTP_STATE_CLOSED */ \ |
238 | {.fn = sctp_sf_pdiscard, .name = "sctp_sf_pdiscard"}, \ | 240 | TYPE_SCTP_FUNC(sctp_sf_pdiscard), \ |
239 | /* SCTP_STATE_COOKIE_WAIT */ \ | 241 | /* SCTP_STATE_COOKIE_WAIT */ \ |
240 | {.fn = sctp_sf_cookie_wait_abort, .name = "sctp_sf_cookie_wait_abort"}, \ | 242 | TYPE_SCTP_FUNC(sctp_sf_cookie_wait_abort), \ |
241 | /* SCTP_STATE_COOKIE_ECHOED */ \ | 243 | /* SCTP_STATE_COOKIE_ECHOED */ \ |
242 | {.fn = sctp_sf_cookie_echoed_abort, \ | 244 | TYPE_SCTP_FUNC(sctp_sf_cookie_echoed_abort), \ |
243 | .name = "sctp_sf_cookie_echoed_abort"}, \ | ||
244 | /* SCTP_STATE_ESTABLISHED */ \ | 245 | /* SCTP_STATE_ESTABLISHED */ \ |
245 | {.fn = sctp_sf_do_9_1_abort, .name = "sctp_sf_do_9_1_abort"}, \ | 246 | TYPE_SCTP_FUNC(sctp_sf_do_9_1_abort), \ |
246 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ | 247 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ |
247 | {.fn = sctp_sf_shutdown_pending_abort, \ | 248 | TYPE_SCTP_FUNC(sctp_sf_shutdown_pending_abort), \ |
248 | .name = "sctp_sf_shutdown_pending_abort"}, \ | ||
249 | /* SCTP_STATE_SHUTDOWN_SENT */ \ | 249 | /* SCTP_STATE_SHUTDOWN_SENT */ \ |
250 | {.fn = sctp_sf_shutdown_sent_abort, \ | 250 | TYPE_SCTP_FUNC(sctp_sf_shutdown_sent_abort), \ |
251 | .name = "sctp_sf_shutdown_sent_abort"}, \ | ||
252 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ | 251 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ |
253 | {.fn = sctp_sf_do_9_1_abort, .name = "sctp_sf_do_9_1_abort"}, \ | 252 | TYPE_SCTP_FUNC(sctp_sf_do_9_1_abort), \ |
254 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ | 253 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ |
255 | {.fn = sctp_sf_shutdown_ack_sent_abort, \ | 254 | TYPE_SCTP_FUNC(sctp_sf_shutdown_ack_sent_abort), \ |
256 | .name = "sctp_sf_shutdown_ack_sent_abort"}, \ | ||
257 | } /* TYPE_SCTP_ABORT */ | 255 | } /* TYPE_SCTP_ABORT */ |
258 | 256 | ||
259 | #define TYPE_SCTP_SHUTDOWN { \ | 257 | #define TYPE_SCTP_SHUTDOWN { \ |
260 | /* SCTP_STATE_EMPTY */ \ | 258 | /* SCTP_STATE_EMPTY */ \ |
261 | {.fn = sctp_sf_ootb, .name = "sctp_sf_ootb"}, \ | 259 | TYPE_SCTP_FUNC(sctp_sf_ootb), \ |
262 | /* SCTP_STATE_CLOSED */ \ | 260 | /* SCTP_STATE_CLOSED */ \ |
263 | {.fn = sctp_sf_tabort_8_4_8, .name = "sctp_sf_tabort_8_4_8"}, \ | 261 | TYPE_SCTP_FUNC(sctp_sf_tabort_8_4_8), \ |
264 | /* SCTP_STATE_COOKIE_WAIT */ \ | 262 | /* SCTP_STATE_COOKIE_WAIT */ \ |
265 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 263 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
266 | /* SCTP_STATE_COOKIE_ECHOED */ \ | 264 | /* SCTP_STATE_COOKIE_ECHOED */ \ |
267 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 265 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
268 | /* SCTP_STATE_ESTABLISHED */ \ | 266 | /* SCTP_STATE_ESTABLISHED */ \ |
269 | {.fn = sctp_sf_do_9_2_shutdown, .name = "sctp_sf_do_9_2_shutdown"}, \ | 267 | TYPE_SCTP_FUNC(sctp_sf_do_9_2_shutdown), \ |
270 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ | 268 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ |
271 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 269 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
272 | /* SCTP_STATE_SHUTDOWN_SENT */ \ | 270 | /* SCTP_STATE_SHUTDOWN_SENT */ \ |
273 | {.fn = sctp_sf_do_9_2_shutdown_ack, \ | 271 | TYPE_SCTP_FUNC(sctp_sf_do_9_2_shutdown_ack), \ |
274 | .name = "sctp_sf_do_9_2_shutdown_ack"}, \ | ||
275 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ | 272 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ |
276 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 273 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
277 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ | 274 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ |
278 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 275 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
279 | } /* TYPE_SCTP_SHUTDOWN */ | 276 | } /* TYPE_SCTP_SHUTDOWN */ |
280 | 277 | ||
281 | #define TYPE_SCTP_SHUTDOWN_ACK { \ | 278 | #define TYPE_SCTP_SHUTDOWN_ACK { \ |
282 | /* SCTP_STATE_EMPTY */ \ | 279 | /* SCTP_STATE_EMPTY */ \ |
283 | {.fn = sctp_sf_ootb, .name = "sctp_sf_ootb"}, \ | 280 | TYPE_SCTP_FUNC(sctp_sf_ootb), \ |
284 | /* SCTP_STATE_CLOSED */ \ | 281 | /* SCTP_STATE_CLOSED */ \ |
285 | {.fn = sctp_sf_ootb, .name = "sctp_sf_ootb"}, \ | 282 | TYPE_SCTP_FUNC(sctp_sf_ootb), \ |
286 | /* SCTP_STATE_COOKIE_WAIT */ \ | 283 | /* SCTP_STATE_COOKIE_WAIT */ \ |
287 | {.fn = sctp_sf_do_8_5_1_E_sa, .name = "sctp_sf_do_8_5_1_E_sa"}, \ | 284 | TYPE_SCTP_FUNC(sctp_sf_do_8_5_1_E_sa), \ |
288 | /* SCTP_STATE_COOKIE_ECHOED */ \ | 285 | /* SCTP_STATE_COOKIE_ECHOED */ \ |
289 | {.fn = sctp_sf_do_8_5_1_E_sa, .name = "sctp_sf_do_8_5_1_E_sa"}, \ | 286 | TYPE_SCTP_FUNC(sctp_sf_do_8_5_1_E_sa), \ |
290 | /* SCTP_STATE_ESTABLISHED */ \ | 287 | /* SCTP_STATE_ESTABLISHED */ \ |
291 | {.fn = sctp_sf_violation, .name = "sctp_sf_violation"}, \ | 288 | TYPE_SCTP_FUNC(sctp_sf_violation), \ |
292 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ | 289 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ |
293 | {.fn = sctp_sf_violation, .name = "sctp_sf_violation"}, \ | 290 | TYPE_SCTP_FUNC(sctp_sf_violation), \ |
294 | /* SCTP_STATE_SHUTDOWN_SENT */ \ | 291 | /* SCTP_STATE_SHUTDOWN_SENT */ \ |
295 | {.fn = sctp_sf_do_9_2_final, .name = "sctp_sf_do_9_2_final"}, \ | 292 | TYPE_SCTP_FUNC(sctp_sf_do_9_2_final), \ |
296 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ | 293 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ |
297 | {.fn = sctp_sf_violation, .name = "sctp_sf_violation"}, \ | 294 | TYPE_SCTP_FUNC(sctp_sf_violation), \ |
298 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ | 295 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ |
299 | {.fn = sctp_sf_do_9_2_final, .name = "sctp_sf_do_9_2_final"}, \ | 296 | TYPE_SCTP_FUNC(sctp_sf_do_9_2_final), \ |
300 | } /* TYPE_SCTP_SHUTDOWN_ACK */ | 297 | } /* TYPE_SCTP_SHUTDOWN_ACK */ |
301 | 298 | ||
302 | #define TYPE_SCTP_ERROR { \ | 299 | #define TYPE_SCTP_ERROR { \ |
303 | /* SCTP_STATE_EMPTY */ \ | 300 | /* SCTP_STATE_EMPTY */ \ |
304 | {.fn = sctp_sf_ootb, .name = "sctp_sf_ootb"}, \ | 301 | TYPE_SCTP_FUNC(sctp_sf_ootb), \ |
305 | /* SCTP_STATE_CLOSED */ \ | 302 | /* SCTP_STATE_CLOSED */ \ |
306 | {.fn = sctp_sf_tabort_8_4_8, .name = "sctp_sf_tabort_8_4_8"}, \ | 303 | TYPE_SCTP_FUNC(sctp_sf_tabort_8_4_8), \ |
307 | /* SCTP_STATE_COOKIE_WAIT */ \ | 304 | /* SCTP_STATE_COOKIE_WAIT */ \ |
308 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 305 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
309 | /* SCTP_STATE_COOKIE_ECHOED */ \ | 306 | /* SCTP_STATE_COOKIE_ECHOED */ \ |
310 | {.fn = sctp_sf_cookie_echoed_err, .name = "sctp_sf_cookie_echoed_err"}, \ | 307 | TYPE_SCTP_FUNC(sctp_sf_cookie_echoed_err), \ |
311 | /* SCTP_STATE_ESTABLISHED */ \ | 308 | /* SCTP_STATE_ESTABLISHED */ \ |
312 | {.fn = sctp_sf_operr_notify, .name = "sctp_sf_operr_notify"}, \ | 309 | TYPE_SCTP_FUNC(sctp_sf_operr_notify), \ |
313 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ | 310 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ |
314 | {.fn = sctp_sf_operr_notify, .name = "sctp_sf_operr_notify"}, \ | 311 | TYPE_SCTP_FUNC(sctp_sf_operr_notify), \ |
315 | /* SCTP_STATE_SHUTDOWN_SENT */ \ | 312 | /* SCTP_STATE_SHUTDOWN_SENT */ \ |
316 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 313 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
317 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ | 314 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ |
318 | {.fn = sctp_sf_operr_notify, .name = "sctp_sf_operr_notify"}, \ | 315 | TYPE_SCTP_FUNC(sctp_sf_operr_notify), \ |
319 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ | 316 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ |
320 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 317 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
321 | } /* TYPE_SCTP_ERROR */ | 318 | } /* TYPE_SCTP_ERROR */ |
322 | 319 | ||
323 | #define TYPE_SCTP_COOKIE_ECHO { \ | 320 | #define TYPE_SCTP_COOKIE_ECHO { \ |
324 | /* SCTP_STATE_EMPTY */ \ | 321 | /* SCTP_STATE_EMPTY */ \ |
325 | {.fn = sctp_sf_bug, .name = "sctp_sf_bug"}, \ | 322 | TYPE_SCTP_FUNC(sctp_sf_bug), \ |
326 | /* SCTP_STATE_CLOSED */ \ | 323 | /* SCTP_STATE_CLOSED */ \ |
327 | {.fn = sctp_sf_do_5_1D_ce, .name = "sctp_sf_do_5_1D_ce"}, \ | 324 | TYPE_SCTP_FUNC(sctp_sf_do_5_1D_ce), \ |
328 | /* SCTP_STATE_COOKIE_WAIT */ \ | 325 | /* SCTP_STATE_COOKIE_WAIT */ \ |
329 | {.fn = sctp_sf_do_5_2_4_dupcook, .name = "sctp_sf_do_5_2_4_dupcook"}, \ | 326 | TYPE_SCTP_FUNC(sctp_sf_do_5_2_4_dupcook), \ |
330 | /* SCTP_STATE_COOKIE_ECHOED */ \ | 327 | /* SCTP_STATE_COOKIE_ECHOED */ \ |
331 | {.fn = sctp_sf_do_5_2_4_dupcook, .name = "sctp_sf_do_5_2_4_dupcook"}, \ | 328 | TYPE_SCTP_FUNC(sctp_sf_do_5_2_4_dupcook), \ |
332 | /* SCTP_STATE_ESTABLISHED */ \ | 329 | /* SCTP_STATE_ESTABLISHED */ \ |
333 | {.fn = sctp_sf_do_5_2_4_dupcook, .name = "sctp_sf_do_5_2_4_dupcook"}, \ | 330 | TYPE_SCTP_FUNC(sctp_sf_do_5_2_4_dupcook), \ |
334 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ | 331 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ |
335 | {.fn = sctp_sf_do_5_2_4_dupcook, .name = "sctp_sf_do_5_2_4_dupcook"}, \ | 332 | TYPE_SCTP_FUNC(sctp_sf_do_5_2_4_dupcook), \ |
336 | /* SCTP_STATE_SHUTDOWN_SENT */ \ | 333 | /* SCTP_STATE_SHUTDOWN_SENT */ \ |
337 | {.fn = sctp_sf_do_5_2_4_dupcook, .name = "sctp_sf_do_5_2_4_dupcook"}, \ | 334 | TYPE_SCTP_FUNC(sctp_sf_do_5_2_4_dupcook), \ |
338 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ | 335 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ |
339 | {.fn = sctp_sf_do_5_2_4_dupcook, .name = "sctp_sf_do_5_2_4_dupcook"}, \ | 336 | TYPE_SCTP_FUNC(sctp_sf_do_5_2_4_dupcook), \ |
340 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ | 337 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ |
341 | {.fn = sctp_sf_do_5_2_4_dupcook, .name = "sctp_sf_do_5_2_4_dupcook"}, \ | 338 | TYPE_SCTP_FUNC(sctp_sf_do_5_2_4_dupcook), \ |
342 | } /* TYPE_SCTP_COOKIE_ECHO */ | 339 | } /* TYPE_SCTP_COOKIE_ECHO */ |
343 | 340 | ||
344 | #define TYPE_SCTP_COOKIE_ACK { \ | 341 | #define TYPE_SCTP_COOKIE_ACK { \ |
345 | /* SCTP_STATE_EMPTY */ \ | 342 | /* SCTP_STATE_EMPTY */ \ |
346 | {.fn = sctp_sf_ootb, .name = "sctp_sf_ootb"}, \ | 343 | TYPE_SCTP_FUNC(sctp_sf_ootb), \ |
347 | /* SCTP_STATE_CLOSED */ \ | 344 | /* SCTP_STATE_CLOSED */ \ |
348 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 345 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
349 | /* SCTP_STATE_COOKIE_WAIT */ \ | 346 | /* SCTP_STATE_COOKIE_WAIT */ \ |
350 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 347 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
351 | /* SCTP_STATE_COOKIE_ECHOED */ \ | 348 | /* SCTP_STATE_COOKIE_ECHOED */ \ |
352 | {.fn = sctp_sf_do_5_1E_ca, .name = "sctp_sf_do_5_1E_ca"}, \ | 349 | TYPE_SCTP_FUNC(sctp_sf_do_5_1E_ca), \ |
353 | /* SCTP_STATE_ESTABLISHED */ \ | 350 | /* SCTP_STATE_ESTABLISHED */ \ |
354 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 351 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
355 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ | 352 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ |
356 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 353 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
357 | /* SCTP_STATE_SHUTDOWN_SENT */ \ | 354 | /* SCTP_STATE_SHUTDOWN_SENT */ \ |
358 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 355 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
359 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ | 356 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ |
360 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 357 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
361 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ | 358 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ |
362 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 359 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
363 | } /* TYPE_SCTP_COOKIE_ACK */ | 360 | } /* TYPE_SCTP_COOKIE_ACK */ |
364 | 361 | ||
365 | #define TYPE_SCTP_ECN_ECNE { \ | 362 | #define TYPE_SCTP_ECN_ECNE { \ |
366 | /* SCTP_STATE_EMPTY */ \ | 363 | /* SCTP_STATE_EMPTY */ \ |
367 | {.fn = sctp_sf_ootb, .name = "sctp_sf_ootb"}, \ | 364 | TYPE_SCTP_FUNC(sctp_sf_ootb), \ |
368 | /* SCTP_STATE_CLOSED */ \ | 365 | /* SCTP_STATE_CLOSED */ \ |
369 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 366 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
370 | /* SCTP_STATE_COOKIE_WAIT */ \ | 367 | /* SCTP_STATE_COOKIE_WAIT */ \ |
371 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 368 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
372 | /* SCTP_STATE_COOKIE_ECHOED */ \ | 369 | /* SCTP_STATE_COOKIE_ECHOED */ \ |
373 | {.fn = sctp_sf_do_ecne, .name = "sctp_sf_do_ecne"}, \ | 370 | TYPE_SCTP_FUNC(sctp_sf_do_ecne), \ |
374 | /* SCTP_STATE_ESTABLISHED */ \ | 371 | /* SCTP_STATE_ESTABLISHED */ \ |
375 | {.fn = sctp_sf_do_ecne, .name = "sctp_sf_do_ecne"}, \ | 372 | TYPE_SCTP_FUNC(sctp_sf_do_ecne), \ |
376 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ | 373 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ |
377 | {.fn = sctp_sf_do_ecne, .name = "sctp_sf_do_ecne"}, \ | 374 | TYPE_SCTP_FUNC(sctp_sf_do_ecne), \ |
378 | /* SCTP_STATE_SHUTDOWN_SENT */ \ | 375 | /* SCTP_STATE_SHUTDOWN_SENT */ \ |
379 | {.fn = sctp_sf_do_ecne, .name = "sctp_sf_do_ecne"}, \ | 376 | TYPE_SCTP_FUNC(sctp_sf_do_ecne), \ |
380 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ | 377 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ |
381 | {.fn = sctp_sf_do_ecne, .name = "sctp_sf_do_ecne"}, \ | 378 | TYPE_SCTP_FUNC(sctp_sf_do_ecne), \ |
382 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ | 379 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ |
383 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 380 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
384 | } /* TYPE_SCTP_ECN_ECNE */ | 381 | } /* TYPE_SCTP_ECN_ECNE */ |
385 | 382 | ||
386 | #define TYPE_SCTP_ECN_CWR { \ | 383 | #define TYPE_SCTP_ECN_CWR { \ |
387 | /* SCTP_STATE_EMPTY */ \ | 384 | /* SCTP_STATE_EMPTY */ \ |
388 | {.fn = sctp_sf_ootb, .name = "sctp_sf_ootb"}, \ | 385 | TYPE_SCTP_FUNC(sctp_sf_ootb), \ |
389 | /* SCTP_STATE_CLOSED */ \ | 386 | /* SCTP_STATE_CLOSED */ \ |
390 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 387 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
391 | /* SCTP_STATE_COOKIE_WAIT */ \ | 388 | /* SCTP_STATE_COOKIE_WAIT */ \ |
392 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 389 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
393 | /* SCTP_STATE_COOKIE_ECHOED */ \ | 390 | /* SCTP_STATE_COOKIE_ECHOED */ \ |
394 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 391 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
395 | /* SCTP_STATE_ESTABLISHED */ \ | 392 | /* SCTP_STATE_ESTABLISHED */ \ |
396 | {.fn = sctp_sf_do_ecn_cwr, .name = "sctp_sf_do_ecn_cwr"}, \ | 393 | TYPE_SCTP_FUNC(sctp_sf_do_ecn_cwr), \ |
397 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ | 394 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ |
398 | {.fn = sctp_sf_do_ecn_cwr, .name = "sctp_sf_do_ecn_cwr"}, \ | 395 | TYPE_SCTP_FUNC(sctp_sf_do_ecn_cwr), \ |
399 | /* SCTP_STATE_SHUTDOWN_SENT */ \ | 396 | /* SCTP_STATE_SHUTDOWN_SENT */ \ |
400 | {.fn = sctp_sf_do_ecn_cwr, .name = "sctp_sf_do_ecn_cwr"}, \ | 397 | TYPE_SCTP_FUNC(sctp_sf_do_ecn_cwr), \ |
401 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ | 398 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ |
402 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 399 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
403 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ | 400 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ |
404 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 401 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
405 | } /* TYPE_SCTP_ECN_CWR */ | 402 | } /* TYPE_SCTP_ECN_CWR */ |
406 | 403 | ||
407 | #define TYPE_SCTP_SHUTDOWN_COMPLETE { \ | 404 | #define TYPE_SCTP_SHUTDOWN_COMPLETE { \ |
408 | /* SCTP_STATE_EMPTY */ \ | 405 | /* SCTP_STATE_EMPTY */ \ |
409 | {.fn = sctp_sf_ootb, .name = "sctp_sf_ootb"}, \ | 406 | TYPE_SCTP_FUNC(sctp_sf_ootb), \ |
410 | /* SCTP_STATE_CLOSED */ \ | 407 | /* SCTP_STATE_CLOSED */ \ |
411 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 408 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
412 | /* SCTP_STATE_COOKIE_WAIT */ \ | 409 | /* SCTP_STATE_COOKIE_WAIT */ \ |
413 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 410 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
414 | /* SCTP_STATE_COOKIE_ECHOED */ \ | 411 | /* SCTP_STATE_COOKIE_ECHOED */ \ |
415 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 412 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
416 | /* SCTP_STATE_ESTABLISHED */ \ | 413 | /* SCTP_STATE_ESTABLISHED */ \ |
417 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 414 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
418 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ | 415 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ |
419 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 416 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
420 | /* SCTP_STATE_SHUTDOWN_SENT */ \ | 417 | /* SCTP_STATE_SHUTDOWN_SENT */ \ |
421 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 418 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
422 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ | 419 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ |
423 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 420 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
424 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ | 421 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ |
425 | {.fn = sctp_sf_do_4_C, .name = "sctp_sf_do_4_C"}, \ | 422 | TYPE_SCTP_FUNC(sctp_sf_do_4_C), \ |
426 | } /* TYPE_SCTP_SHUTDOWN_COMPLETE */ | 423 | } /* TYPE_SCTP_SHUTDOWN_COMPLETE */ |
427 | 424 | ||
428 | /* The primary index for this table is the chunk type. | 425 | /* The primary index for this table is the chunk type. |
@@ -450,44 +447,44 @@ static const sctp_sm_table_entry_t chunk_event_table[SCTP_NUM_BASE_CHUNK_TYPES][ | |||
450 | 447 | ||
451 | #define TYPE_SCTP_ASCONF { \ | 448 | #define TYPE_SCTP_ASCONF { \ |
452 | /* SCTP_STATE_EMPTY */ \ | 449 | /* SCTP_STATE_EMPTY */ \ |
453 | {.fn = sctp_sf_ootb, .name = "sctp_sf_ootb"}, \ | 450 | TYPE_SCTP_FUNC(sctp_sf_ootb), \ |
454 | /* SCTP_STATE_CLOSED */ \ | 451 | /* SCTP_STATE_CLOSED */ \ |
455 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 452 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
456 | /* SCTP_STATE_COOKIE_WAIT */ \ | 453 | /* SCTP_STATE_COOKIE_WAIT */ \ |
457 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 454 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
458 | /* SCTP_STATE_COOKIE_ECHOED */ \ | 455 | /* SCTP_STATE_COOKIE_ECHOED */ \ |
459 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 456 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
460 | /* SCTP_STATE_ESTABLISHED */ \ | 457 | /* SCTP_STATE_ESTABLISHED */ \ |
461 | {.fn = sctp_sf_do_asconf, .name = "sctp_sf_do_asconf"}, \ | 458 | TYPE_SCTP_FUNC(sctp_sf_do_asconf), \ |
462 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ | 459 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ |
463 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 460 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
464 | /* SCTP_STATE_SHUTDOWN_SENT */ \ | 461 | /* SCTP_STATE_SHUTDOWN_SENT */ \ |
465 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 462 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
466 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ | 463 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ |
467 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 464 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
468 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ | 465 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ |
469 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 466 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
470 | } /* TYPE_SCTP_ASCONF */ | 467 | } /* TYPE_SCTP_ASCONF */ |
471 | 468 | ||
472 | #define TYPE_SCTP_ASCONF_ACK { \ | 469 | #define TYPE_SCTP_ASCONF_ACK { \ |
473 | /* SCTP_STATE_EMPTY */ \ | 470 | /* SCTP_STATE_EMPTY */ \ |
474 | {.fn = sctp_sf_ootb, .name = "sctp_sf_ootb"}, \ | 471 | TYPE_SCTP_FUNC(sctp_sf_ootb), \ |
475 | /* SCTP_STATE_CLOSED */ \ | 472 | /* SCTP_STATE_CLOSED */ \ |
476 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 473 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
477 | /* SCTP_STATE_COOKIE_WAIT */ \ | 474 | /* SCTP_STATE_COOKIE_WAIT */ \ |
478 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 475 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
479 | /* SCTP_STATE_COOKIE_ECHOED */ \ | 476 | /* SCTP_STATE_COOKIE_ECHOED */ \ |
480 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 477 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
481 | /* SCTP_STATE_ESTABLISHED */ \ | 478 | /* SCTP_STATE_ESTABLISHED */ \ |
482 | {.fn = sctp_sf_do_asconf_ack, .name = "sctp_sf_do_asconf_ack"}, \ | 479 | TYPE_SCTP_FUNC(sctp_sf_do_asconf_ack), \ |
483 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ | 480 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ |
484 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 481 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
485 | /* SCTP_STATE_SHUTDOWN_SENT */ \ | 482 | /* SCTP_STATE_SHUTDOWN_SENT */ \ |
486 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 483 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
487 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ | 484 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ |
488 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 485 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
489 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ | 486 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ |
490 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 487 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
491 | } /* TYPE_SCTP_ASCONF_ACK */ | 488 | } /* TYPE_SCTP_ASCONF_ACK */ |
492 | 489 | ||
493 | /* The primary index for this table is the chunk type. | 490 | /* The primary index for this table is the chunk type. |
@@ -500,23 +497,23 @@ static const sctp_sm_table_entry_t addip_chunk_event_table[SCTP_NUM_ADDIP_CHUNK_ | |||
500 | 497 | ||
501 | #define TYPE_SCTP_FWD_TSN { \ | 498 | #define TYPE_SCTP_FWD_TSN { \ |
502 | /* SCTP_STATE_EMPTY */ \ | 499 | /* SCTP_STATE_EMPTY */ \ |
503 | {.fn = sctp_sf_ootb, .name = "sctp_sf_ootb"}, \ | 500 | TYPE_SCTP_FUNC(sctp_sf_ootb), \ |
504 | /* SCTP_STATE_CLOSED */ \ | 501 | /* SCTP_STATE_CLOSED */ \ |
505 | {.fn = sctp_sf_tabort_8_4_8, .name = "sctp_sf_tabort_8_4_8"}, \ | 502 | TYPE_SCTP_FUNC(sctp_sf_tabort_8_4_8), \ |
506 | /* SCTP_STATE_COOKIE_WAIT */ \ | 503 | /* SCTP_STATE_COOKIE_WAIT */ \ |
507 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 504 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
508 | /* SCTP_STATE_COOKIE_ECHOED */ \ | 505 | /* SCTP_STATE_COOKIE_ECHOED */ \ |
509 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 506 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
510 | /* SCTP_STATE_ESTABLISHED */ \ | 507 | /* SCTP_STATE_ESTABLISHED */ \ |
511 | {.fn = sctp_sf_eat_fwd_tsn, .name = "sctp_sf_eat_fwd_tsn"}, \ | 508 | TYPE_SCTP_FUNC(sctp_sf_eat_fwd_tsn), \ |
512 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ | 509 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ |
513 | {.fn = sctp_sf_eat_fwd_tsn, .name = "sctp_sf_eat_fwd_tsn"}, \ | 510 | TYPE_SCTP_FUNC(sctp_sf_eat_fwd_tsn), \ |
514 | /* SCTP_STATE_SHUTDOWN_SENT */ \ | 511 | /* SCTP_STATE_SHUTDOWN_SENT */ \ |
515 | {.fn = sctp_sf_eat_fwd_tsn_fast, .name = "sctp_sf_eat_fwd_tsn_fast"}, \ | 512 | TYPE_SCTP_FUNC(sctp_sf_eat_fwd_tsn_fast), \ |
516 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ | 513 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ |
517 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 514 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
518 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ | 515 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ |
519 | {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ | 516 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ |
520 | } /* TYPE_SCTP_FWD_TSN */ | 517 | } /* TYPE_SCTP_FWD_TSN */ |
521 | 518 | ||
522 | /* The primary index for this table is the chunk type. | 519 | /* The primary index for this table is the chunk type. |
@@ -529,167 +526,150 @@ static const sctp_sm_table_entry_t prsctp_chunk_event_table[SCTP_NUM_PRSCTP_CHUN | |||
529 | static const sctp_sm_table_entry_t | 526 | static const sctp_sm_table_entry_t |
530 | chunk_event_table_unknown[SCTP_STATE_NUM_STATES] = { | 527 | chunk_event_table_unknown[SCTP_STATE_NUM_STATES] = { |
531 | /* SCTP_STATE_EMPTY */ | 528 | /* SCTP_STATE_EMPTY */ |
532 | {.fn = sctp_sf_ootb, .name = "sctp_sf_ootb"}, | 529 | TYPE_SCTP_FUNC(sctp_sf_ootb), |
533 | /* SCTP_STATE_CLOSED */ | 530 | /* SCTP_STATE_CLOSED */ |
534 | {.fn = sctp_sf_tabort_8_4_8, .name = "sctp_sf_tabort_8_4_8"}, | 531 | TYPE_SCTP_FUNC(sctp_sf_tabort_8_4_8), |
535 | /* SCTP_STATE_COOKIE_WAIT */ | 532 | /* SCTP_STATE_COOKIE_WAIT */ |
536 | {.fn = sctp_sf_unk_chunk, .name = "sctp_sf_unk_chunk"}, | 533 | TYPE_SCTP_FUNC(sctp_sf_unk_chunk), |
537 | /* SCTP_STATE_COOKIE_ECHOED */ | 534 | /* SCTP_STATE_COOKIE_ECHOED */ |
538 | {.fn = sctp_sf_unk_chunk, .name = "sctp_sf_unk_chunk"}, | 535 | TYPE_SCTP_FUNC(sctp_sf_unk_chunk), |
539 | /* SCTP_STATE_ESTABLISHED */ | 536 | /* SCTP_STATE_ESTABLISHED */ |
540 | {.fn = sctp_sf_unk_chunk, .name = "sctp_sf_unk_chunk"}, | 537 | TYPE_SCTP_FUNC(sctp_sf_unk_chunk), |
541 | /* SCTP_STATE_SHUTDOWN_PENDING */ | 538 | /* SCTP_STATE_SHUTDOWN_PENDING */ |
542 | {.fn = sctp_sf_unk_chunk, .name = "sctp_sf_unk_chunk"}, | 539 | TYPE_SCTP_FUNC(sctp_sf_unk_chunk), |
543 | /* SCTP_STATE_SHUTDOWN_SENT */ | 540 | /* SCTP_STATE_SHUTDOWN_SENT */ |
544 | {.fn = sctp_sf_unk_chunk, .name = "sctp_sf_unk_chunk"}, | 541 | TYPE_SCTP_FUNC(sctp_sf_unk_chunk), |
545 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ | 542 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ |
546 | {.fn = sctp_sf_unk_chunk, .name = "sctp_sf_unk_chunk"}, | 543 | TYPE_SCTP_FUNC(sctp_sf_unk_chunk), |
547 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ | 544 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ |
548 | {.fn = sctp_sf_unk_chunk, .name = "sctp_sf_unk_chunk"}, | 545 | TYPE_SCTP_FUNC(sctp_sf_unk_chunk), |
549 | }; /* chunk unknown */ | 546 | }; /* chunk unknown */ |
550 | 547 | ||
551 | 548 | ||
552 | #define TYPE_SCTP_PRIMITIVE_ASSOCIATE { \ | 549 | #define TYPE_SCTP_PRIMITIVE_ASSOCIATE { \ |
553 | /* SCTP_STATE_EMPTY */ \ | 550 | /* SCTP_STATE_EMPTY */ \ |
554 | {.fn = sctp_sf_bug, .name = "sctp_sf_bug"}, \ | 551 | TYPE_SCTP_FUNC(sctp_sf_bug), \ |
555 | /* SCTP_STATE_CLOSED */ \ | 552 | /* SCTP_STATE_CLOSED */ \ |
556 | {.fn = sctp_sf_do_prm_asoc, .name = "sctp_sf_do_prm_asoc"}, \ | 553 | TYPE_SCTP_FUNC(sctp_sf_do_prm_asoc), \ |
557 | /* SCTP_STATE_COOKIE_WAIT */ \ | 554 | /* SCTP_STATE_COOKIE_WAIT */ \ |
558 | {.fn = sctp_sf_not_impl, .name = "sctp_sf_not_impl"}, \ | 555 | TYPE_SCTP_FUNC(sctp_sf_not_impl), \ |
559 | /* SCTP_STATE_COOKIE_ECHOED */ \ | 556 | /* SCTP_STATE_COOKIE_ECHOED */ \ |
560 | {.fn = sctp_sf_not_impl, .name = "sctp_sf_not_impl"}, \ | 557 | TYPE_SCTP_FUNC(sctp_sf_not_impl), \ |
561 | /* SCTP_STATE_ESTABLISHED */ \ | 558 | /* SCTP_STATE_ESTABLISHED */ \ |
562 | {.fn = sctp_sf_not_impl, .name = "sctp_sf_not_impl"}, \ | 559 | TYPE_SCTP_FUNC(sctp_sf_not_impl), \ |
563 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ | 560 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ |
564 | {.fn = sctp_sf_not_impl, .name = "sctp_sf_not_impl"}, \ | 561 | TYPE_SCTP_FUNC(sctp_sf_not_impl), \ |
565 | /* SCTP_STATE_SHUTDOWN_SENT */ \ | 562 | /* SCTP_STATE_SHUTDOWN_SENT */ \ |
566 | {.fn = sctp_sf_not_impl, .name = "sctp_sf_not_impl"}, \ | 563 | TYPE_SCTP_FUNC(sctp_sf_not_impl), \ |
567 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ | 564 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ |
568 | {.fn = sctp_sf_not_impl, .name = "sctp_sf_not_impl"}, \ | 565 | TYPE_SCTP_FUNC(sctp_sf_not_impl), \ |
569 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ | 566 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ |
570 | {.fn = sctp_sf_not_impl, .name = "sctp_sf_not_impl"}, \ | 567 | TYPE_SCTP_FUNC(sctp_sf_not_impl), \ |
571 | } /* TYPE_SCTP_PRIMITIVE_ASSOCIATE */ | 568 | } /* TYPE_SCTP_PRIMITIVE_ASSOCIATE */ |
572 | 569 | ||
573 | #define TYPE_SCTP_PRIMITIVE_SHUTDOWN { \ | 570 | #define TYPE_SCTP_PRIMITIVE_SHUTDOWN { \ |
574 | /* SCTP_STATE_EMPTY */ \ | 571 | /* SCTP_STATE_EMPTY */ \ |
575 | {.fn = sctp_sf_bug, .name = "sctp_sf_bug"}, \ | 572 | TYPE_SCTP_FUNC(sctp_sf_bug), \ |
576 | /* SCTP_STATE_CLOSED */ \ | 573 | /* SCTP_STATE_CLOSED */ \ |
577 | {.fn = sctp_sf_error_closed, .name = "sctp_sf_error_closed"}, \ | 574 | TYPE_SCTP_FUNC(sctp_sf_error_closed), \ |
578 | /* SCTP_STATE_COOKIE_WAIT */ \ | 575 | /* SCTP_STATE_COOKIE_WAIT */ \ |
579 | {.fn = sctp_sf_cookie_wait_prm_shutdown, \ | 576 | TYPE_SCTP_FUNC(sctp_sf_cookie_wait_prm_shutdown), \ |
580 | .name = "sctp_sf_cookie_wait_prm_shutdown"}, \ | ||
581 | /* SCTP_STATE_COOKIE_ECHOED */ \ | 577 | /* SCTP_STATE_COOKIE_ECHOED */ \ |
582 | {.fn = sctp_sf_cookie_echoed_prm_shutdown, \ | 578 | TYPE_SCTP_FUNC(sctp_sf_cookie_echoed_prm_shutdown),\ |
583 | .name = "sctp_sf_cookie_echoed_prm_shutdown"},\ | ||
584 | /* SCTP_STATE_ESTABLISHED */ \ | 579 | /* SCTP_STATE_ESTABLISHED */ \ |
585 | {.fn = sctp_sf_do_9_2_prm_shutdown, \ | 580 | TYPE_SCTP_FUNC(sctp_sf_do_9_2_prm_shutdown), \ |
586 | .name = "sctp_sf_do_9_2_prm_shutdown"}, \ | ||
587 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ | 581 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ |
588 | {.fn = sctp_sf_ignore_primitive, .name = "sctp_sf_ignore_primitive"}, \ | 582 | TYPE_SCTP_FUNC(sctp_sf_ignore_primitive), \ |
589 | /* SCTP_STATE_SHUTDOWN_SENT */ \ | 583 | /* SCTP_STATE_SHUTDOWN_SENT */ \ |
590 | {.fn = sctp_sf_ignore_primitive, .name = "sctp_sf_ignore_primitive"}, \ | 584 | TYPE_SCTP_FUNC(sctp_sf_ignore_primitive), \ |
591 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ | 585 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ |
592 | {.fn = sctp_sf_ignore_primitive, .name = "sctp_sf_ignore_primitive"}, \ | 586 | TYPE_SCTP_FUNC(sctp_sf_ignore_primitive), \ |
593 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ | 587 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ |
594 | {.fn = sctp_sf_ignore_primitive, .name = "sctp_sf_ignore_primitive"}, \ | 588 | TYPE_SCTP_FUNC(sctp_sf_ignore_primitive), \ |
595 | } /* TYPE_SCTP_PRIMITIVE_SHUTDOWN */ | 589 | } /* TYPE_SCTP_PRIMITIVE_SHUTDOWN */ |
596 | 590 | ||
597 | #define TYPE_SCTP_PRIMITIVE_ABORT { \ | 591 | #define TYPE_SCTP_PRIMITIVE_ABORT { \ |
598 | /* SCTP_STATE_EMPTY */ \ | 592 | /* SCTP_STATE_EMPTY */ \ |
599 | {.fn = sctp_sf_bug, .name = "sctp_sf_bug"}, \ | 593 | TYPE_SCTP_FUNC(sctp_sf_bug), \ |
600 | /* SCTP_STATE_CLOSED */ \ | 594 | /* SCTP_STATE_CLOSED */ \ |
601 | {.fn = sctp_sf_error_closed, .name = "sctp_sf_error_closed"}, \ | 595 | TYPE_SCTP_FUNC(sctp_sf_error_closed), \ |
602 | /* SCTP_STATE_COOKIE_WAIT */ \ | 596 | /* SCTP_STATE_COOKIE_WAIT */ \ |
603 | {.fn = sctp_sf_cookie_wait_prm_abort, \ | 597 | TYPE_SCTP_FUNC(sctp_sf_cookie_wait_prm_abort), \ |
604 | .name = "sctp_sf_cookie_wait_prm_abort"}, \ | ||
605 | /* SCTP_STATE_COOKIE_ECHOED */ \ | 598 | /* SCTP_STATE_COOKIE_ECHOED */ \ |
606 | {.fn = sctp_sf_cookie_echoed_prm_abort, \ | 599 | TYPE_SCTP_FUNC(sctp_sf_cookie_echoed_prm_abort), \ |
607 | .name = "sctp_sf_cookie_echoed_prm_abort"}, \ | ||
608 | /* SCTP_STATE_ESTABLISHED */ \ | 600 | /* SCTP_STATE_ESTABLISHED */ \ |
609 | {.fn = sctp_sf_do_9_1_prm_abort, \ | 601 | TYPE_SCTP_FUNC(sctp_sf_do_9_1_prm_abort), \ |
610 | .name = "sctp_sf_do_9_1_prm_abort"}, \ | ||
611 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ | 602 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ |
612 | {.fn = sctp_sf_shutdown_pending_prm_abort, \ | 603 | TYPE_SCTP_FUNC(sctp_sf_shutdown_pending_prm_abort), \ |
613 | .name = "sctp_sf_shutdown_pending_prm_abort"}, \ | ||
614 | /* SCTP_STATE_SHUTDOWN_SENT */ \ | 604 | /* SCTP_STATE_SHUTDOWN_SENT */ \ |
615 | {.fn = sctp_sf_shutdown_sent_prm_abort, \ | 605 | TYPE_SCTP_FUNC(sctp_sf_shutdown_sent_prm_abort), \ |
616 | .name = "sctp_sf_shutdown_sent_prm_abort"}, \ | ||
617 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ | 606 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ |
618 | {.fn = sctp_sf_do_9_1_prm_abort, \ | 607 | TYPE_SCTP_FUNC(sctp_sf_do_9_1_prm_abort), \ |
619 | .name = "sctp_sf_do_9_1_prm_abort"}, \ | ||
620 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ | 608 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ |
621 | {.fn = sctp_sf_shutdown_ack_sent_prm_abort, \ | 609 | TYPE_SCTP_FUNC(sctp_sf_shutdown_ack_sent_prm_abort), \ |
622 | .name = "sctp_sf_shutdown_ack_sent_prm_abort"}, \ | ||
623 | } /* TYPE_SCTP_PRIMITIVE_ABORT */ | 610 | } /* TYPE_SCTP_PRIMITIVE_ABORT */ |
624 | 611 | ||
625 | #define TYPE_SCTP_PRIMITIVE_SEND { \ | 612 | #define TYPE_SCTP_PRIMITIVE_SEND { \ |
626 | /* SCTP_STATE_EMPTY */ \ | 613 | /* SCTP_STATE_EMPTY */ \ |
627 | {.fn = sctp_sf_bug, .name = "sctp_sf_bug"}, \ | 614 | TYPE_SCTP_FUNC(sctp_sf_bug), \ |
628 | /* SCTP_STATE_CLOSED */ \ | 615 | /* SCTP_STATE_CLOSED */ \ |
629 | {.fn = sctp_sf_error_closed, .name = "sctp_sf_error_closed"}, \ | 616 | TYPE_SCTP_FUNC(sctp_sf_error_closed), \ |
630 | /* SCTP_STATE_COOKIE_WAIT */ \ | 617 | /* SCTP_STATE_COOKIE_WAIT */ \ |
631 | {.fn = sctp_sf_do_prm_send, .name = "sctp_sf_do_prm_send"}, \ | 618 | TYPE_SCTP_FUNC(sctp_sf_do_prm_send), \ |
632 | /* SCTP_STATE_COOKIE_ECHOED */ \ | 619 | /* SCTP_STATE_COOKIE_ECHOED */ \ |
633 | {.fn = sctp_sf_do_prm_send, .name = "sctp_sf_do_prm_send"}, \ | 620 | TYPE_SCTP_FUNC(sctp_sf_do_prm_send), \ |
634 | /* SCTP_STATE_ESTABLISHED */ \ | 621 | /* SCTP_STATE_ESTABLISHED */ \ |
635 | {.fn = sctp_sf_do_prm_send, .name = "sctp_sf_do_prm_send"}, \ | 622 | TYPE_SCTP_FUNC(sctp_sf_do_prm_send), \ |
636 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ | 623 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ |
637 | {.fn = sctp_sf_error_shutdown, .name = "sctp_sf_error_shutdown"}, \ | 624 | TYPE_SCTP_FUNC(sctp_sf_error_shutdown), \ |
638 | /* SCTP_STATE_SHUTDOWN_SENT */ \ | 625 | /* SCTP_STATE_SHUTDOWN_SENT */ \ |
639 | {.fn = sctp_sf_error_shutdown, .name = "sctp_sf_error_shutdown"}, \ | 626 | TYPE_SCTP_FUNC(sctp_sf_error_shutdown), \ |
640 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ | 627 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ |
641 | {.fn = sctp_sf_error_shutdown, .name = "sctp_sf_error_shutdown"}, \ | 628 | TYPE_SCTP_FUNC(sctp_sf_error_shutdown), \ |
642 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ | 629 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ |
643 | {.fn = sctp_sf_error_shutdown, .name = "sctp_sf_error_shutdown"}, \ | 630 | TYPE_SCTP_FUNC(sctp_sf_error_shutdown), \ |
644 | } /* TYPE_SCTP_PRIMITIVE_SEND */ | 631 | } /* TYPE_SCTP_PRIMITIVE_SEND */ |
645 | 632 | ||
646 | #define TYPE_SCTP_PRIMITIVE_REQUESTHEARTBEAT { \ | 633 | #define TYPE_SCTP_PRIMITIVE_REQUESTHEARTBEAT { \ |
647 | /* SCTP_STATE_EMPTY */ \ | 634 | /* SCTP_STATE_EMPTY */ \ |
648 | {.fn = sctp_sf_bug, .name = "sctp_sf_bug"}, \ | 635 | TYPE_SCTP_FUNC(sctp_sf_bug), \ |
649 | /* SCTP_STATE_CLOSED */ \ | 636 | /* SCTP_STATE_CLOSED */ \ |
650 | {.fn = sctp_sf_error_closed, .name = "sctp_sf_error_closed"}, \ | 637 | TYPE_SCTP_FUNC(sctp_sf_error_closed), \ |
651 | /* SCTP_STATE_COOKIE_WAIT */ \ | 638 | /* SCTP_STATE_COOKIE_WAIT */ \ |
652 | {.fn = sctp_sf_do_prm_requestheartbeat, \ | 639 | TYPE_SCTP_FUNC(sctp_sf_do_prm_requestheartbeat), \ |
653 | .name = "sctp_sf_do_prm_requestheartbeat"}, \ | ||
654 | /* SCTP_STATE_COOKIE_ECHOED */ \ | 640 | /* SCTP_STATE_COOKIE_ECHOED */ \ |
655 | {.fn = sctp_sf_do_prm_requestheartbeat, \ | 641 | TYPE_SCTP_FUNC(sctp_sf_do_prm_requestheartbeat), \ |
656 | .name = "sctp_sf_do_prm_requestheartbeat"}, \ | ||
657 | /* SCTP_STATE_ESTABLISHED */ \ | 642 | /* SCTP_STATE_ESTABLISHED */ \ |
658 | {.fn = sctp_sf_do_prm_requestheartbeat, \ | 643 | TYPE_SCTP_FUNC(sctp_sf_do_prm_requestheartbeat), \ |
659 | .name = "sctp_sf_do_prm_requestheartbeat"}, \ | ||
660 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ | 644 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ |
661 | {.fn = sctp_sf_do_prm_requestheartbeat, \ | 645 | TYPE_SCTP_FUNC(sctp_sf_do_prm_requestheartbeat), \ |
662 | .name = "sctp_sf_do_prm_requestheartbeat"}, \ | ||
663 | /* SCTP_STATE_SHUTDOWN_SENT */ \ | 646 | /* SCTP_STATE_SHUTDOWN_SENT */ \ |
664 | {.fn = sctp_sf_do_prm_requestheartbeat, \ | 647 | TYPE_SCTP_FUNC(sctp_sf_do_prm_requestheartbeat), \ |
665 | .name = "sctp_sf_do_prm_requestheartbeat"}, \ | ||
666 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ | 648 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ |
667 | {.fn = sctp_sf_do_prm_requestheartbeat, \ | 649 | TYPE_SCTP_FUNC(sctp_sf_do_prm_requestheartbeat), \ |
668 | .name = "sctp_sf_do_prm_requestheartbeat"}, \ | ||
669 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ | 650 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ |
670 | {.fn = sctp_sf_do_prm_requestheartbeat, \ | 651 | TYPE_SCTP_FUNC(sctp_sf_do_prm_requestheartbeat), \ |
671 | .name = "sctp_sf_do_prm_requestheartbeat"}, \ | ||
672 | } /* TYPE_SCTP_PRIMITIVE_REQUESTHEARTBEAT */ | 652 | } /* TYPE_SCTP_PRIMITIVE_REQUESTHEARTBEAT */ |
673 | 653 | ||
674 | #define TYPE_SCTP_PRIMITIVE_ASCONF { \ | 654 | #define TYPE_SCTP_PRIMITIVE_ASCONF { \ |
675 | /* SCTP_STATE_EMPTY */ \ | 655 | /* SCTP_STATE_EMPTY */ \ |
676 | {.fn = sctp_sf_bug, .name = "sctp_sf_bug"}, \ | 656 | TYPE_SCTP_FUNC(sctp_sf_bug), \ |
677 | /* SCTP_STATE_CLOSED */ \ | 657 | /* SCTP_STATE_CLOSED */ \ |
678 | {.fn = sctp_sf_error_closed, .name = "sctp_sf_error_closed"}, \ | 658 | TYPE_SCTP_FUNC(sctp_sf_error_closed), \ |
679 | /* SCTP_STATE_COOKIE_WAIT */ \ | 659 | /* SCTP_STATE_COOKIE_WAIT */ \ |
680 | {.fn = sctp_sf_error_closed, .name = "sctp_sf_error_closed"}, \ | 660 | TYPE_SCTP_FUNC(sctp_sf_error_closed), \ |
681 | /* SCTP_STATE_COOKIE_ECHOED */ \ | 661 | /* SCTP_STATE_COOKIE_ECHOED */ \ |
682 | {.fn = sctp_sf_error_closed, .name = "sctp_sf_error_closed"}, \ | 662 | TYPE_SCTP_FUNC(sctp_sf_error_closed), \ |
683 | /* SCTP_STATE_ESTABLISHED */ \ | 663 | /* SCTP_STATE_ESTABLISHED */ \ |
684 | {.fn = sctp_sf_do_prm_asconf, .name = "sctp_sf_do_prm_asconf"}, \ | 664 | TYPE_SCTP_FUNC(sctp_sf_do_prm_asconf), \ |
685 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ | 665 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ |
686 | {.fn = sctp_sf_error_shutdown, .name = "sctp_sf_error_shutdown"}, \ | 666 | TYPE_SCTP_FUNC(sctp_sf_error_shutdown), \ |
687 | /* SCTP_STATE_SHUTDOWN_SENT */ \ | 667 | /* SCTP_STATE_SHUTDOWN_SENT */ \ |
688 | {.fn = sctp_sf_error_shutdown, .name = "sctp_sf_error_shutdown"}, \ | 668 | TYPE_SCTP_FUNC(sctp_sf_error_shutdown), \ |
689 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ | 669 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ |
690 | {.fn = sctp_sf_error_shutdown, .name = "sctp_sf_error_shutdown"}, \ | 670 | TYPE_SCTP_FUNC(sctp_sf_error_shutdown), \ |
691 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ | 671 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ |
692 | {.fn = sctp_sf_error_shutdown, .name = "sctp_sf_error_shutdown"}, \ | 672 | TYPE_SCTP_FUNC(sctp_sf_error_shutdown), \ |
693 | } /* TYPE_SCTP_PRIMITIVE_REQUESTHEARTBEAT */ | 673 | } /* TYPE_SCTP_PRIMITIVE_REQUESTHEARTBEAT */ |
694 | 674 | ||
695 | /* The primary index for this table is the primitive type. | 675 | /* The primary index for this table is the primitive type. |
@@ -706,47 +686,44 @@ static const sctp_sm_table_entry_t primitive_event_table[SCTP_NUM_PRIMITIVE_TYPE | |||
706 | 686 | ||
707 | #define TYPE_SCTP_OTHER_NO_PENDING_TSN { \ | 687 | #define TYPE_SCTP_OTHER_NO_PENDING_TSN { \ |
708 | /* SCTP_STATE_EMPTY */ \ | 688 | /* SCTP_STATE_EMPTY */ \ |
709 | {.fn = sctp_sf_bug, .name = "sctp_sf_bug"}, \ | 689 | TYPE_SCTP_FUNC(sctp_sf_bug), \ |
710 | /* SCTP_STATE_CLOSED */ \ | 690 | /* SCTP_STATE_CLOSED */ \ |
711 | {.fn = sctp_sf_ignore_other, .name = "sctp_sf_ignore_other"}, \ | 691 | TYPE_SCTP_FUNC(sctp_sf_ignore_other), \ |
712 | /* SCTP_STATE_COOKIE_WAIT */ \ | 692 | /* SCTP_STATE_COOKIE_WAIT */ \ |
713 | {.fn = sctp_sf_ignore_other, .name = "sctp_sf_ignore_other"}, \ | 693 | TYPE_SCTP_FUNC(sctp_sf_ignore_other), \ |
714 | /* SCTP_STATE_COOKIE_ECHOED */ \ | 694 | /* SCTP_STATE_COOKIE_ECHOED */ \ |
715 | {.fn = sctp_sf_ignore_other, .name = "sctp_sf_ignore_other"}, \ | 695 | TYPE_SCTP_FUNC(sctp_sf_ignore_other), \ |
716 | /* SCTP_STATE_ESTABLISHED */ \ | 696 | /* SCTP_STATE_ESTABLISHED */ \ |
717 | {.fn = sctp_sf_ignore_other, .name = "sctp_sf_ignore_other"}, \ | 697 | TYPE_SCTP_FUNC(sctp_sf_ignore_other), \ |
718 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ | 698 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ |
719 | {.fn = sctp_sf_do_9_2_start_shutdown, \ | 699 | TYPE_SCTP_FUNC(sctp_sf_do_9_2_start_shutdown), \ |
720 | .name = "sctp_do_9_2_start_shutdown"}, \ | ||
721 | /* SCTP_STATE_SHUTDOWN_SENT */ \ | 700 | /* SCTP_STATE_SHUTDOWN_SENT */ \ |
722 | {.fn = sctp_sf_ignore_other, .name = "sctp_sf_ignore_other"}, \ | 701 | TYPE_SCTP_FUNC(sctp_sf_ignore_other), \ |
723 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ | 702 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ |
724 | {.fn = sctp_sf_do_9_2_shutdown_ack, \ | 703 | TYPE_SCTP_FUNC(sctp_sf_do_9_2_shutdown_ack), \ |
725 | .name = "sctp_sf_do_9_2_shutdown_ack"}, \ | ||
726 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ | 704 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ |
727 | {.fn = sctp_sf_ignore_other, .name = "sctp_sf_ignore_other"}, \ | 705 | TYPE_SCTP_FUNC(sctp_sf_ignore_other), \ |
728 | } | 706 | } |
729 | 707 | ||
730 | #define TYPE_SCTP_OTHER_ICMP_PROTO_UNREACH { \ | 708 | #define TYPE_SCTP_OTHER_ICMP_PROTO_UNREACH { \ |
731 | /* SCTP_STATE_EMPTY */ \ | 709 | /* SCTP_STATE_EMPTY */ \ |
732 | {.fn = sctp_sf_bug, .name = "sctp_sf_bug"}, \ | 710 | TYPE_SCTP_FUNC(sctp_sf_bug), \ |
733 | /* SCTP_STATE_CLOSED */ \ | 711 | /* SCTP_STATE_CLOSED */ \ |
734 | {.fn = sctp_sf_ignore_other, .name = "sctp_sf_ignore_other"}, \ | 712 | TYPE_SCTP_FUNC(sctp_sf_ignore_other), \ |
735 | /* SCTP_STATE_COOKIE_WAIT */ \ | 713 | /* SCTP_STATE_COOKIE_WAIT */ \ |
736 | {.fn = sctp_sf_cookie_wait_icmp_abort, \ | 714 | TYPE_SCTP_FUNC(sctp_sf_cookie_wait_icmp_abort), \ |
737 | .name = "sctp_sf_cookie_wait_icmp_abort"}, \ | ||
738 | /* SCTP_STATE_COOKIE_ECHOED */ \ | 715 | /* SCTP_STATE_COOKIE_ECHOED */ \ |
739 | {.fn = sctp_sf_ignore_other, .name = "sctp_sf_ignore_other"}, \ | 716 | TYPE_SCTP_FUNC(sctp_sf_ignore_other), \ |
740 | /* SCTP_STATE_ESTABLISHED */ \ | 717 | /* SCTP_STATE_ESTABLISHED */ \ |
741 | {.fn = sctp_sf_ignore_other, .name = "sctp_sf_ignore_other"}, \ | 718 | TYPE_SCTP_FUNC(sctp_sf_ignore_other), \ |
742 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ | 719 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ |
743 | {.fn = sctp_sf_ignore_other, .name = "sctp_sf_ignore_other"}, \ | 720 | TYPE_SCTP_FUNC(sctp_sf_ignore_other), \ |
744 | /* SCTP_STATE_SHUTDOWN_SENT */ \ | 721 | /* SCTP_STATE_SHUTDOWN_SENT */ \ |
745 | {.fn = sctp_sf_ignore_other, .name = "sctp_sf_ignore_other"}, \ | 722 | TYPE_SCTP_FUNC(sctp_sf_ignore_other), \ |
746 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ | 723 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ |
747 | {.fn = sctp_sf_ignore_other, .name = "sctp_sf_ignore_other"}, \ | 724 | TYPE_SCTP_FUNC(sctp_sf_ignore_other), \ |
748 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ | 725 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ |
749 | {.fn = sctp_sf_ignore_other, .name = "sctp_sf_ignore_other"}, \ | 726 | TYPE_SCTP_FUNC(sctp_sf_ignore_other), \ |
750 | } | 727 | } |
751 | 728 | ||
752 | static const sctp_sm_table_entry_t other_event_table[SCTP_NUM_OTHER_TYPES][SCTP_STATE_NUM_STATES] = { | 729 | static const sctp_sm_table_entry_t other_event_table[SCTP_NUM_OTHER_TYPES][SCTP_STATE_NUM_STATES] = { |
@@ -756,215 +733,212 @@ static const sctp_sm_table_entry_t other_event_table[SCTP_NUM_OTHER_TYPES][SCTP_ | |||
756 | 733 | ||
757 | #define TYPE_SCTP_EVENT_TIMEOUT_NONE { \ | 734 | #define TYPE_SCTP_EVENT_TIMEOUT_NONE { \ |
758 | /* SCTP_STATE_EMPTY */ \ | 735 | /* SCTP_STATE_EMPTY */ \ |
759 | {.fn = sctp_sf_bug, .name = "sctp_sf_bug"}, \ | 736 | TYPE_SCTP_FUNC(sctp_sf_bug), \ |
760 | /* SCTP_STATE_CLOSED */ \ | 737 | /* SCTP_STATE_CLOSED */ \ |
761 | {.fn = sctp_sf_bug, .name = "sctp_sf_bug"}, \ | 738 | TYPE_SCTP_FUNC(sctp_sf_bug), \ |
762 | /* SCTP_STATE_COOKIE_WAIT */ \ | 739 | /* SCTP_STATE_COOKIE_WAIT */ \ |
763 | {.fn = sctp_sf_bug, .name = "sctp_sf_bug"}, \ | 740 | TYPE_SCTP_FUNC(sctp_sf_bug), \ |
764 | /* SCTP_STATE_COOKIE_ECHOED */ \ | 741 | /* SCTP_STATE_COOKIE_ECHOED */ \ |
765 | {.fn = sctp_sf_bug, .name = "sctp_sf_bug"}, \ | 742 | TYPE_SCTP_FUNC(sctp_sf_bug), \ |
766 | /* SCTP_STATE_ESTABLISHED */ \ | 743 | /* SCTP_STATE_ESTABLISHED */ \ |
767 | {.fn = sctp_sf_bug, .name = "sctp_sf_bug"}, \ | 744 | TYPE_SCTP_FUNC(sctp_sf_bug), \ |
768 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ | 745 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ |
769 | {.fn = sctp_sf_bug, .name = "sctp_sf_bug"}, \ | 746 | TYPE_SCTP_FUNC(sctp_sf_bug), \ |
770 | /* SCTP_STATE_SHUTDOWN_SENT */ \ | 747 | /* SCTP_STATE_SHUTDOWN_SENT */ \ |
771 | {.fn = sctp_sf_bug, .name = "sctp_sf_bug"}, \ | 748 | TYPE_SCTP_FUNC(sctp_sf_bug), \ |
772 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ | 749 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ |
773 | {.fn = sctp_sf_bug, .name = "sctp_sf_bug"}, \ | 750 | TYPE_SCTP_FUNC(sctp_sf_bug), \ |
774 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ | 751 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ |
775 | {.fn = sctp_sf_bug, .name = "sctp_sf_bug"}, \ | 752 | TYPE_SCTP_FUNC(sctp_sf_bug), \ |
776 | } | 753 | } |
777 | 754 | ||
778 | #define TYPE_SCTP_EVENT_TIMEOUT_T1_COOKIE { \ | 755 | #define TYPE_SCTP_EVENT_TIMEOUT_T1_COOKIE { \ |
779 | /* SCTP_STATE_EMPTY */ \ | 756 | /* SCTP_STATE_EMPTY */ \ |
780 | {.fn = sctp_sf_bug, .name = "sctp_sf_bug"}, \ | 757 | TYPE_SCTP_FUNC(sctp_sf_bug), \ |
781 | /* SCTP_STATE_CLOSED */ \ | 758 | /* SCTP_STATE_CLOSED */ \ |
782 | {.fn = sctp_sf_timer_ignore, .name = "sctp_sf_timer_ignore"}, \ | 759 | TYPE_SCTP_FUNC(sctp_sf_timer_ignore), \ |
783 | /* SCTP_STATE_COOKIE_WAIT */ \ | 760 | /* SCTP_STATE_COOKIE_WAIT */ \ |
784 | {.fn = sctp_sf_bug, .name = "sctp_sf_bug"}, \ | 761 | TYPE_SCTP_FUNC(sctp_sf_bug), \ |
785 | /* SCTP_STATE_COOKIE_ECHOED */ \ | 762 | /* SCTP_STATE_COOKIE_ECHOED */ \ |
786 | {.fn = sctp_sf_t1_cookie_timer_expire, \ | 763 | TYPE_SCTP_FUNC(sctp_sf_t1_cookie_timer_expire), \ |
787 | .name = "sctp_sf_t1_cookie_timer_expire"}, \ | ||
788 | /* SCTP_STATE_ESTABLISHED */ \ | 764 | /* SCTP_STATE_ESTABLISHED */ \ |
789 | {.fn = sctp_sf_timer_ignore, .name = "sctp_sf_timer_ignore"}, \ | 765 | TYPE_SCTP_FUNC(sctp_sf_timer_ignore), \ |
790 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ | 766 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ |
791 | {.fn = sctp_sf_timer_ignore, .name = "sctp_sf_timer_ignore"}, \ | 767 | TYPE_SCTP_FUNC(sctp_sf_timer_ignore), \ |
792 | /* SCTP_STATE_SHUTDOWN_SENT */ \ | 768 | /* SCTP_STATE_SHUTDOWN_SENT */ \ |
793 | {.fn = sctp_sf_timer_ignore, .name = "sctp_sf_timer_ignore"}, \ | 769 | TYPE_SCTP_FUNC(sctp_sf_timer_ignore), \ |
794 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ | 770 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ |
795 | {.fn = sctp_sf_timer_ignore, .name = "sctp_sf_timer_ignore"}, \ | 771 | TYPE_SCTP_FUNC(sctp_sf_timer_ignore), \ |
796 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ | 772 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ |
797 | {.fn = sctp_sf_timer_ignore, .name = "sctp_sf_timer_ignore"}, \ | 773 | TYPE_SCTP_FUNC(sctp_sf_timer_ignore), \ |
798 | } | 774 | } |
799 | 775 | ||
800 | #define TYPE_SCTP_EVENT_TIMEOUT_T1_INIT { \ | 776 | #define TYPE_SCTP_EVENT_TIMEOUT_T1_INIT { \ |
801 | /* SCTP_STATE_EMPTY */ \ | 777 | /* SCTP_STATE_EMPTY */ \ |
802 | {.fn = sctp_sf_bug, .name = "sctp_sf_bug"}, \ | 778 | TYPE_SCTP_FUNC(sctp_sf_bug), \ |
803 | /* SCTP_STATE_CLOSED */ \ | 779 | /* SCTP_STATE_CLOSED */ \ |
804 | {.fn = sctp_sf_timer_ignore, .name = "sctp_sf_timer_ignore"}, \ | 780 | TYPE_SCTP_FUNC(sctp_sf_timer_ignore), \ |
805 | /* SCTP_STATE_COOKIE_WAIT */ \ | 781 | /* SCTP_STATE_COOKIE_WAIT */ \ |
806 | {.fn = sctp_sf_t1_init_timer_expire, \ | 782 | TYPE_SCTP_FUNC(sctp_sf_t1_init_timer_expire), \ |
807 | .name = "sctp_sf_t1_init_timer_expire"}, \ | ||
808 | /* SCTP_STATE_COOKIE_ECHOED */ \ | 783 | /* SCTP_STATE_COOKIE_ECHOED */ \ |
809 | {.fn = sctp_sf_timer_ignore, .name = "sctp_sf_timer_ignore"}, \ | 784 | TYPE_SCTP_FUNC(sctp_sf_timer_ignore), \ |
810 | /* SCTP_STATE_ESTABLISHED */ \ | 785 | /* SCTP_STATE_ESTABLISHED */ \ |
811 | {.fn = sctp_sf_timer_ignore, .name = "sctp_sf_timer_ignore"}, \ | 786 | TYPE_SCTP_FUNC(sctp_sf_timer_ignore), \ |
812 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ | 787 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ |
813 | {.fn = sctp_sf_timer_ignore, .name = "sctp_sf_timer_ignore"}, \ | 788 | TYPE_SCTP_FUNC(sctp_sf_timer_ignore), \ |
814 | /* SCTP_STATE_SHUTDOWN_SENT */ \ | 789 | /* SCTP_STATE_SHUTDOWN_SENT */ \ |
815 | {.fn = sctp_sf_timer_ignore, .name = "sctp_sf_timer_ignore"}, \ | 790 | TYPE_SCTP_FUNC(sctp_sf_timer_ignore), \ |
816 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ | 791 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ |
817 | {.fn = sctp_sf_timer_ignore, .name = "sctp_sf_timer_ignore"}, \ | 792 | TYPE_SCTP_FUNC(sctp_sf_timer_ignore), \ |
818 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ | 793 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ |
819 | {.fn = sctp_sf_timer_ignore, .name = "sctp_sf_timer_ignore"}, \ | 794 | TYPE_SCTP_FUNC(sctp_sf_timer_ignore), \ |
820 | } | 795 | } |
821 | 796 | ||
822 | #define TYPE_SCTP_EVENT_TIMEOUT_T2_SHUTDOWN { \ | 797 | #define TYPE_SCTP_EVENT_TIMEOUT_T2_SHUTDOWN { \ |
823 | /* SCTP_STATE_EMPTY */ \ | 798 | /* SCTP_STATE_EMPTY */ \ |
824 | {.fn = sctp_sf_bug, .name = "sctp_sf_bug"}, \ | 799 | TYPE_SCTP_FUNC(sctp_sf_bug), \ |
825 | /* SCTP_STATE_CLOSED */ \ | 800 | /* SCTP_STATE_CLOSED */ \ |
826 | {.fn = sctp_sf_timer_ignore, .name = "sctp_sf_timer_ignore"}, \ | 801 | TYPE_SCTP_FUNC(sctp_sf_timer_ignore), \ |
827 | /* SCTP_STATE_COOKIE_WAIT */ \ | 802 | /* SCTP_STATE_COOKIE_WAIT */ \ |
828 | {.fn = sctp_sf_timer_ignore, .name = "sctp_sf_timer_ignore"}, \ | 803 | TYPE_SCTP_FUNC(sctp_sf_timer_ignore), \ |
829 | /* SCTP_STATE_COOKIE_ECHOED */ \ | 804 | /* SCTP_STATE_COOKIE_ECHOED */ \ |
830 | {.fn = sctp_sf_timer_ignore, .name = "sctp_sf_timer_ignore"}, \ | 805 | TYPE_SCTP_FUNC(sctp_sf_timer_ignore), \ |
831 | /* SCTP_STATE_ESTABLISHED */ \ | 806 | /* SCTP_STATE_ESTABLISHED */ \ |
832 | {.fn = sctp_sf_timer_ignore, .name = "sctp_sf_timer_ignore"}, \ | 807 | TYPE_SCTP_FUNC(sctp_sf_timer_ignore), \ |
833 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ | 808 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ |
834 | {.fn = sctp_sf_timer_ignore, .name = "sctp_sf_timer_ignore"}, \ | 809 | TYPE_SCTP_FUNC(sctp_sf_timer_ignore), \ |
835 | /* SCTP_STATE_SHUTDOWN_SENT */ \ | 810 | /* SCTP_STATE_SHUTDOWN_SENT */ \ |
836 | {.fn = sctp_sf_t2_timer_expire, .name = "sctp_sf_t2_timer_expire"}, \ | 811 | TYPE_SCTP_FUNC(sctp_sf_t2_timer_expire), \ |
837 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ | 812 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ |
838 | {.fn = sctp_sf_timer_ignore, .name = "sctp_sf_timer_ignore"}, \ | 813 | TYPE_SCTP_FUNC(sctp_sf_timer_ignore), \ |
839 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ | 814 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ |
840 | {.fn = sctp_sf_t2_timer_expire, .name = "sctp_sf_t2_timer_expire"}, \ | 815 | TYPE_SCTP_FUNC(sctp_sf_t2_timer_expire), \ |
841 | } | 816 | } |
842 | 817 | ||
843 | #define TYPE_SCTP_EVENT_TIMEOUT_T3_RTX { \ | 818 | #define TYPE_SCTP_EVENT_TIMEOUT_T3_RTX { \ |
844 | /* SCTP_STATE_EMPTY */ \ | 819 | /* SCTP_STATE_EMPTY */ \ |
845 | {.fn = sctp_sf_bug, .name = "sctp_sf_bug"}, \ | 820 | TYPE_SCTP_FUNC(sctp_sf_bug), \ |
846 | /* SCTP_STATE_CLOSED */ \ | 821 | /* SCTP_STATE_CLOSED */ \ |
847 | {.fn = sctp_sf_timer_ignore, .name = "sctp_sf_timer_ignore"}, \ | 822 | TYPE_SCTP_FUNC(sctp_sf_timer_ignore), \ |
848 | /* SCTP_STATE_COOKIE_WAIT */ \ | 823 | /* SCTP_STATE_COOKIE_WAIT */ \ |
849 | {.fn = sctp_sf_timer_ignore, .name = "sctp_sf_timer_ignore"}, \ | 824 | TYPE_SCTP_FUNC(sctp_sf_timer_ignore), \ |
850 | /* SCTP_STATE_COOKIE_ECHOED */ \ | 825 | /* SCTP_STATE_COOKIE_ECHOED */ \ |
851 | {.fn = sctp_sf_do_6_3_3_rtx, .name = "sctp_sf_do_6_3_3_rtx"}, \ | 826 | TYPE_SCTP_FUNC(sctp_sf_do_6_3_3_rtx), \ |
852 | /* SCTP_STATE_ESTABLISHED */ \ | 827 | /* SCTP_STATE_ESTABLISHED */ \ |
853 | {.fn = sctp_sf_do_6_3_3_rtx, .name = "sctp_sf_do_6_3_3_rtx"}, \ | 828 | TYPE_SCTP_FUNC(sctp_sf_do_6_3_3_rtx), \ |
854 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ | 829 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ |
855 | {.fn = sctp_sf_do_6_3_3_rtx, .name = "sctp_sf_do_6_3_3_rtx"}, \ | 830 | TYPE_SCTP_FUNC(sctp_sf_do_6_3_3_rtx), \ |
856 | /* SCTP_STATE_SHUTDOWN_SENT */ \ | 831 | /* SCTP_STATE_SHUTDOWN_SENT */ \ |
857 | {.fn = sctp_sf_timer_ignore, .name = "sctp_sf_timer_ignore"}, \ | 832 | TYPE_SCTP_FUNC(sctp_sf_timer_ignore), \ |
858 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ | 833 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ |
859 | {.fn = sctp_sf_do_6_3_3_rtx, .name = "sctp_sf_do_6_3_3_rtx"}, \ | 834 | TYPE_SCTP_FUNC(sctp_sf_do_6_3_3_rtx), \ |
860 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ | 835 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ |
861 | {.fn = sctp_sf_timer_ignore, .name = "sctp_sf_timer_ignore"}, \ | 836 | TYPE_SCTP_FUNC(sctp_sf_timer_ignore), \ |
862 | } | 837 | } |
863 | 838 | ||
864 | #define TYPE_SCTP_EVENT_TIMEOUT_T4_RTO { \ | 839 | #define TYPE_SCTP_EVENT_TIMEOUT_T4_RTO { \ |
865 | /* SCTP_STATE_EMPTY */ \ | 840 | /* SCTP_STATE_EMPTY */ \ |
866 | {.fn = sctp_sf_bug, .name = "sctp_sf_bug"}, \ | 841 | TYPE_SCTP_FUNC(sctp_sf_bug), \ |
867 | /* SCTP_STATE_CLOSED */ \ | 842 | /* SCTP_STATE_CLOSED */ \ |
868 | {.fn = sctp_sf_timer_ignore, .name = "sctp_sf_timer_ignore"}, \ | 843 | TYPE_SCTP_FUNC(sctp_sf_timer_ignore), \ |
869 | /* SCTP_STATE_COOKIE_WAIT */ \ | 844 | /* SCTP_STATE_COOKIE_WAIT */ \ |
870 | {.fn = sctp_sf_timer_ignore, .name = "sctp_sf_timer_ignore"}, \ | 845 | TYPE_SCTP_FUNC(sctp_sf_timer_ignore), \ |
871 | /* SCTP_STATE_COOKIE_ECHOED */ \ | 846 | /* SCTP_STATE_COOKIE_ECHOED */ \ |
872 | {.fn = sctp_sf_timer_ignore, .name = "sctp_sf_timer_ignore"}, \ | 847 | TYPE_SCTP_FUNC(sctp_sf_timer_ignore), \ |
873 | /* SCTP_STATE_ESTABLISHED */ \ | 848 | /* SCTP_STATE_ESTABLISHED */ \ |
874 | {.fn = sctp_sf_t4_timer_expire, .name = "sctp_sf_t4_timer_expire"}, \ | 849 | TYPE_SCTP_FUNC(sctp_sf_t4_timer_expire), \ |
875 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ | 850 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ |
876 | {.fn = sctp_sf_timer_ignore, .name = "sctp_sf_timer_ignore"}, \ | 851 | TYPE_SCTP_FUNC(sctp_sf_timer_ignore), \ |
877 | /* SCTP_STATE_SHUTDOWN_SENT */ \ | 852 | /* SCTP_STATE_SHUTDOWN_SENT */ \ |
878 | {.fn = sctp_sf_timer_ignore, .name = "sctp_sf_timer_ignore"}, \ | 853 | TYPE_SCTP_FUNC(sctp_sf_timer_ignore), \ |
879 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ | 854 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ |
880 | {.fn = sctp_sf_timer_ignore, .name = "sctp_sf_timer_ignore"}, \ | 855 | TYPE_SCTP_FUNC(sctp_sf_timer_ignore), \ |
881 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ | 856 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ |
882 | {.fn = sctp_sf_timer_ignore, .name = "sctp_sf_timer_ignore"}, \ | 857 | TYPE_SCTP_FUNC(sctp_sf_timer_ignore), \ |
883 | } | 858 | } |
884 | 859 | ||
885 | #define TYPE_SCTP_EVENT_TIMEOUT_T5_SHUTDOWN_GUARD { \ | 860 | #define TYPE_SCTP_EVENT_TIMEOUT_T5_SHUTDOWN_GUARD { \ |
886 | /* SCTP_STATE_EMPTY */ \ | 861 | /* SCTP_STATE_EMPTY */ \ |
887 | {.fn = sctp_sf_bug, .name = "sctp_sf_bug"}, \ | 862 | TYPE_SCTP_FUNC(sctp_sf_bug), \ |
888 | /* SCTP_STATE_CLOSED */ \ | 863 | /* SCTP_STATE_CLOSED */ \ |
889 | {.fn = sctp_sf_timer_ignore, .name = "sctp_sf_timer_ignore"}, \ | 864 | TYPE_SCTP_FUNC(sctp_sf_timer_ignore), \ |
890 | /* SCTP_STATE_COOKIE_WAIT */ \ | 865 | /* SCTP_STATE_COOKIE_WAIT */ \ |
891 | {.fn = sctp_sf_timer_ignore, .name = "sctp_sf_timer_ignore"}, \ | 866 | TYPE_SCTP_FUNC(sctp_sf_timer_ignore), \ |
892 | /* SCTP_STATE_COOKIE_ECHOED */ \ | 867 | /* SCTP_STATE_COOKIE_ECHOED */ \ |
893 | {.fn = sctp_sf_timer_ignore, .name = "sctp_sf_timer_ignore"}, \ | 868 | TYPE_SCTP_FUNC(sctp_sf_timer_ignore), \ |
894 | /* SCTP_STATE_ESTABLISHED */ \ | 869 | /* SCTP_STATE_ESTABLISHED */ \ |
895 | {.fn = sctp_sf_timer_ignore, .name = "sctp_sf_timer_ignore"}, \ | 870 | TYPE_SCTP_FUNC(sctp_sf_timer_ignore), \ |
896 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ | 871 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ |
897 | {.fn = sctp_sf_t5_timer_expire, .name = "sctp_sf_t5_timer_expire"}, \ | 872 | TYPE_SCTP_FUNC(sctp_sf_t5_timer_expire), \ |
898 | /* SCTP_STATE_SHUTDOWN_SENT */ \ | 873 | /* SCTP_STATE_SHUTDOWN_SENT */ \ |
899 | {.fn = sctp_sf_t5_timer_expire, .name = "sctp_sf_t5_timer_expire"}, \ | 874 | TYPE_SCTP_FUNC(sctp_sf_t5_timer_expire), \ |
900 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ | 875 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ |
901 | {.fn = sctp_sf_timer_ignore, .name = "sctp_sf_timer_ignore"}, \ | 876 | TYPE_SCTP_FUNC(sctp_sf_timer_ignore), \ |
902 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ | 877 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ |
903 | {.fn = sctp_sf_timer_ignore, .name = "sctp_sf_timer_ignore"}, \ | 878 | TYPE_SCTP_FUNC(sctp_sf_timer_ignore), \ |
904 | } | 879 | } |
905 | 880 | ||
906 | #define TYPE_SCTP_EVENT_TIMEOUT_HEARTBEAT { \ | 881 | #define TYPE_SCTP_EVENT_TIMEOUT_HEARTBEAT { \ |
907 | /* SCTP_STATE_EMPTY */ \ | 882 | /* SCTP_STATE_EMPTY */ \ |
908 | {.fn = sctp_sf_bug, .name = "sctp_sf_bug"}, \ | 883 | TYPE_SCTP_FUNC(sctp_sf_bug), \ |
909 | /* SCTP_STATE_CLOSED */ \ | 884 | /* SCTP_STATE_CLOSED */ \ |
910 | {.fn = sctp_sf_timer_ignore, .name = "sctp_sf_timer_ignore"}, \ | 885 | TYPE_SCTP_FUNC(sctp_sf_timer_ignore), \ |
911 | /* SCTP_STATE_COOKIE_WAIT */ \ | 886 | /* SCTP_STATE_COOKIE_WAIT */ \ |
912 | {.fn = sctp_sf_timer_ignore, .name = "sctp_sf_timer_ignore"}, \ | 887 | TYPE_SCTP_FUNC(sctp_sf_timer_ignore), \ |
913 | /* SCTP_STATE_COOKIE_ECHOED */ \ | 888 | /* SCTP_STATE_COOKIE_ECHOED */ \ |
914 | {.fn = sctp_sf_timer_ignore, .name = "sctp_sf_timer_ignore"}, \ | 889 | TYPE_SCTP_FUNC(sctp_sf_timer_ignore), \ |
915 | /* SCTP_STATE_ESTABLISHED */ \ | 890 | /* SCTP_STATE_ESTABLISHED */ \ |
916 | {.fn = sctp_sf_sendbeat_8_3, .name = "sctp_sf_sendbeat_8_3"}, \ | 891 | TYPE_SCTP_FUNC(sctp_sf_sendbeat_8_3), \ |
917 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ | 892 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ |
918 | {.fn = sctp_sf_sendbeat_8_3, .name = "sctp_sf_sendbeat_8_3"}, \ | 893 | TYPE_SCTP_FUNC(sctp_sf_sendbeat_8_3), \ |
919 | /* SCTP_STATE_SHUTDOWN_SENT */ \ | 894 | /* SCTP_STATE_SHUTDOWN_SENT */ \ |
920 | {.fn = sctp_sf_timer_ignore, .name = "sctp_sf_timer_ignore"}, \ | 895 | TYPE_SCTP_FUNC(sctp_sf_timer_ignore), \ |
921 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ | 896 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ |
922 | {.fn = sctp_sf_sendbeat_8_3, .name = "sctp_sf_sendbeat_8_3"}, \ | 897 | TYPE_SCTP_FUNC(sctp_sf_sendbeat_8_3), \ |
923 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ | 898 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ |
924 | {.fn = sctp_sf_timer_ignore, .name = "sctp_sf_timer_ignore"}, \ | 899 | TYPE_SCTP_FUNC(sctp_sf_timer_ignore), \ |
925 | } | 900 | } |
926 | 901 | ||
927 | #define TYPE_SCTP_EVENT_TIMEOUT_SACK { \ | 902 | #define TYPE_SCTP_EVENT_TIMEOUT_SACK { \ |
928 | /* SCTP_STATE_EMPTY */ \ | 903 | /* SCTP_STATE_EMPTY */ \ |
929 | {.fn = sctp_sf_bug, .name = "sctp_sf_bug"}, \ | 904 | TYPE_SCTP_FUNC(sctp_sf_bug), \ |
930 | /* SCTP_STATE_CLOSED */ \ | 905 | /* SCTP_STATE_CLOSED */ \ |
931 | {.fn = sctp_sf_timer_ignore, .name = "sctp_sf_timer_ignore"}, \ | 906 | TYPE_SCTP_FUNC(sctp_sf_timer_ignore), \ |
932 | /* SCTP_STATE_COOKIE_WAIT */ \ | 907 | /* SCTP_STATE_COOKIE_WAIT */ \ |
933 | {.fn = sctp_sf_timer_ignore, .name = "sctp_sf_timer_ignore"}, \ | 908 | TYPE_SCTP_FUNC(sctp_sf_timer_ignore), \ |
934 | /* SCTP_STATE_COOKIE_ECHOED */ \ | 909 | /* SCTP_STATE_COOKIE_ECHOED */ \ |
935 | {.fn = sctp_sf_timer_ignore, .name = "sctp_sf_timer_ignore"}, \ | 910 | TYPE_SCTP_FUNC(sctp_sf_timer_ignore), \ |
936 | /* SCTP_STATE_ESTABLISHED */ \ | 911 | /* SCTP_STATE_ESTABLISHED */ \ |
937 | {.fn = sctp_sf_do_6_2_sack, .name = "sctp_sf_do_6_2_sack"}, \ | 912 | TYPE_SCTP_FUNC(sctp_sf_do_6_2_sack), \ |
938 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ | 913 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ |
939 | {.fn = sctp_sf_do_6_2_sack, .name = "sctp_sf_do_6_2_sack"}, \ | 914 | TYPE_SCTP_FUNC(sctp_sf_do_6_2_sack), \ |
940 | /* SCTP_STATE_SHUTDOWN_SENT */ \ | 915 | /* SCTP_STATE_SHUTDOWN_SENT */ \ |
941 | {.fn = sctp_sf_do_6_2_sack, .name = "sctp_sf_do_6_2_sack"}, \ | 916 | TYPE_SCTP_FUNC(sctp_sf_do_6_2_sack), \ |
942 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ | 917 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ |
943 | {.fn = sctp_sf_timer_ignore, .name = "sctp_sf_timer_ignore"}, \ | 918 | TYPE_SCTP_FUNC(sctp_sf_timer_ignore), \ |
944 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ | 919 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ |
945 | {.fn = sctp_sf_timer_ignore, .name = "sctp_sf_timer_ignore"}, \ | 920 | TYPE_SCTP_FUNC(sctp_sf_timer_ignore), \ |
946 | } | 921 | } |
947 | 922 | ||
948 | #define TYPE_SCTP_EVENT_TIMEOUT_AUTOCLOSE { \ | 923 | #define TYPE_SCTP_EVENT_TIMEOUT_AUTOCLOSE { \ |
949 | /* SCTP_STATE_EMPTY */ \ | 924 | /* SCTP_STATE_EMPTY */ \ |
950 | {.fn = sctp_sf_timer_ignore, .name = "sctp_sf_timer_ignore"}, \ | 925 | TYPE_SCTP_FUNC(sctp_sf_timer_ignore), \ |
951 | /* SCTP_STATE_CLOSED */ \ | 926 | /* SCTP_STATE_CLOSED */ \ |
952 | {.fn = sctp_sf_timer_ignore, .name = "sctp_sf_timer_ignore"}, \ | 927 | TYPE_SCTP_FUNC(sctp_sf_timer_ignore), \ |
953 | /* SCTP_STATE_COOKIE_WAIT */ \ | 928 | /* SCTP_STATE_COOKIE_WAIT */ \ |
954 | {.fn = sctp_sf_timer_ignore, .name = "sctp_sf_timer_ignore"}, \ | 929 | TYPE_SCTP_FUNC(sctp_sf_timer_ignore), \ |
955 | /* SCTP_STATE_COOKIE_ECHOED */ \ | 930 | /* SCTP_STATE_COOKIE_ECHOED */ \ |
956 | {.fn = sctp_sf_timer_ignore, .name = "sctp_sf_timer_ignore"}, \ | 931 | TYPE_SCTP_FUNC(sctp_sf_timer_ignore), \ |
957 | /* SCTP_STATE_ESTABLISHED */ \ | 932 | /* SCTP_STATE_ESTABLISHED */ \ |
958 | {.fn = sctp_sf_autoclose_timer_expire, \ | 933 | TYPE_SCTP_FUNC(sctp_sf_autoclose_timer_expire), \ |
959 | .name = "sctp_sf_autoclose_timer_expire"}, \ | ||
960 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ | 934 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ |
961 | {.fn = sctp_sf_timer_ignore, .name = "sctp_sf_timer_ignore"}, \ | 935 | TYPE_SCTP_FUNC(sctp_sf_timer_ignore), \ |
962 | /* SCTP_STATE_SHUTDOWN_SENT */ \ | 936 | /* SCTP_STATE_SHUTDOWN_SENT */ \ |
963 | {.fn = sctp_sf_timer_ignore, .name = "sctp_sf_timer_ignore"}, \ | 937 | TYPE_SCTP_FUNC(sctp_sf_timer_ignore), \ |
964 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ | 938 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ |
965 | {.fn = sctp_sf_timer_ignore, .name = "sctp_sf_timer_ignore"}, \ | 939 | TYPE_SCTP_FUNC(sctp_sf_timer_ignore), \ |
966 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ | 940 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ |
967 | {.fn = sctp_sf_timer_ignore, .name = "sctp_sf_timer_ignore"}, \ | 941 | TYPE_SCTP_FUNC(sctp_sf_timer_ignore), \ |
968 | } | 942 | } |
969 | 943 | ||
970 | static const sctp_sm_table_entry_t timeout_event_table[SCTP_NUM_TIMEOUT_TYPES][SCTP_STATE_NUM_STATES] = { | 944 | static const sctp_sm_table_entry_t timeout_event_table[SCTP_NUM_TIMEOUT_TYPES][SCTP_STATE_NUM_STATES] = { |
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index 935bc9187fd8..02b27145b279 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c | |||
@@ -229,11 +229,9 @@ static struct sctp_transport *sctp_addr_id2transport(struct sock *sk, | |||
229 | struct sctp_transport *transport; | 229 | struct sctp_transport *transport; |
230 | union sctp_addr *laddr = (union sctp_addr *)addr; | 230 | union sctp_addr *laddr = (union sctp_addr *)addr; |
231 | 231 | ||
232 | laddr->v4.sin_port = ntohs(laddr->v4.sin_port); | ||
233 | addr_asoc = sctp_endpoint_lookup_assoc(sctp_sk(sk)->ep, | 232 | addr_asoc = sctp_endpoint_lookup_assoc(sctp_sk(sk)->ep, |
234 | (union sctp_addr *)addr, | 233 | laddr, |
235 | &transport); | 234 | &transport); |
236 | laddr->v4.sin_port = htons(laddr->v4.sin_port); | ||
237 | 235 | ||
238 | if (!addr_asoc) | 236 | if (!addr_asoc) |
239 | return NULL; | 237 | return NULL; |
@@ -368,9 +366,7 @@ SCTP_STATIC int sctp_do_bind(struct sock *sk, union sctp_addr *addr, int len) | |||
368 | sctp_write_lock(&ep->base.addr_lock); | 366 | sctp_write_lock(&ep->base.addr_lock); |
369 | 367 | ||
370 | /* Use GFP_ATOMIC since BHs are disabled. */ | 368 | /* Use GFP_ATOMIC since BHs are disabled. */ |
371 | addr->v4.sin_port = ntohs(addr->v4.sin_port); | ||
372 | ret = sctp_add_bind_addr(bp, addr, 1, GFP_ATOMIC); | 369 | ret = sctp_add_bind_addr(bp, addr, 1, GFP_ATOMIC); |
373 | addr->v4.sin_port = htons(addr->v4.sin_port); | ||
374 | sctp_write_unlock(&ep->base.addr_lock); | 370 | sctp_write_unlock(&ep->base.addr_lock); |
375 | sctp_local_bh_enable(); | 371 | sctp_local_bh_enable(); |
376 | 372 | ||
@@ -572,7 +568,6 @@ static int sctp_send_asconf_add_ip(struct sock *sk, | |||
572 | addr = (union sctp_addr *)addr_buf; | 568 | addr = (union sctp_addr *)addr_buf; |
573 | af = sctp_get_af_specific(addr->v4.sin_family); | 569 | af = sctp_get_af_specific(addr->v4.sin_family); |
574 | memcpy(&saveaddr, addr, af->sockaddr_len); | 570 | memcpy(&saveaddr, addr, af->sockaddr_len); |
575 | saveaddr.v4.sin_port = ntohs(saveaddr.v4.sin_port); | ||
576 | retval = sctp_add_bind_addr(bp, &saveaddr, 0, | 571 | retval = sctp_add_bind_addr(bp, &saveaddr, 0, |
577 | GFP_ATOMIC); | 572 | GFP_ATOMIC); |
578 | addr_buf += af->sockaddr_len; | 573 | addr_buf += af->sockaddr_len; |
@@ -607,9 +602,8 @@ int sctp_bindx_rem(struct sock *sk, struct sockaddr *addrs, int addrcnt) | |||
607 | int cnt; | 602 | int cnt; |
608 | struct sctp_bind_addr *bp = &ep->base.bind_addr; | 603 | struct sctp_bind_addr *bp = &ep->base.bind_addr; |
609 | int retval = 0; | 604 | int retval = 0; |
610 | union sctp_addr saveaddr; | ||
611 | void *addr_buf; | 605 | void *addr_buf; |
612 | struct sockaddr *sa_addr; | 606 | union sctp_addr *sa_addr; |
613 | struct sctp_af *af; | 607 | struct sctp_af *af; |
614 | 608 | ||
615 | SCTP_DEBUG_PRINTK("sctp_bindx_rem (sk: %p, addrs: %p, addrcnt: %d)\n", | 609 | SCTP_DEBUG_PRINTK("sctp_bindx_rem (sk: %p, addrs: %p, addrcnt: %d)\n", |
@@ -627,19 +621,13 @@ int sctp_bindx_rem(struct sock *sk, struct sockaddr *addrs, int addrcnt) | |||
627 | goto err_bindx_rem; | 621 | goto err_bindx_rem; |
628 | } | 622 | } |
629 | 623 | ||
630 | /* The list may contain either IPv4 or IPv6 address; | 624 | sa_addr = (union sctp_addr *)addr_buf; |
631 | * determine the address length to copy the address to | 625 | af = sctp_get_af_specific(sa_addr->sa.sa_family); |
632 | * saveaddr. | ||
633 | */ | ||
634 | sa_addr = (struct sockaddr *)addr_buf; | ||
635 | af = sctp_get_af_specific(sa_addr->sa_family); | ||
636 | if (!af) { | 626 | if (!af) { |
637 | retval = -EINVAL; | 627 | retval = -EINVAL; |
638 | goto err_bindx_rem; | 628 | goto err_bindx_rem; |
639 | } | 629 | } |
640 | memcpy(&saveaddr, sa_addr, af->sockaddr_len); | 630 | if (sa_addr->v4.sin_port != htons(bp->port)) { |
641 | saveaddr.v4.sin_port = ntohs(saveaddr.v4.sin_port); | ||
642 | if (saveaddr.v4.sin_port != bp->port) { | ||
643 | retval = -EINVAL; | 631 | retval = -EINVAL; |
644 | goto err_bindx_rem; | 632 | goto err_bindx_rem; |
645 | } | 633 | } |
@@ -654,7 +642,7 @@ int sctp_bindx_rem(struct sock *sk, struct sockaddr *addrs, int addrcnt) | |||
654 | sctp_local_bh_disable(); | 642 | sctp_local_bh_disable(); |
655 | sctp_write_lock(&ep->base.addr_lock); | 643 | sctp_write_lock(&ep->base.addr_lock); |
656 | 644 | ||
657 | retval = sctp_del_bind_addr(bp, &saveaddr); | 645 | retval = sctp_del_bind_addr(bp, sa_addr); |
658 | 646 | ||
659 | sctp_write_unlock(&ep->base.addr_lock); | 647 | sctp_write_unlock(&ep->base.addr_lock); |
660 | sctp_local_bh_enable(); | 648 | sctp_local_bh_enable(); |
@@ -693,7 +681,6 @@ static int sctp_send_asconf_del_ip(struct sock *sk, | |||
693 | struct sctp_bind_addr *bp; | 681 | struct sctp_bind_addr *bp; |
694 | struct sctp_chunk *chunk; | 682 | struct sctp_chunk *chunk; |
695 | union sctp_addr *laddr; | 683 | union sctp_addr *laddr; |
696 | union sctp_addr saveaddr; | ||
697 | void *addr_buf; | 684 | void *addr_buf; |
698 | struct sctp_af *af; | 685 | struct sctp_af *af; |
699 | struct list_head *pos, *pos1; | 686 | struct list_head *pos, *pos1; |
@@ -773,13 +760,11 @@ static int sctp_send_asconf_del_ip(struct sock *sk, | |||
773 | for (i = 0; i < addrcnt; i++) { | 760 | for (i = 0; i < addrcnt; i++) { |
774 | laddr = (union sctp_addr *)addr_buf; | 761 | laddr = (union sctp_addr *)addr_buf; |
775 | af = sctp_get_af_specific(laddr->v4.sin_family); | 762 | af = sctp_get_af_specific(laddr->v4.sin_family); |
776 | memcpy(&saveaddr, laddr, af->sockaddr_len); | ||
777 | saveaddr.v4.sin_port = ntohs(saveaddr.v4.sin_port); | ||
778 | list_for_each(pos1, &bp->address_list) { | 763 | list_for_each(pos1, &bp->address_list) { |
779 | saddr = list_entry(pos1, | 764 | saddr = list_entry(pos1, |
780 | struct sctp_sockaddr_entry, | 765 | struct sctp_sockaddr_entry, |
781 | list); | 766 | list); |
782 | if (sctp_cmp_addr_exact(&saddr->a, &saveaddr)) | 767 | if (sctp_cmp_addr_exact(&saddr->a, laddr)) |
783 | saddr->use_as_src = 0; | 768 | saddr->use_as_src = 0; |
784 | } | 769 | } |
785 | addr_buf += af->sockaddr_len; | 770 | addr_buf += af->sockaddr_len; |
@@ -979,7 +964,7 @@ static int __sctp_connect(struct sock* sk, | |||
979 | int err = 0; | 964 | int err = 0; |
980 | int addrcnt = 0; | 965 | int addrcnt = 0; |
981 | int walk_size = 0; | 966 | int walk_size = 0; |
982 | struct sockaddr *sa_addr; | 967 | union sctp_addr *sa_addr; |
983 | void *addr_buf; | 968 | void *addr_buf; |
984 | 969 | ||
985 | sp = sctp_sk(sk); | 970 | sp = sctp_sk(sk); |
@@ -999,8 +984,8 @@ static int __sctp_connect(struct sock* sk, | |||
999 | /* Walk through the addrs buffer and count the number of addresses. */ | 984 | /* Walk through the addrs buffer and count the number of addresses. */ |
1000 | addr_buf = kaddrs; | 985 | addr_buf = kaddrs; |
1001 | while (walk_size < addrs_size) { | 986 | while (walk_size < addrs_size) { |
1002 | sa_addr = (struct sockaddr *)addr_buf; | 987 | sa_addr = (union sctp_addr *)addr_buf; |
1003 | af = sctp_get_af_specific(sa_addr->sa_family); | 988 | af = sctp_get_af_specific(sa_addr->sa.sa_family); |
1004 | 989 | ||
1005 | /* If the address family is not supported or if this address | 990 | /* If the address family is not supported or if this address |
1006 | * causes the address buffer to overflow return EINVAL. | 991 | * causes the address buffer to overflow return EINVAL. |
@@ -1010,18 +995,16 @@ static int __sctp_connect(struct sock* sk, | |||
1010 | goto out_free; | 995 | goto out_free; |
1011 | } | 996 | } |
1012 | 997 | ||
1013 | err = sctp_verify_addr(sk, (union sctp_addr *)sa_addr, | 998 | err = sctp_verify_addr(sk, sa_addr, af->sockaddr_len); |
1014 | af->sockaddr_len); | ||
1015 | if (err) | 999 | if (err) |
1016 | goto out_free; | 1000 | goto out_free; |
1017 | 1001 | ||
1018 | memcpy(&to, sa_addr, af->sockaddr_len); | 1002 | memcpy(&to, sa_addr, af->sockaddr_len); |
1019 | to.v4.sin_port = ntohs(to.v4.sin_port); | ||
1020 | 1003 | ||
1021 | /* Check if there already is a matching association on the | 1004 | /* Check if there already is a matching association on the |
1022 | * endpoint (other than the one created here). | 1005 | * endpoint (other than the one created here). |
1023 | */ | 1006 | */ |
1024 | asoc2 = sctp_endpoint_lookup_assoc(ep, &to, &transport); | 1007 | asoc2 = sctp_endpoint_lookup_assoc(ep, sa_addr, &transport); |
1025 | if (asoc2 && asoc2 != asoc) { | 1008 | if (asoc2 && asoc2 != asoc) { |
1026 | if (asoc2->state >= SCTP_STATE_ESTABLISHED) | 1009 | if (asoc2->state >= SCTP_STATE_ESTABLISHED) |
1027 | err = -EISCONN; | 1010 | err = -EISCONN; |
@@ -1034,7 +1017,7 @@ static int __sctp_connect(struct sock* sk, | |||
1034 | * make sure that there is no peeled-off association matching | 1017 | * make sure that there is no peeled-off association matching |
1035 | * the peer address even on another socket. | 1018 | * the peer address even on another socket. |
1036 | */ | 1019 | */ |
1037 | if (sctp_endpoint_is_peeled_off(ep, &to)) { | 1020 | if (sctp_endpoint_is_peeled_off(ep, sa_addr)) { |
1038 | err = -EADDRNOTAVAIL; | 1021 | err = -EADDRNOTAVAIL; |
1039 | goto out_free; | 1022 | goto out_free; |
1040 | } | 1023 | } |
@@ -1065,7 +1048,7 @@ static int __sctp_connect(struct sock* sk, | |||
1065 | } | 1048 | } |
1066 | } | 1049 | } |
1067 | 1050 | ||
1068 | scope = sctp_scope(&to); | 1051 | scope = sctp_scope(sa_addr); |
1069 | asoc = sctp_association_new(ep, sk, scope, GFP_KERNEL); | 1052 | asoc = sctp_association_new(ep, sk, scope, GFP_KERNEL); |
1070 | if (!asoc) { | 1053 | if (!asoc) { |
1071 | err = -ENOMEM; | 1054 | err = -ENOMEM; |
@@ -1074,7 +1057,7 @@ static int __sctp_connect(struct sock* sk, | |||
1074 | } | 1057 | } |
1075 | 1058 | ||
1076 | /* Prime the peer's transport structures. */ | 1059 | /* Prime the peer's transport structures. */ |
1077 | transport = sctp_assoc_add_peer(asoc, &to, GFP_KERNEL, | 1060 | transport = sctp_assoc_add_peer(asoc, sa_addr, GFP_KERNEL, |
1078 | SCTP_UNKNOWN); | 1061 | SCTP_UNKNOWN); |
1079 | if (!transport) { | 1062 | if (!transport) { |
1080 | err = -ENOMEM; | 1063 | err = -ENOMEM; |
@@ -1427,11 +1410,6 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk, | |||
1427 | if (msg_namelen > sizeof(to)) | 1410 | if (msg_namelen > sizeof(to)) |
1428 | msg_namelen = sizeof(to); | 1411 | msg_namelen = sizeof(to); |
1429 | memcpy(&to, msg->msg_name, msg_namelen); | 1412 | memcpy(&to, msg->msg_name, msg_namelen); |
1430 | SCTP_DEBUG_PRINTK("Just memcpy'd. msg_name is " | ||
1431 | "0x%x:%u.\n", | ||
1432 | to.v4.sin_addr.s_addr, to.v4.sin_port); | ||
1433 | |||
1434 | to.v4.sin_port = ntohs(to.v4.sin_port); | ||
1435 | msg_name = msg->msg_name; | 1413 | msg_name = msg->msg_name; |
1436 | } | 1414 | } |
1437 | 1415 | ||
@@ -3217,8 +3195,8 @@ static int sctp_getsockopt_sctp_status(struct sock *sk, int len, | |||
3217 | status.sstat_outstrms = asoc->c.sinit_num_ostreams; | 3195 | status.sstat_outstrms = asoc->c.sinit_num_ostreams; |
3218 | status.sstat_fragmentation_point = asoc->frag_point; | 3196 | status.sstat_fragmentation_point = asoc->frag_point; |
3219 | status.sstat_primary.spinfo_assoc_id = sctp_assoc2id(transport->asoc); | 3197 | status.sstat_primary.spinfo_assoc_id = sctp_assoc2id(transport->asoc); |
3220 | memcpy(&status.sstat_primary.spinfo_address, | 3198 | memcpy(&status.sstat_primary.spinfo_address, &transport->ipaddr, |
3221 | &(transport->ipaddr), sizeof(union sctp_addr)); | 3199 | transport->af_specific->sockaddr_len); |
3222 | /* Map ipv4 address into v4-mapped-on-v6 address. */ | 3200 | /* Map ipv4 address into v4-mapped-on-v6 address. */ |
3223 | sctp_get_pf_specific(sk->sk_family)->addr_v4map(sctp_sk(sk), | 3201 | sctp_get_pf_specific(sk->sk_family)->addr_v4map(sctp_sk(sk), |
3224 | (union sctp_addr *)&status.sstat_primary.spinfo_address); | 3202 | (union sctp_addr *)&status.sstat_primary.spinfo_address); |
@@ -3770,7 +3748,6 @@ static int sctp_getsockopt_peer_addrs_old(struct sock *sk, int len, | |||
3770 | memcpy(&temp, &from->ipaddr, sizeof(temp)); | 3748 | memcpy(&temp, &from->ipaddr, sizeof(temp)); |
3771 | sctp_get_pf_specific(sk->sk_family)->addr_v4map(sp, &temp); | 3749 | sctp_get_pf_specific(sk->sk_family)->addr_v4map(sp, &temp); |
3772 | addrlen = sctp_get_af_specific(sk->sk_family)->sockaddr_len; | 3750 | addrlen = sctp_get_af_specific(sk->sk_family)->sockaddr_len; |
3773 | temp.v4.sin_port = htons(temp.v4.sin_port); | ||
3774 | if (copy_to_user(to, &temp, addrlen)) | 3751 | if (copy_to_user(to, &temp, addrlen)) |
3775 | return -EFAULT; | 3752 | return -EFAULT; |
3776 | to += addrlen ; | 3753 | to += addrlen ; |
@@ -3821,7 +3798,6 @@ static int sctp_getsockopt_peer_addrs(struct sock *sk, int len, | |||
3821 | addrlen = sctp_get_af_specific(sk->sk_family)->sockaddr_len; | 3798 | addrlen = sctp_get_af_specific(sk->sk_family)->sockaddr_len; |
3822 | if(space_left < addrlen) | 3799 | if(space_left < addrlen) |
3823 | return -ENOMEM; | 3800 | return -ENOMEM; |
3824 | temp.v4.sin_port = htons(temp.v4.sin_port); | ||
3825 | if (copy_to_user(to, &temp, addrlen)) | 3801 | if (copy_to_user(to, &temp, addrlen)) |
3826 | return -EFAULT; | 3802 | return -EFAULT; |
3827 | to += addrlen; | 3803 | to += addrlen; |
@@ -3889,7 +3865,7 @@ static int sctp_getsockopt_local_addrs_num_old(struct sock *sk, int len, | |||
3889 | struct sctp_sockaddr_entry, | 3865 | struct sctp_sockaddr_entry, |
3890 | list); | 3866 | list); |
3891 | if ((PF_INET == sk->sk_family) && | 3867 | if ((PF_INET == sk->sk_family) && |
3892 | (AF_INET6 == addr->a.sa.sa_family)) | 3868 | (AF_INET6 == addr->a.sa.sa_family)) |
3893 | continue; | 3869 | continue; |
3894 | cnt++; | 3870 | cnt++; |
3895 | } | 3871 | } |
@@ -3933,7 +3909,6 @@ static int sctp_copy_laddrs_to_user_old(struct sock *sk, __u16 port, int max_add | |||
3933 | sctp_get_pf_specific(sk->sk_family)->addr_v4map(sctp_sk(sk), | 3909 | sctp_get_pf_specific(sk->sk_family)->addr_v4map(sctp_sk(sk), |
3934 | &temp); | 3910 | &temp); |
3935 | addrlen = sctp_get_af_specific(temp.sa.sa_family)->sockaddr_len; | 3911 | addrlen = sctp_get_af_specific(temp.sa.sa_family)->sockaddr_len; |
3936 | temp.v4.sin_port = htons(port); | ||
3937 | if (copy_to_user(to, &temp, addrlen)) { | 3912 | if (copy_to_user(to, &temp, addrlen)) { |
3938 | sctp_spin_unlock_irqrestore(&sctp_local_addr_lock, | 3913 | sctp_spin_unlock_irqrestore(&sctp_local_addr_lock, |
3939 | flags); | 3914 | flags); |
@@ -3970,7 +3945,6 @@ static int sctp_copy_laddrs_to_user(struct sock *sk, __u16 port, | |||
3970 | addrlen = sctp_get_af_specific(temp.sa.sa_family)->sockaddr_len; | 3945 | addrlen = sctp_get_af_specific(temp.sa.sa_family)->sockaddr_len; |
3971 | if(space_left<addrlen) | 3946 | if(space_left<addrlen) |
3972 | return -ENOMEM; | 3947 | return -ENOMEM; |
3973 | temp.v4.sin_port = htons(port); | ||
3974 | if (copy_to_user(*to, &temp, addrlen)) { | 3948 | if (copy_to_user(*to, &temp, addrlen)) { |
3975 | sctp_spin_unlock_irqrestore(&sctp_local_addr_lock, | 3949 | sctp_spin_unlock_irqrestore(&sctp_local_addr_lock, |
3976 | flags); | 3950 | flags); |
@@ -4055,7 +4029,6 @@ static int sctp_getsockopt_local_addrs_old(struct sock *sk, int len, | |||
4055 | memcpy(&temp, &addr->a, sizeof(temp)); | 4029 | memcpy(&temp, &addr->a, sizeof(temp)); |
4056 | sctp_get_pf_specific(sk->sk_family)->addr_v4map(sp, &temp); | 4030 | sctp_get_pf_specific(sk->sk_family)->addr_v4map(sp, &temp); |
4057 | addrlen = sctp_get_af_specific(temp.sa.sa_family)->sockaddr_len; | 4031 | addrlen = sctp_get_af_specific(temp.sa.sa_family)->sockaddr_len; |
4058 | temp.v4.sin_port = htons(temp.v4.sin_port); | ||
4059 | if (copy_to_user(to, &temp, addrlen)) { | 4032 | if (copy_to_user(to, &temp, addrlen)) { |
4060 | err = -EFAULT; | 4033 | err = -EFAULT; |
4061 | goto unlock; | 4034 | goto unlock; |
@@ -4146,7 +4119,6 @@ static int sctp_getsockopt_local_addrs(struct sock *sk, int len, | |||
4146 | addrlen = sctp_get_af_specific(temp.sa.sa_family)->sockaddr_len; | 4119 | addrlen = sctp_get_af_specific(temp.sa.sa_family)->sockaddr_len; |
4147 | if(space_left < addrlen) | 4120 | if(space_left < addrlen) |
4148 | return -ENOMEM; /*fixme: right error?*/ | 4121 | return -ENOMEM; /*fixme: right error?*/ |
4149 | temp.v4.sin_port = htons(temp.v4.sin_port); | ||
4150 | if (copy_to_user(to, &temp, addrlen)) { | 4122 | if (copy_to_user(to, &temp, addrlen)) { |
4151 | err = -EFAULT; | 4123 | err = -EFAULT; |
4152 | goto unlock; | 4124 | goto unlock; |
@@ -4194,12 +4166,8 @@ static int sctp_getsockopt_primary_addr(struct sock *sk, int len, | |||
4194 | if (!asoc->peer.primary_path) | 4166 | if (!asoc->peer.primary_path) |
4195 | return -ENOTCONN; | 4167 | return -ENOTCONN; |
4196 | 4168 | ||
4197 | asoc->peer.primary_path->ipaddr.v4.sin_port = | ||
4198 | htons(asoc->peer.primary_path->ipaddr.v4.sin_port); | ||
4199 | memcpy(&prim.ssp_addr, &asoc->peer.primary_path->ipaddr, | 4169 | memcpy(&prim.ssp_addr, &asoc->peer.primary_path->ipaddr, |
4200 | sizeof(union sctp_addr)); | 4170 | asoc->peer.primary_path->af_specific->sockaddr_len); |
4201 | asoc->peer.primary_path->ipaddr.v4.sin_port = | ||
4202 | ntohs(asoc->peer.primary_path->ipaddr.v4.sin_port); | ||
4203 | 4171 | ||
4204 | sctp_get_pf_specific(sk->sk_family)->addr_v4map(sp, | 4172 | sctp_get_pf_specific(sk->sk_family)->addr_v4map(sp, |
4205 | (union sctp_addr *)&prim.ssp_addr); | 4173 | (union sctp_addr *)&prim.ssp_addr); |
@@ -4645,9 +4613,7 @@ static long sctp_get_port_local(struct sock *sk, union sctp_addr *addr) | |||
4645 | unsigned short snum; | 4613 | unsigned short snum; |
4646 | int ret; | 4614 | int ret; |
4647 | 4615 | ||
4648 | /* NOTE: Remember to put this back to net order. */ | 4616 | snum = ntohs(addr->v4.sin_port); |
4649 | addr->v4.sin_port = ntohs(addr->v4.sin_port); | ||
4650 | snum = addr->v4.sin_port; | ||
4651 | 4617 | ||
4652 | SCTP_DEBUG_PRINTK("sctp_get_port() begins, snum=%d\n", snum); | 4618 | SCTP_DEBUG_PRINTK("sctp_get_port() begins, snum=%d\n", snum); |
4653 | sctp_local_bh_disable(); | 4619 | sctp_local_bh_disable(); |
@@ -4784,7 +4750,6 @@ fail_unlock: | |||
4784 | 4750 | ||
4785 | fail: | 4751 | fail: |
4786 | sctp_local_bh_enable(); | 4752 | sctp_local_bh_enable(); |
4787 | addr->v4.sin_port = htons(addr->v4.sin_port); | ||
4788 | return ret; | 4753 | return ret; |
4789 | } | 4754 | } |
4790 | 4755 | ||
@@ -5083,7 +5048,7 @@ static int sctp_autobind(struct sock *sk) | |||
5083 | { | 5048 | { |
5084 | union sctp_addr autoaddr; | 5049 | union sctp_addr autoaddr; |
5085 | struct sctp_af *af; | 5050 | struct sctp_af *af; |
5086 | unsigned short port; | 5051 | __be16 port; |
5087 | 5052 | ||
5088 | /* Initialize a local sockaddr structure to INADDR_ANY. */ | 5053 | /* Initialize a local sockaddr structure to INADDR_ANY. */ |
5089 | af = sctp_sk(sk)->pf->af; | 5054 | af = sctp_sk(sk)->pf->af; |
diff --git a/net/sctp/tsnmap.c b/net/sctp/tsnmap.c index ac4fae161bc7..42d9498c64fa 100644 --- a/net/sctp/tsnmap.c +++ b/net/sctp/tsnmap.c | |||
@@ -401,13 +401,14 @@ __u16 sctp_tsnmap_num_gabs(struct sctp_tsnmap *map) | |||
401 | 401 | ||
402 | /* Refresh the gap ack information. */ | 402 | /* Refresh the gap ack information. */ |
403 | if (sctp_tsnmap_has_gap(map)) { | 403 | if (sctp_tsnmap_has_gap(map)) { |
404 | __u16 start, end; | ||
404 | sctp_tsnmap_iter_init(map, &iter); | 405 | sctp_tsnmap_iter_init(map, &iter); |
405 | while (sctp_tsnmap_next_gap_ack(map, &iter, | 406 | while (sctp_tsnmap_next_gap_ack(map, &iter, |
406 | &map->gabs[gabs].start, | 407 | &start, |
407 | &map->gabs[gabs].end)) { | 408 | &end)) { |
408 | 409 | ||
409 | map->gabs[gabs].start = htons(map->gabs[gabs].start); | 410 | map->gabs[gabs].start = htons(start); |
410 | map->gabs[gabs].end = htons(map->gabs[gabs].end); | 411 | map->gabs[gabs].end = htons(end); |
411 | gabs++; | 412 | gabs++; |
412 | if (gabs >= SCTP_MAX_GABS) | 413 | if (gabs >= SCTP_MAX_GABS) |
413 | break; | 414 | break; |
diff --git a/net/sctp/ulpevent.c b/net/sctp/ulpevent.c index a015283a9087..e255a709f1b7 100644 --- a/net/sctp/ulpevent.c +++ b/net/sctp/ulpevent.c | |||
@@ -351,7 +351,7 @@ struct sctp_ulpevent *sctp_ulpevent_make_remote_error( | |||
351 | struct sctp_remote_error *sre; | 351 | struct sctp_remote_error *sre; |
352 | struct sk_buff *skb; | 352 | struct sk_buff *skb; |
353 | sctp_errhdr_t *ch; | 353 | sctp_errhdr_t *ch; |
354 | __u16 cause; | 354 | __be16 cause; |
355 | int elen; | 355 | int elen; |
356 | 356 | ||
357 | ch = (sctp_errhdr_t *)(chunk->skb->data); | 357 | ch = (sctp_errhdr_t *)(chunk->skb->data); |