Commit 849b7661 authored by Sridhar Samudrala's avatar Sridhar Samudrala

[SCTP] Initialize missing ipv4 fields of a AF_INET6 accept socket.

parent beca2c15
...@@ -77,8 +77,8 @@ static void sctp_datamsg_destroy(struct sctp_datamsg *msg) ...@@ -77,8 +77,8 @@ static void sctp_datamsg_destroy(struct sctp_datamsg *msg)
struct sctp_chunk *chunk; struct sctp_chunk *chunk;
struct sctp_opt *sp; struct sctp_opt *sp;
struct sctp_ulpevent *ev; struct sctp_ulpevent *ev;
struct sctp_association *asoc; struct sctp_association *asoc = NULL;
int error, notify; int error = 0, notify;
/* If we failed, we may need to notify. */ /* If we failed, we may need to notify. */
notify = msg->send_failed ? -1 : 0; notify = msg->send_failed ? -1 : 0;
......
...@@ -537,6 +537,20 @@ struct sock *sctp_v6_create_accept_sk(struct sock *sk, ...@@ -537,6 +537,20 @@ struct sock *sctp_v6_create_accept_sk(struct sock *sk,
newinet->dport = htons(asoc->peer.port); newinet->dport = htons(asoc->peer.port);
newnp->daddr = asoc->peer.primary_addr.v6.sin6_addr; newnp->daddr = asoc->peer.primary_addr.v6.sin6_addr;
/* Init the ipv4 part of the socket since we can have sockets
* using v6 API for ipv4.
*/
newinet->ttl = sysctl_ip_default_ttl;
newinet->mc_loop = 1;
newinet->mc_ttl = 1;
newinet->mc_index = 0;
newinet->mc_list = NULL;
if (ipv4_config.no_pmtu_disc)
newinet->pmtudisc = IP_PMTUDISC_DONT;
else
newinet->pmtudisc = IP_PMTUDISC_WANT;
#ifdef INET_REFCNT_DEBUG #ifdef INET_REFCNT_DEBUG
atomic_inc(&inet6_sock_nr); atomic_inc(&inet6_sock_nr);
atomic_inc(&inet_sock_nr); atomic_inc(&inet_sock_nr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment