diff options
Diffstat (limited to 'net/sctp/input.c')
-rw-r--r-- | net/sctp/input.c | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/net/sctp/input.c b/net/sctp/input.c index ea2192444ce6..741ed1648838 100644 --- a/net/sctp/input.c +++ b/net/sctp/input.c | |||
@@ -565,7 +565,7 @@ void sctp_err_finish(struct sock *sk, struct sctp_association *asoc) | |||
565 | */ | 565 | */ |
566 | void sctp_v4_err(struct sk_buff *skb, __u32 info) | 566 | void sctp_v4_err(struct sk_buff *skb, __u32 info) |
567 | { | 567 | { |
568 | struct iphdr *iph = (struct iphdr *)skb->data; | 568 | const struct iphdr *iph = (const struct iphdr *)skb->data; |
569 | const int ihlen = iph->ihl * 4; | 569 | const int ihlen = iph->ihl * 4; |
570 | const int type = icmp_hdr(skb)->type; | 570 | const int type = icmp_hdr(skb)->type; |
571 | const int code = icmp_hdr(skb)->code; | 571 | const int code = icmp_hdr(skb)->code; |
@@ -661,7 +661,6 @@ static int sctp_rcv_ootb(struct sk_buff *skb) | |||
661 | { | 661 | { |
662 | sctp_chunkhdr_t *ch; | 662 | sctp_chunkhdr_t *ch; |
663 | __u8 *ch_end; | 663 | __u8 *ch_end; |
664 | sctp_errhdr_t *err; | ||
665 | 664 | ||
666 | ch = (sctp_chunkhdr_t *) skb->data; | 665 | ch = (sctp_chunkhdr_t *) skb->data; |
667 | 666 | ||
@@ -697,20 +696,6 @@ static int sctp_rcv_ootb(struct sk_buff *skb) | |||
697 | if (SCTP_CID_INIT == ch->type && (void *)ch != skb->data) | 696 | if (SCTP_CID_INIT == ch->type && (void *)ch != skb->data) |
698 | goto discard; | 697 | goto discard; |
699 | 698 | ||
700 | /* RFC 8.4, 7) If the packet contains a "Stale cookie" ERROR | ||
701 | * or a COOKIE ACK the SCTP Packet should be silently | ||
702 | * discarded. | ||
703 | */ | ||
704 | if (SCTP_CID_COOKIE_ACK == ch->type) | ||
705 | goto discard; | ||
706 | |||
707 | if (SCTP_CID_ERROR == ch->type) { | ||
708 | sctp_walk_errors(err, ch) { | ||
709 | if (SCTP_ERROR_STALE_COOKIE == err->cause) | ||
710 | goto discard; | ||
711 | } | ||
712 | } | ||
713 | |||
714 | ch = (sctp_chunkhdr_t *) ch_end; | 699 | ch = (sctp_chunkhdr_t *) ch_end; |
715 | } while (ch_end < skb_tail_pointer(skb)); | 700 | } while (ch_end < skb_tail_pointer(skb)); |
716 | 701 | ||
@@ -948,14 +933,11 @@ static struct sctp_association *__sctp_rcv_init_lookup(struct sk_buff *skb, | |||
948 | union sctp_addr addr; | 933 | union sctp_addr addr; |
949 | union sctp_addr *paddr = &addr; | 934 | union sctp_addr *paddr = &addr; |
950 | struct sctphdr *sh = sctp_hdr(skb); | 935 | struct sctphdr *sh = sctp_hdr(skb); |
951 | sctp_chunkhdr_t *ch; | ||
952 | union sctp_params params; | 936 | union sctp_params params; |
953 | sctp_init_chunk_t *init; | 937 | sctp_init_chunk_t *init; |
954 | struct sctp_transport *transport; | 938 | struct sctp_transport *transport; |
955 | struct sctp_af *af; | 939 | struct sctp_af *af; |
956 | 940 | ||
957 | ch = (sctp_chunkhdr_t *) skb->data; | ||
958 | |||
959 | /* | 941 | /* |
960 | * This code will NOT touch anything inside the chunk--it is | 942 | * This code will NOT touch anything inside the chunk--it is |
961 | * strictly READ-ONLY. | 943 | * strictly READ-ONLY. |
@@ -1020,7 +1002,7 @@ static struct sctp_association *__sctp_rcv_asconf_lookup( | |||
1020 | /* Skip over the ADDIP header and find the Address parameter */ | 1002 | /* Skip over the ADDIP header and find the Address parameter */ |
1021 | param = (union sctp_addr_param *)(asconf + 1); | 1003 | param = (union sctp_addr_param *)(asconf + 1); |
1022 | 1004 | ||
1023 | af = sctp_get_af_specific(param_type2af(param->v4.param_hdr.type)); | 1005 | af = sctp_get_af_specific(param_type2af(param->p.type)); |
1024 | if (unlikely(!af)) | 1006 | if (unlikely(!af)) |
1025 | return NULL; | 1007 | return NULL; |
1026 | 1008 | ||
@@ -1037,7 +1019,7 @@ static struct sctp_association *__sctp_rcv_asconf_lookup( | |||
1037 | * association. | 1019 | * association. |
1038 | * | 1020 | * |
1039 | * This means that any chunks that can help us identify the association need | 1021 | * This means that any chunks that can help us identify the association need |
1040 | * to be looked at to find this assocation. | 1022 | * to be looked at to find this association. |
1041 | */ | 1023 | */ |
1042 | static struct sctp_association *__sctp_rcv_walk_lookup(struct sk_buff *skb, | 1024 | static struct sctp_association *__sctp_rcv_walk_lookup(struct sk_buff *skb, |
1043 | const union sctp_addr *laddr, | 1025 | const union sctp_addr *laddr, |