···12431243 /* What socket does this endpoint belong to? */12441244 struct sock *sk;1245124512461246+ /* Cache netns and it won't change once set */12471247+ struct net *net;12481248+12461249 /* This is where we receive inbound chunks. */12471250 struct sctp_inq inqueue;12481251
···110110111111 /* Remember who we are attached to. */112112 ep->base.sk = sk;113113+ ep->base.net = sock_net(sk);113114 sock_hold(ep->base.sk);114115115116 return ep;
+2-2
net/sctp/input.c
···882882 if (!sctp_transport_hold(t))883883 return err;884884885885- if (!net_eq(sock_net(t->asoc->base.sk), x->net))885885+ if (!net_eq(t->asoc->base.net, x->net))886886 goto out;887887 if (x->lport != htons(t->asoc->base.bind_addr.port))888888 goto out;···897897{898898 const struct sctp_transport *t = data;899899900900- return sctp_hashfn(sock_net(t->asoc->base.sk),900900+ return sctp_hashfn(t->asoc->base.net,901901 htons(t->asoc->base.bind_addr.port),902902 &t->ipaddr, seed);903903}
+3-1
net/sctp/sm_statefuns.c
···2160216021612161 /* Update socket peer label if first association. */21622162 if (security_sctp_assoc_request((struct sctp_endpoint *)ep,21632163- chunk->skb))21632163+ chunk->skb)) {21642164+ sctp_association_free(new_asoc);21642165 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);21662166+ }2165216721662168 /* Set temp so that it won't be added into hashtable */21672169 new_asoc->temp = 1;