inet: constify ip headers and in6_addr
[deliverable/linux.git] / net / sctp / input.c
index 826661be73e70f9e05824cc4f65f9e3d1e1cd712..741ed1648838c49d708b126a4d1189236d42a668 100644 (file)
@@ -565,7 +565,7 @@ void sctp_err_finish(struct sock *sk, struct sctp_association *asoc)
  */
 void sctp_v4_err(struct sk_buff *skb, __u32 info)
 {
-       struct iphdr *iph = (struct iphdr *)skb->data;
+       const struct iphdr *iph = (const struct iphdr *)skb->data;
        const int ihlen = iph->ihl * 4;
        const int type = icmp_hdr(skb)->type;
        const int code = icmp_hdr(skb)->code;
@@ -661,7 +661,6 @@ static int sctp_rcv_ootb(struct sk_buff *skb)
 {
        sctp_chunkhdr_t *ch;
        __u8 *ch_end;
-       sctp_errhdr_t *err;
 
        ch = (sctp_chunkhdr_t *) skb->data;
 
@@ -697,20 +696,6 @@ static int sctp_rcv_ootb(struct sk_buff *skb)
                if (SCTP_CID_INIT == ch->type && (void *)ch != skb->data)
                        goto discard;
 
-               /* RFC 8.4, 7) If the packet contains a "Stale cookie" ERROR
-                * or a COOKIE ACK the SCTP Packet should be silently
-                * discarded.
-                */
-               if (SCTP_CID_COOKIE_ACK == ch->type)
-                       goto discard;
-
-               if (SCTP_CID_ERROR == ch->type) {
-                       sctp_walk_errors(err, ch) {
-                               if (SCTP_ERROR_STALE_COOKIE == err->cause)
-                                       goto discard;
-                       }
-               }
-
                ch = (sctp_chunkhdr_t *) ch_end;
        } while (ch_end < skb_tail_pointer(skb));
 
@@ -1017,7 +1002,7 @@ static struct sctp_association *__sctp_rcv_asconf_lookup(
        /* Skip over the ADDIP header and find the Address parameter */
        param = (union sctp_addr_param *)(asconf + 1);
 
-       af = sctp_get_af_specific(param_type2af(param->v4.param_hdr.type));
+       af = sctp_get_af_specific(param_type2af(param->p.type));
        if (unlikely(!af))
                return NULL;
 
@@ -1034,7 +1019,7 @@ static struct sctp_association *__sctp_rcv_asconf_lookup(
 *    association.
 *
 * This means that any chunks that can help us identify the association need
-* to be looked at to find this assocation.
+* to be looked at to find this association.
 */
 static struct sctp_association *__sctp_rcv_walk_lookup(struct sk_buff *skb,
                                      const union sctp_addr *laddr,
This page took 0.028512 seconds and 5 git commands to generate.