48 #include <linux/types.h>
49 #include <linux/slab.h>
51 #include <linux/random.h>
68 struct net *
net = sock_net(sk);
78 if (net->sctp.auth_enable) {
110 if (net->sctp.addip_enable) {
125 ep->
base.malloced = 1;
138 sock_hold(ep->
base.sk);
141 INIT_LIST_HEAD(&ep->
asocs);
201 if (!sctp_endpoint_init(ep, sk, gfp))
203 ep->
base.malloced = 1;
255 crypto_free_hash(sctp_sk(ep->
base.sk)->hmac);
275 if (sctp_sk(ep->
base.sk)->bind_hash)
280 sock_put(ep->
base.sk);
283 if (ep->
base.malloced) {
301 sctp_endpoint_destroy(ep);
311 if ((
htons(ep->
base.bind_addr.port) == laddr->
v4.sin_port) &&
312 net_eq(sock_net(ep->
base.sk), net)) {
314 sctp_sk(ep->
base.sk)))
344 if (!ep->
base.bind_addr.port)
347 rport =
ntohs(paddr->
v4.sin_port);
349 hash = sctp_assoc_hashfn(sock_net(ep->
base.sk), ep->
base.bind_addr.port,
354 tmp = sctp_assoc(epb);
355 if (tmp->
ep != ep || rport != tmp->
peer.port)
379 asoc = __sctp_endpoint_lookup_assoc(ep, paddr, transport);
393 struct net *net = sock_net(ep->
base.sk);
395 bp = &ep->
base.bind_addr;
414 base.inqueue.immediate);
430 inqueue = &ep->
base.inqueue;
435 subtype = SCTP_ST_CHUNK(chunk->
chunk_hdr->type);
498 if (!sctp_sk(sk)->ep)