[NET] NETNS: Omit sock->sk_net without CONFIG_NET_NS.
[deliverable/linux.git] / net / sctp / sm_make_chunk.c
index e45be4e3f80d733c8f3eb27773651ad1a4d44add..c8982452580e1c1a29b586ab89e92474cc5b73ec 100644 (file)
@@ -1782,7 +1782,7 @@ static int sctp_process_inv_paramlength(const struct sctp_association *asoc,
                                        const struct sctp_chunk *chunk,
                                        struct sctp_chunk **errp)
 {
-       char            error[] = "The following parameter had invalid length:";
+       static const char error[] = "The following parameter had invalid length:";
        size_t          payload_len = WORD_ROUND(sizeof(error)) +
                                                sizeof(sctp_paramhdr_t);
 
@@ -2375,6 +2375,14 @@ static int sctp_process_param(struct sctp_association *asoc,
                asoc->peer.ipv4_address = 0;
                asoc->peer.ipv6_address = 0;
 
+               /* Assume that peer supports the address family
+                * by which it sends a packet.
+                */
+               if (peer_addr->sa.sa_family == AF_INET6)
+                       asoc->peer.ipv6_address = 1;
+               else if (peer_addr->sa.sa_family == AF_INET)
+                       asoc->peer.ipv4_address = 1;
+
                /* Cycle through address types; avoid divide by 0. */
                sat = ntohs(param.p->length) - sizeof(sctp_paramhdr_t);
                if (sat)
This page took 0.024657 seconds and 5 git commands to generate.