Commit 1255a1e9 authored by David S. Miller's avatar David S. Miller

Merge bk://kernel.bkbits.net/acme/connection_sock-2.6

into nuts.davemloft.net:/disk1/BK/net-2.6
parents 20408758 dbf390ac
...@@ -158,6 +158,20 @@ static inline struct inet_sock *inet_sk(const struct sock *sk) ...@@ -158,6 +158,20 @@ static inline struct inet_sock *inet_sk(const struct sock *sk)
return (struct inet_sock *)sk; return (struct inet_sock *)sk;
} }
static inline void __inet_sk_copy_descendant(struct sock *sk_to,
const struct sock *sk_from,
const int ancestor_size)
{
memcpy(inet_sk(sk_to) + 1, inet_sk(sk_from) + 1,
sk_from->sk_prot->slab_obj_size - ancestor_size);
}
#if !(defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE))
static inline void inet_sk_copy_descendant(struct sock *sk_to,
const struct sock *sk_from)
{
__inet_sk_copy_descendant(sk_to, sk_from, sizeof(struct inet_sock));
}
#endif
#endif #endif
struct iphdr { struct iphdr {
......
...@@ -282,6 +282,17 @@ static inline struct raw6_opt * raw6_sk(const struct sock *__sk) ...@@ -282,6 +282,17 @@ static inline struct raw6_opt * raw6_sk(const struct sock *__sk)
return &((struct raw6_sock *)__sk)->raw6; return &((struct raw6_sock *)__sk)->raw6;
} }
static inline void inet_sk_copy_descendant(struct sock *sk_to,
const struct sock *sk_from)
{
int ancestor_size = sizeof(struct inet_sock);
if (sk_from->sk_family == PF_INET6)
ancestor_size += sizeof(struct ipv6_pinfo);
__inet_sk_copy_descendant(sk_to, sk_from, ancestor_size);
}
#define __ipv6_only_sock(sk) (inet6_sk(sk)->ipv6only) #define __ipv6_only_sock(sk) (inet6_sk(sk)->ipv6only)
#define ipv6_only_sock(sk) ((sk)->sk_family == PF_INET6 && __ipv6_only_sock(sk)) #define ipv6_only_sock(sk) ((sk)->sk_family == PF_INET6 && __ipv6_only_sock(sk))
#else #else
......
...@@ -423,7 +423,7 @@ static inline __s32 sctp_jitter(__u32 rto) ...@@ -423,7 +423,7 @@ static inline __s32 sctp_jitter(__u32 rto)
} }
/* Break down data chunks at this point. */ /* Break down data chunks at this point. */
static inline int sctp_frag_point(const struct sctp_opt *sp, int pmtu) static inline int sctp_frag_point(const struct sctp_sock *sp, int pmtu)
{ {
int frag = pmtu; int frag = pmtu;
...@@ -576,23 +576,6 @@ static inline int sctp_vtag_hashfn(__u16 lport, __u16 rport, __u32 vtag) ...@@ -576,23 +576,6 @@ static inline int sctp_vtag_hashfn(__u16 lport, __u16 rport, __u32 vtag)
return (h & (sctp_assoc_hashsize-1)); return (h & (sctp_assoc_hashsize-1));
} }
/* WARNING: Do not change the layout of the members in sctp_sock! */
struct sctp_sock {
struct inet_sock inet;
struct sctp_opt sctp;
};
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
struct sctp6_sock {
struct inet_sock inet;
struct sctp_opt sctp;
struct ipv6_pinfo inet6;
};
#endif /* CONFIG_IPV6 */
#define sctp_sk(__sk) (&((struct sctp_sock *)__sk)->sctp)
#define sctp_opt2sk(__sp) &container_of(__sp, struct sctp_sock, sctp)->inet.sk
/* Is a socket of this style? */ /* Is a socket of this style? */
#define sctp_style(sk, style) __sctp_style((sk), (SCTP_SOCKET_##style)) #define sctp_style(sk, style) __sctp_style((sk), (SCTP_SOCKET_##style))
static inline int __sctp_style(const struct sock *sk, sctp_socket_type_t style) static inline int __sctp_style(const struct sock *sk, sctp_socket_type_t style)
......
...@@ -58,6 +58,7 @@ ...@@ -58,6 +58,7 @@
#include <linux/socket.h> /* linux/in.h needs this!! */ #include <linux/socket.h> /* linux/in.h needs this!! */
#include <linux/in.h> /* We get struct sockaddr_in. */ #include <linux/in.h> /* We get struct sockaddr_in. */
#include <linux/in6.h> /* We get struct in6_addr */ #include <linux/in6.h> /* We get struct in6_addr */
#include <linux/ipv6.h>
#include <asm/param.h> /* We get MAXHOSTNAMELEN. */ #include <asm/param.h> /* We get MAXHOSTNAMELEN. */
#include <asm/atomic.h> /* This gets us atomic counters. */ #include <asm/atomic.h> /* This gets us atomic counters. */
#include <linux/skbuff.h> /* We need sk_buff_head. */ #include <linux/skbuff.h> /* We need sk_buff_head. */
...@@ -84,7 +85,6 @@ struct sctp_inq; ...@@ -84,7 +85,6 @@ struct sctp_inq;
struct sctp_outq; struct sctp_outq;
struct sctp_bind_addr; struct sctp_bind_addr;
struct sctp_ulpq; struct sctp_ulpq;
struct sctp_opt;
struct sctp_ep_common; struct sctp_ep_common;
struct sctp_ssnmap; struct sctp_ssnmap;
...@@ -234,7 +234,9 @@ typedef enum { ...@@ -234,7 +234,9 @@ typedef enum {
} sctp_socket_type_t; } sctp_socket_type_t;
/* Per socket SCTP information. */ /* Per socket SCTP information. */
struct sctp_opt { struct sctp_sock {
/* inet_sock has to be the first member of sctp_sock */
struct inet_sock inet;
/* What kind of a socket is this? */ /* What kind of a socket is this? */
sctp_socket_type_t type; sctp_socket_type_t type;
...@@ -272,6 +274,22 @@ struct sctp_opt { ...@@ -272,6 +274,22 @@ struct sctp_opt {
struct sk_buff_head pd_lobby; struct sk_buff_head pd_lobby;
}; };
static inline struct sctp_sock *sctp_sk(const struct sock *sk)
{
return (struct sctp_sock *)sk;
}
static inline struct sock *sctp_opt2sk(const struct sctp_sock *sp)
{
return (struct sock *)sp;
}
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
struct sctp6_sock {
struct sctp_sock sctp;
struct ipv6_pinfo inet6;
};
#endif /* CONFIG_IPV6 */
/* This is our APPLICATION-SPECIFIC state cookie. /* This is our APPLICATION-SPECIFIC state cookie.
...@@ -487,12 +505,12 @@ struct sctp_af { ...@@ -487,12 +505,12 @@ struct sctp_af {
int (*to_addr_param) (const union sctp_addr *, int (*to_addr_param) (const union sctp_addr *,
union sctp_addr_param *); union sctp_addr_param *);
int (*addr_valid) (union sctp_addr *, int (*addr_valid) (union sctp_addr *,
struct sctp_opt *); struct sctp_sock *);
sctp_scope_t (*scope) (union sctp_addr *); sctp_scope_t (*scope) (union sctp_addr *);
void (*inaddr_any) (union sctp_addr *, unsigned short); void (*inaddr_any) (union sctp_addr *, unsigned short);
int (*is_any) (const union sctp_addr *); int (*is_any) (const union sctp_addr *);
int (*available) (union sctp_addr *, int (*available) (union sctp_addr *,
struct sctp_opt *); struct sctp_sock *);
int (*skb_iif) (const struct sk_buff *sk); int (*skb_iif) (const struct sk_buff *sk);
int (*is_ce) (const struct sk_buff *sk); int (*is_ce) (const struct sk_buff *sk);
void (*seq_dump_addr)(struct seq_file *seq, void (*seq_dump_addr)(struct seq_file *seq,
...@@ -510,16 +528,16 @@ int sctp_register_af(struct sctp_af *); ...@@ -510,16 +528,16 @@ int sctp_register_af(struct sctp_af *);
struct sctp_pf { struct sctp_pf {
void (*event_msgname)(struct sctp_ulpevent *, char *, int *); void (*event_msgname)(struct sctp_ulpevent *, char *, int *);
void (*skb_msgname) (struct sk_buff *, char *, int *); void (*skb_msgname) (struct sk_buff *, char *, int *);
int (*af_supported) (sa_family_t, struct sctp_opt *); int (*af_supported) (sa_family_t, struct sctp_sock *);
int (*cmp_addr) (const union sctp_addr *, int (*cmp_addr) (const union sctp_addr *,
const union sctp_addr *, const union sctp_addr *,
struct sctp_opt *); struct sctp_sock *);
int (*bind_verify) (struct sctp_opt *, union sctp_addr *); int (*bind_verify) (struct sctp_sock *, union sctp_addr *);
int (*send_verify) (struct sctp_opt *, union sctp_addr *); int (*send_verify) (struct sctp_sock *, union sctp_addr *);
int (*supported_addrs)(const struct sctp_opt *, __u16 *); int (*supported_addrs)(const struct sctp_sock *, __u16 *);
struct sock *(*create_accept_sk) (struct sock *sk, struct sock *(*create_accept_sk) (struct sock *sk,
struct sctp_association *asoc); struct sctp_association *asoc);
void (*addr_v4map) (struct sctp_opt *, union sctp_addr *); void (*addr_v4map) (struct sctp_sock *, union sctp_addr *);
struct sctp_af *af; struct sctp_af *af;
}; };
...@@ -922,7 +940,7 @@ struct sctp_transport *sctp_transport_new(const union sctp_addr *, int); ...@@ -922,7 +940,7 @@ struct sctp_transport *sctp_transport_new(const union sctp_addr *, int);
void sctp_transport_set_owner(struct sctp_transport *, void sctp_transport_set_owner(struct sctp_transport *,
struct sctp_association *); struct sctp_association *);
void sctp_transport_route(struct sctp_transport *, union sctp_addr *, void sctp_transport_route(struct sctp_transport *, union sctp_addr *,
struct sctp_opt *); struct sctp_sock *);
void sctp_transport_pmtu(struct sctp_transport *); void sctp_transport_pmtu(struct sctp_transport *);
void sctp_transport_free(struct sctp_transport *); void sctp_transport_free(struct sctp_transport *);
void sctp_transport_reset_timers(struct sctp_transport *); void sctp_transport_reset_timers(struct sctp_transport *);
...@@ -1071,11 +1089,11 @@ int sctp_add_bind_addr(struct sctp_bind_addr *, union sctp_addr *, ...@@ -1071,11 +1089,11 @@ int sctp_add_bind_addr(struct sctp_bind_addr *, union sctp_addr *,
int gfp); int gfp);
int sctp_del_bind_addr(struct sctp_bind_addr *, union sctp_addr *); int sctp_del_bind_addr(struct sctp_bind_addr *, union sctp_addr *);
int sctp_bind_addr_match(struct sctp_bind_addr *, const union sctp_addr *, int sctp_bind_addr_match(struct sctp_bind_addr *, const union sctp_addr *,
struct sctp_opt *); struct sctp_sock *);
union sctp_addr *sctp_find_unmatch_addr(struct sctp_bind_addr *bp, union sctp_addr *sctp_find_unmatch_addr(struct sctp_bind_addr *bp,
const union sctp_addr *addrs, const union sctp_addr *addrs,
int addrcnt, int addrcnt,
struct sctp_opt *opt); struct sctp_sock *opt);
union sctp_params sctp_bind_addrs_to_raw(const struct sctp_bind_addr *bp, union sctp_params sctp_bind_addrs_to_raw(const struct sctp_bind_addr *bp,
int *addrs_len, int gfp); int *addrs_len, int gfp);
int sctp_raw_to_bind_addrs(struct sctp_bind_addr *bp, __u8 *raw, int len, int sctp_raw_to_bind_addrs(struct sctp_bind_addr *bp, __u8 *raw, int len,
......
...@@ -73,7 +73,7 @@ static struct sctp_association *sctp_association_init(struct sctp_association *a ...@@ -73,7 +73,7 @@ static struct sctp_association *sctp_association_init(struct sctp_association *a
sctp_scope_t scope, sctp_scope_t scope,
int gfp) int gfp)
{ {
struct sctp_opt *sp; struct sctp_sock *sp;
int i; int i;
/* Retrieve the SCTP per socket area. */ /* Retrieve the SCTP per socket area. */
...@@ -434,7 +434,7 @@ struct sctp_transport *sctp_assoc_add_peer(struct sctp_association *asoc, ...@@ -434,7 +434,7 @@ struct sctp_transport *sctp_assoc_add_peer(struct sctp_association *asoc,
int gfp) int gfp)
{ {
struct sctp_transport *peer; struct sctp_transport *peer;
struct sctp_opt *sp; struct sctp_sock *sp;
unsigned short port; unsigned short port;
sp = sctp_sk(asoc->base.sk); sp = sctp_sk(asoc->base.sk);
...@@ -886,7 +886,7 @@ static void sctp_assoc_bh_rcv(struct sctp_association *asoc) ...@@ -886,7 +886,7 @@ static void sctp_assoc_bh_rcv(struct sctp_association *asoc)
/* This routine moves an association from its old sk to a new sk. */ /* This routine moves an association from its old sk to a new sk. */
void sctp_assoc_migrate(struct sctp_association *assoc, struct sock *newsk) void sctp_assoc_migrate(struct sctp_association *assoc, struct sock *newsk)
{ {
struct sctp_opt *newsp = sctp_sk(newsk); struct sctp_sock *newsp = sctp_sk(newsk);
struct sock *oldsk = assoc->base.sk; struct sock *oldsk = assoc->base.sk;
/* Delete the association from the old endpoint's list of /* Delete the association from the old endpoint's list of
...@@ -1059,7 +1059,7 @@ void sctp_assoc_sync_pmtu(struct sctp_association *asoc) ...@@ -1059,7 +1059,7 @@ void sctp_assoc_sync_pmtu(struct sctp_association *asoc)
} }
if (pmtu) { if (pmtu) {
struct sctp_opt *sp = sctp_sk(asoc->base.sk); struct sctp_sock *sp = sctp_sk(asoc->base.sk);
asoc->pmtu = pmtu; asoc->pmtu = pmtu;
asoc->frag_point = sctp_frag_point(sp, pmtu); asoc->frag_point = sctp_frag_point(sp, pmtu);
} }
......
...@@ -293,7 +293,7 @@ int sctp_raw_to_bind_addrs(struct sctp_bind_addr *bp, __u8 *raw_addr_list, ...@@ -293,7 +293,7 @@ int sctp_raw_to_bind_addrs(struct sctp_bind_addr *bp, __u8 *raw_addr_list,
/* Does this contain a specified address? Allow wildcarding. */ /* Does this contain a specified address? Allow wildcarding. */
int sctp_bind_addr_match(struct sctp_bind_addr *bp, int sctp_bind_addr_match(struct sctp_bind_addr *bp,
const union sctp_addr *addr, const union sctp_addr *addr,
struct sctp_opt *opt) struct sctp_sock *opt)
{ {
struct sctp_sockaddr_entry *laddr; struct sctp_sockaddr_entry *laddr;
struct list_head *pos; struct list_head *pos;
...@@ -313,7 +313,7 @@ int sctp_bind_addr_match(struct sctp_bind_addr *bp, ...@@ -313,7 +313,7 @@ int sctp_bind_addr_match(struct sctp_bind_addr *bp,
union sctp_addr *sctp_find_unmatch_addr(struct sctp_bind_addr *bp, union sctp_addr *sctp_find_unmatch_addr(struct sctp_bind_addr *bp,
const union sctp_addr *addrs, const union sctp_addr *addrs,
int addrcnt, int addrcnt,
struct sctp_opt *opt) struct sctp_sock *opt)
{ {
struct sctp_sockaddr_entry *laddr; struct sctp_sockaddr_entry *laddr;
union sctp_addr *addr; union sctp_addr *addr;
......
...@@ -77,7 +77,7 @@ static void sctp_datamsg_destroy(struct sctp_datamsg *msg) ...@@ -77,7 +77,7 @@ static void sctp_datamsg_destroy(struct sctp_datamsg *msg)
{ {
struct list_head *pos, *temp; struct list_head *pos, *temp;
struct sctp_chunk *chunk; struct sctp_chunk *chunk;
struct sctp_opt *sp; struct sctp_sock *sp;
struct sctp_ulpevent *ev; struct sctp_ulpevent *ev;
struct sctp_association *asoc = NULL; struct sctp_association *asoc = NULL;
int error = 0, notify; int error = 0, notify;
......
...@@ -69,7 +69,7 @@ static void sctp_endpoint_bh_rcv(struct sctp_endpoint *ep); ...@@ -69,7 +69,7 @@ static void sctp_endpoint_bh_rcv(struct sctp_endpoint *ep);
static struct sctp_endpoint *sctp_endpoint_init(struct sctp_endpoint *ep, static struct sctp_endpoint *sctp_endpoint_init(struct sctp_endpoint *ep,
struct sock *sk, int gfp) struct sock *sk, int gfp)
{ {
struct sctp_opt *sp = sctp_sk(sk); struct sctp_sock *sp = sctp_sk(sk);
memset(ep, 0, sizeof(struct sctp_endpoint)); memset(ep, 0, sizeof(struct sctp_endpoint));
/* Initialize the base structure. */ /* Initialize the base structure. */
......
...@@ -502,7 +502,7 @@ static int sctp_v6_is_any(const union sctp_addr *addr) ...@@ -502,7 +502,7 @@ static int sctp_v6_is_any(const union sctp_addr *addr)
} }
/* Should this be available for binding? */ /* Should this be available for binding? */
static int sctp_v6_available(union sctp_addr *addr, struct sctp_opt *sp) static int sctp_v6_available(union sctp_addr *addr, struct sctp_sock *sp)
{ {
int type; int type;
struct in6_addr *in6 = (struct in6_addr *)&addr->v6.sin6_addr; struct in6_addr *in6 = (struct in6_addr *)&addr->v6.sin6_addr;
...@@ -531,14 +531,14 @@ static int sctp_v6_available(union sctp_addr *addr, struct sctp_opt *sp) ...@@ -531,14 +531,14 @@ static int sctp_v6_available(union sctp_addr *addr, struct sctp_opt *sp)
* Return 0 - If the address is a non-unicast or an illegal address. * Return 0 - If the address is a non-unicast or an illegal address.
* Return 1 - If the address is a unicast. * Return 1 - If the address is a unicast.
*/ */
static int sctp_v6_addr_valid(union sctp_addr *addr, struct sctp_opt *sp) static int sctp_v6_addr_valid(union sctp_addr *addr, struct sctp_sock *sp)
{ {
int ret = ipv6_addr_type(&addr->v6.sin6_addr); int ret = ipv6_addr_type(&addr->v6.sin6_addr);
/* Support v4-mapped-v6 address. */ /* Support v4-mapped-v6 address. */
if (ret == IPV6_ADDR_MAPPED) { if (ret == IPV6_ADDR_MAPPED) {
/* Note: This routine is used in input, so v4-mapped-v6 /* Note: This routine is used in input, so v4-mapped-v6
* are disallowed here when there is no sctp_opt. * are disallowed here when there is no sctp_sock.
*/ */
if (!sp || !sp->v4mapped) if (!sp || !sp->v4mapped)
return 0; return 0;
...@@ -616,7 +616,7 @@ static struct sock *sctp_v6_create_accept_sk(struct sock *sk, ...@@ -616,7 +616,7 @@ static struct sock *sctp_v6_create_accept_sk(struct sock *sk,
newsk->sk_shutdown = sk->sk_shutdown; newsk->sk_shutdown = sk->sk_shutdown;
newsctp6sk = (struct sctp6_sock *)newsk; newsctp6sk = (struct sctp6_sock *)newsk;
newsctp6sk->inet.pinet6 = &newsctp6sk->inet6; inet_sk(newsk)->pinet6 = &newsctp6sk->inet6;
newinet = inet_sk(newsk); newinet = inet_sk(newsk);
newnp = inet6_sk(newsk); newnp = inet6_sk(newsk);
...@@ -661,7 +661,7 @@ static struct sock *sctp_v6_create_accept_sk(struct sock *sk, ...@@ -661,7 +661,7 @@ static struct sock *sctp_v6_create_accept_sk(struct sock *sk,
} }
/* Map v4 address to mapped v6 address */ /* Map v4 address to mapped v6 address */
static void sctp_v6_addr_v4map(struct sctp_opt *sp, union sctp_addr *addr) static void sctp_v6_addr_v4map(struct sctp_sock *sp, union sctp_addr *addr)
{ {
if (sp->v4mapped && AF_INET == addr->sa.sa_family) if (sp->v4mapped && AF_INET == addr->sa.sa_family)
sctp_v4_map_v6(addr); sctp_v4_map_v6(addr);
...@@ -766,7 +766,7 @@ static void sctp_inet6_skb_msgname(struct sk_buff *skb, char *msgname, ...@@ -766,7 +766,7 @@ static void sctp_inet6_skb_msgname(struct sk_buff *skb, char *msgname,
} }
/* Do we support this AF? */ /* Do we support this AF? */
static int sctp_inet6_af_supported(sa_family_t family, struct sctp_opt *sp) static int sctp_inet6_af_supported(sa_family_t family, struct sctp_sock *sp)
{ {
switch (family) { switch (family) {
case AF_INET6: case AF_INET6:
...@@ -786,7 +786,7 @@ static int sctp_inet6_af_supported(sa_family_t family, struct sctp_opt *sp) ...@@ -786,7 +786,7 @@ static int sctp_inet6_af_supported(sa_family_t family, struct sctp_opt *sp)
*/ */
static int sctp_inet6_cmp_addr(const union sctp_addr *addr1, static int sctp_inet6_cmp_addr(const union sctp_addr *addr1,
const union sctp_addr *addr2, const union sctp_addr *addr2,
struct sctp_opt *opt) struct sctp_sock *opt)
{ {
struct sctp_af *af1, *af2; struct sctp_af *af1, *af2;
...@@ -808,7 +808,7 @@ static int sctp_inet6_cmp_addr(const union sctp_addr *addr1, ...@@ -808,7 +808,7 @@ static int sctp_inet6_cmp_addr(const union sctp_addr *addr1,
/* Verify that the provided sockaddr looks bindable. Common verification, /* Verify that the provided sockaddr looks bindable. Common verification,
* has already been taken care of. * has already been taken care of.
*/ */
static int sctp_inet6_bind_verify(struct sctp_opt *opt, union sctp_addr *addr) static int sctp_inet6_bind_verify(struct sctp_sock *opt, union sctp_addr *addr)
{ {
struct sctp_af *af; struct sctp_af *af;
...@@ -838,7 +838,7 @@ static int sctp_inet6_bind_verify(struct sctp_opt *opt, union sctp_addr *addr) ...@@ -838,7 +838,7 @@ static int sctp_inet6_bind_verify(struct sctp_opt *opt, union sctp_addr *addr)
/* Verify that the provided sockaddr looks bindable. Common verification, /* Verify that the provided sockaddr looks bindable. Common verification,
* has already been taken care of. * has already been taken care of.
*/ */
static int sctp_inet6_send_verify(struct sctp_opt *opt, union sctp_addr *addr) static int sctp_inet6_send_verify(struct sctp_sock *opt, union sctp_addr *addr)
{ {
struct sctp_af *af = NULL; struct sctp_af *af = NULL;
...@@ -872,7 +872,7 @@ static int sctp_inet6_send_verify(struct sctp_opt *opt, union sctp_addr *addr) ...@@ -872,7 +872,7 @@ static int sctp_inet6_send_verify(struct sctp_opt *opt, union sctp_addr *addr)
* addresses. * addresses.
* Returns number of addresses supported. * Returns number of addresses supported.
*/ */
static int sctp_inet6_supported_addrs(const struct sctp_opt *opt, static int sctp_inet6_supported_addrs(const struct sctp_sock *opt,
__u16 *types) __u16 *types)
{ {
types[0] = SCTP_PARAM_IPV4_ADDRESS; types[0] = SCTP_PARAM_IPV4_ADDRESS;
......
...@@ -110,7 +110,7 @@ struct sctp_packet *sctp_packet_init(struct sctp_packet *packet, ...@@ -110,7 +110,7 @@ struct sctp_packet *sctp_packet_init(struct sctp_packet *packet,
packet->destination_port = dport; packet->destination_port = dport;
skb_queue_head_init(&packet->chunks); skb_queue_head_init(&packet->chunks);
if (asoc) { if (asoc) {
struct sctp_opt *sp = sctp_sk(asoc->base.sk); struct sctp_sock *sp = sctp_sk(asoc->base.sk);
overhead = sp->pf->af->net_header_len; overhead = sp->pf->af->net_header_len;
} else { } else {
overhead = sizeof(struct ipv6hdr); overhead = sizeof(struct ipv6hdr);
...@@ -534,7 +534,7 @@ static sctp_xmit_t sctp_packet_append_data(struct sctp_packet *packet, ...@@ -534,7 +534,7 @@ static sctp_xmit_t sctp_packet_append_data(struct sctp_packet *packet,
struct sctp_transport *transport = packet->transport; struct sctp_transport *transport = packet->transport;
__u32 max_burst_bytes; __u32 max_burst_bytes;
struct sctp_association *asoc = transport->asoc; struct sctp_association *asoc = transport->asoc;
struct sctp_opt *sp = sctp_sk(asoc->base.sk); struct sctp_sock *sp = sctp_sk(asoc->base.sk);
struct sctp_outq *q = &asoc->outqueue; struct sctp_outq *q = &asoc->outqueue;
/* RFC 2960 6.1 Transmission of DATA Chunks /* RFC 2960 6.1 Transmission of DATA Chunks
......
...@@ -364,7 +364,7 @@ static int sctp_v4_is_any(const union sctp_addr *addr) ...@@ -364,7 +364,7 @@ static int sctp_v4_is_any(const union sctp_addr *addr)
* Return 0 - If the address is a non-unicast or an illegal address. * Return 0 - If the address is a non-unicast or an illegal address.
* Return 1 - If the address is a unicast. * Return 1 - If the address is a unicast.
*/ */
static int sctp_v4_addr_valid(union sctp_addr *addr, struct sctp_opt *sp) static int sctp_v4_addr_valid(union sctp_addr *addr, struct sctp_sock *sp)
{ {
/* Is this a non-unicast address or a unusable SCTP address? */ /* Is this a non-unicast address or a unusable SCTP address? */
if (IS_IPV4_UNUSABLE_ADDRESS(&addr->v4.sin_addr.s_addr)) if (IS_IPV4_UNUSABLE_ADDRESS(&addr->v4.sin_addr.s_addr))
...@@ -374,7 +374,7 @@ static int sctp_v4_addr_valid(union sctp_addr *addr, struct sctp_opt *sp) ...@@ -374,7 +374,7 @@ static int sctp_v4_addr_valid(union sctp_addr *addr, struct sctp_opt *sp)
} }
/* Should this be available for binding? */ /* Should this be available for binding? */
static int sctp_v4_available(union sctp_addr *addr, struct sctp_opt *sp) static int sctp_v4_available(union sctp_addr *addr, struct sctp_sock *sp)
{ {
int ret = inet_addr_type(addr->v4.sin_addr.s_addr); int ret = inet_addr_type(addr->v4.sin_addr.s_addr);
...@@ -608,7 +608,7 @@ static struct sock *sctp_v4_create_accept_sk(struct sock *sk, ...@@ -608,7 +608,7 @@ static struct sock *sctp_v4_create_accept_sk(struct sock *sk,
} }
/* Map address, empty for v4 family */ /* Map address, empty for v4 family */
static void sctp_v4_addr_v4map(struct sctp_opt *sp, union sctp_addr *addr) static void sctp_v4_addr_v4map(struct sctp_sock *sp, union sctp_addr *addr)
{ {
/* Empty */ /* Empty */
} }
...@@ -745,7 +745,7 @@ static void sctp_inet_skb_msgname(struct sk_buff *skb, char *msgname, int *len) ...@@ -745,7 +745,7 @@ static void sctp_inet_skb_msgname(struct sk_buff *skb, char *msgname, int *len)
} }
/* Do we support this AF? */ /* Do we support this AF? */
static int sctp_inet_af_supported(sa_family_t family, struct sctp_opt *sp) static int sctp_inet_af_supported(sa_family_t family, struct sctp_sock *sp)
{ {
/* PF_INET only supports AF_INET addresses. */ /* PF_INET only supports AF_INET addresses. */
return (AF_INET == family); return (AF_INET == family);
...@@ -754,7 +754,7 @@ static int sctp_inet_af_supported(sa_family_t family, struct sctp_opt *sp) ...@@ -754,7 +754,7 @@ static int sctp_inet_af_supported(sa_family_t family, struct sctp_opt *sp)
/* Address matching with wildcards allowed. */ /* Address matching with wildcards allowed. */
static int sctp_inet_cmp_addr(const union sctp_addr *addr1, static int sctp_inet_cmp_addr(const union sctp_addr *addr1,
const union sctp_addr *addr2, const union sctp_addr *addr2,
struct sctp_opt *opt) struct sctp_sock *opt)
{ {
/* PF_INET only supports AF_INET addresses. */ /* PF_INET only supports AF_INET addresses. */
if (addr1->sa.sa_family != addr2->sa.sa_family) if (addr1->sa.sa_family != addr2->sa.sa_family)
...@@ -771,7 +771,7 @@ static int sctp_inet_cmp_addr(const union sctp_addr *addr1, ...@@ -771,7 +771,7 @@ static int sctp_inet_cmp_addr(const union sctp_addr *addr1,
/* Verify that provided sockaddr looks bindable. Common verification has /* Verify that provided sockaddr looks bindable. Common verification has
* already been taken care of. * already been taken care of.
*/ */
static int sctp_inet_bind_verify(struct sctp_opt *opt, union sctp_addr *addr) static int sctp_inet_bind_verify(struct sctp_sock *opt, union sctp_addr *addr)
{ {
return sctp_v4_available(addr, opt); return sctp_v4_available(addr, opt);
} }
...@@ -779,7 +779,7 @@ static int sctp_inet_bind_verify(struct sctp_opt *opt, union sctp_addr *addr) ...@@ -779,7 +779,7 @@ static int sctp_inet_bind_verify(struct sctp_opt *opt, union sctp_addr *addr)
/* Verify that sockaddr looks sendable. Common verification has already /* Verify that sockaddr looks sendable. Common verification has already
* been taken care of. * been taken care of.
*/ */
static int sctp_inet_send_verify(struct sctp_opt *opt, union sctp_addr *addr) static int sctp_inet_send_verify(struct sctp_sock *opt, union sctp_addr *addr)
{ {
return 1; return 1;
} }
...@@ -787,7 +787,7 @@ static int sctp_inet_send_verify(struct sctp_opt *opt, union sctp_addr *addr) ...@@ -787,7 +787,7 @@ static int sctp_inet_send_verify(struct sctp_opt *opt, union sctp_addr *addr)
/* Fill in Supported Address Type information for INIT and INIT-ACK /* Fill in Supported Address Type information for INIT and INIT-ACK
* chunks. Returns number of addresses supported. * chunks. Returns number of addresses supported.
*/ */
static int sctp_inet_supported_addrs(const struct sctp_opt *opt, static int sctp_inet_supported_addrs(const struct sctp_sock *opt,
__u16 *types) __u16 *types)
{ {
types[0] = SCTP_PARAM_IPV4_ADDRESS; types[0] = SCTP_PARAM_IPV4_ADDRESS;
......
...@@ -181,7 +181,7 @@ struct sctp_chunk *sctp_make_init(const struct sctp_association *asoc, ...@@ -181,7 +181,7 @@ struct sctp_chunk *sctp_make_init(const struct sctp_association *asoc,
size_t chunksize; size_t chunksize;
struct sctp_chunk *retval = NULL; struct sctp_chunk *retval = NULL;
int num_types, addrs_len = 0; int num_types, addrs_len = 0;
struct sctp_opt *sp; struct sctp_sock *sp;
sctp_supported_addrs_param_t sat; sctp_supported_addrs_param_t sat;
__u16 types[2]; __u16 types[2];
sctp_adaption_ind_param_t aiparam; sctp_adaption_ind_param_t aiparam;
......
...@@ -93,7 +93,7 @@ static int sctp_wait_for_packet(struct sock * sk, int *err, long *timeo_p); ...@@ -93,7 +93,7 @@ static int sctp_wait_for_packet(struct sock * sk, int *err, long *timeo_p);
static int sctp_wait_for_connect(struct sctp_association *, long *timeo_p); static int sctp_wait_for_connect(struct sctp_association *, long *timeo_p);
static int sctp_wait_for_accept(struct sock *sk, long timeo); static int sctp_wait_for_accept(struct sock *sk, long timeo);
static void sctp_wait_for_close(struct sock *sk, long timeo); static void sctp_wait_for_close(struct sock *sk, long timeo);
static struct sctp_af *sctp_sockaddr_af(struct sctp_opt *opt, static struct sctp_af *sctp_sockaddr_af(struct sctp_sock *opt,
union sctp_addr *addr, int len); union sctp_addr *addr, int len);
static int sctp_bindx_add(struct sock *, struct sockaddr *, int); static int sctp_bindx_add(struct sock *, struct sockaddr *, int);
static int sctp_bindx_rem(struct sock *, struct sockaddr *, int); static int sctp_bindx_rem(struct sock *, struct sockaddr *, int);
...@@ -269,7 +269,7 @@ SCTP_STATIC int sctp_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len) ...@@ -269,7 +269,7 @@ SCTP_STATIC int sctp_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len)
static long sctp_get_port_local(struct sock *, union sctp_addr *); static long sctp_get_port_local(struct sock *, union sctp_addr *);
/* Verify this is a valid sockaddr. */ /* Verify this is a valid sockaddr. */
static struct sctp_af *sctp_sockaddr_af(struct sctp_opt *opt, static struct sctp_af *sctp_sockaddr_af(struct sctp_sock *opt,
union sctp_addr *addr, int len) union sctp_addr *addr, int len)
{ {
struct sctp_af *af; struct sctp_af *af;
...@@ -294,7 +294,7 @@ static struct sctp_af *sctp_sockaddr_af(struct sctp_opt *opt, ...@@ -294,7 +294,7 @@ static struct sctp_af *sctp_sockaddr_af(struct sctp_opt *opt,
/* Bind a local address either to an endpoint or to an association. */ /* Bind a local address either to an endpoint or to an association. */
SCTP_STATIC int sctp_do_bind(struct sock *sk, union sctp_addr *addr, int len) SCTP_STATIC int sctp_do_bind(struct sock *sk, union sctp_addr *addr, int len)
{ {
struct sctp_opt *sp = sctp_sk(sk); struct sctp_sock *sp = sctp_sk(sk);
struct sctp_endpoint *ep = sp->ep; struct sctp_endpoint *ep = sp->ep;
struct sctp_bind_addr *bp = &ep->base.bind_addr; struct sctp_bind_addr *bp = &ep->base.bind_addr;
struct sctp_af *af; struct sctp_af *af;
...@@ -467,7 +467,7 @@ static int sctp_send_asconf_add_ip(struct sock *sk, ...@@ -467,7 +467,7 @@ static int sctp_send_asconf_add_ip(struct sock *sk,
struct sockaddr *addrs, struct sockaddr *addrs,
int addrcnt) int addrcnt)
{ {
struct sctp_opt *sp; struct sctp_sock *sp;
struct sctp_endpoint *ep; struct sctp_endpoint *ep;
struct sctp_association *asoc; struct sctp_association *asoc;
struct sctp_bind_addr *bp; struct sctp_bind_addr *bp;
...@@ -572,7 +572,7 @@ static int sctp_send_asconf_add_ip(struct sock *sk, ...@@ -572,7 +572,7 @@ static int sctp_send_asconf_add_ip(struct sock *sk,
*/ */
int sctp_bindx_rem(struct sock *sk, struct sockaddr *addrs, int addrcnt) int sctp_bindx_rem(struct sock *sk, struct sockaddr *addrs, int addrcnt)
{ {
struct sctp_opt *sp = sctp_sk(sk); struct sctp_sock *sp = sctp_sk(sk);
struct sctp_endpoint *ep = sp->ep; struct sctp_endpoint *ep = sp->ep;
int cnt; int cnt;
struct sctp_bind_addr *bp = &ep->base.bind_addr; struct sctp_bind_addr *bp = &ep->base.bind_addr;
...@@ -656,7 +656,7 @@ static int sctp_send_asconf_del_ip(struct sock *sk, ...@@ -656,7 +656,7 @@ static int sctp_send_asconf_del_ip(struct sock *sk,
struct sockaddr *addrs, struct sockaddr *addrs,
int addrcnt) int addrcnt)
{ {
struct sctp_opt *sp; struct sctp_sock *sp;
struct sctp_endpoint *ep; struct sctp_endpoint *ep;
struct sctp_association *asoc; struct sctp_association *asoc;
struct sctp_bind_addr *bp; struct sctp_bind_addr *bp;
...@@ -1051,7 +1051,7 @@ SCTP_STATIC int sctp_msghdr_parse(const struct msghdr *, sctp_cmsgs_t *); ...@@ -1051,7 +1051,7 @@ SCTP_STATIC int sctp_msghdr_parse(const struct msghdr *, sctp_cmsgs_t *);
SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk, SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
struct msghdr *msg, size_t msg_len) struct msghdr *msg, size_t msg_len)
{ {
struct sctp_opt *sp; struct sctp_sock *sp;
struct sctp_endpoint *ep; struct sctp_endpoint *ep;
struct sctp_association *new_asoc=NULL, *asoc=NULL; struct sctp_association *new_asoc=NULL, *asoc=NULL;
struct sctp_transport *transport, *chunk_tp; struct sctp_transport *transport, *chunk_tp;
...@@ -1492,7 +1492,7 @@ SCTP_STATIC int sctp_recvmsg(struct kiocb *iocb, struct sock *sk, ...@@ -1492,7 +1492,7 @@ SCTP_STATIC int sctp_recvmsg(struct kiocb *iocb, struct sock *sk,
int flags, int *addr_len) int flags, int *addr_len)
{ {
struct sctp_ulpevent *event = NULL; struct sctp_ulpevent *event = NULL;
struct sctp_opt *sp = sctp_sk(sk); struct sctp_sock *sp = sctp_sk(sk);
struct sk_buff *skb; struct sk_buff *skb;
int copied; int copied;
int err = 0; int err = 0;
...@@ -1637,7 +1637,7 @@ static int sctp_setsockopt_events(struct sock *sk, char __user *optval, ...@@ -1637,7 +1637,7 @@ static int sctp_setsockopt_events(struct sock *sk, char __user *optval,
static int sctp_setsockopt_autoclose(struct sock *sk, char __user *optval, static int sctp_setsockopt_autoclose(struct sock *sk, char __user *optval,
int optlen) int optlen)
{ {
struct sctp_opt *sp = sctp_sk(sk); struct sctp_sock *sp = sctp_sk(sk);
/* Applicable to UDP-style socket only */ /* Applicable to UDP-style socket only */
if (sctp_style(sk, TCP)) if (sctp_style(sk, TCP))
...@@ -1779,7 +1779,7 @@ static int sctp_setsockopt_peer_addr_params(struct sock *sk, ...@@ -1779,7 +1779,7 @@ static int sctp_setsockopt_peer_addr_params(struct sock *sk,
static int sctp_setsockopt_initmsg(struct sock *sk, char __user *optval, int optlen) static int sctp_setsockopt_initmsg(struct sock *sk, char __user *optval, int optlen)
{ {
struct sctp_initmsg sinit; struct sctp_initmsg sinit;
struct sctp_opt *sp = sctp_sk(sk); struct sctp_sock *sp = sctp_sk(sk);
if (optlen != sizeof(struct sctp_initmsg)) if (optlen != sizeof(struct sctp_initmsg))
return -EINVAL; return -EINVAL;
...@@ -1817,7 +1817,7 @@ static int sctp_setsockopt_default_send_param(struct sock *sk, ...@@ -1817,7 +1817,7 @@ static int sctp_setsockopt_default_send_param(struct sock *sk,
{ {
struct sctp_sndrcvinfo info; struct sctp_sndrcvinfo info;
struct sctp_association *asoc; struct sctp_association *asoc;
struct sctp_opt *sp = sctp_sk(sk); struct sctp_sock *sp = sctp_sk(sk);
if (optlen != sizeof(struct sctp_sndrcvinfo)) if (optlen != sizeof(struct sctp_sndrcvinfo))
return -EINVAL; return -EINVAL;
...@@ -1934,7 +1934,7 @@ static int sctp_setsockopt_rtoinfo(struct sock *sk, char __user *optval, int opt ...@@ -1934,7 +1934,7 @@ static int sctp_setsockopt_rtoinfo(struct sock *sk, char __user *optval, int opt
/* If there is no association or the association-id = 0 /* If there is no association or the association-id = 0
* set the values to the endpoint. * set the values to the endpoint.
*/ */
struct sctp_opt *sp = sctp_sk(sk); struct sctp_sock *sp = sctp_sk(sk);
if (rtoinfo.srto_initial != 0) if (rtoinfo.srto_initial != 0)
sp->rtoinfo.srto_initial = rtoinfo.srto_initial; sp->rtoinfo.srto_initial = rtoinfo.srto_initial;
...@@ -1987,7 +1987,7 @@ static int sctp_setsockopt_associnfo(struct sock *sk, char __user *optval, int o ...@@ -1987,7 +1987,7 @@ static int sctp_setsockopt_associnfo(struct sock *sk, char __user *optval, int o
} }
} else { } else {
/* Set the values to the endpoint */ /* Set the values to the endpoint */
struct sctp_opt *sp = sctp_sk(sk); struct sctp_sock *sp = sctp_sk(sk);
if (assocparams.sasoc_asocmaxrxt != 0) if (assocparams.sasoc_asocmaxrxt != 0)
sp->assocparams.sasoc_asocmaxrxt = sp->assocparams.sasoc_asocmaxrxt =
...@@ -2012,7 +2012,7 @@ static int sctp_setsockopt_associnfo(struct sock *sk, char __user *optval, int o ...@@ -2012,7 +2012,7 @@ static int sctp_setsockopt_associnfo(struct sock *sk, char __user *optval, int o
static int sctp_setsockopt_mappedv4(struct sock *sk, char __user *optval, int optlen) static int sctp_setsockopt_mappedv4(struct sock *sk, char __user *optval, int optlen)
{ {
int val; int val;
struct sctp_opt *sp = sctp_sk(sk); struct sctp_sock *sp = sctp_sk(sk);
if (optlen < sizeof(int)) if (optlen < sizeof(int))
return -EINVAL; return -EINVAL;
...@@ -2040,7 +2040,7 @@ static int sctp_setsockopt_maxseg(struct sock *sk, char __user *optval, int optl ...@@ -2040,7 +2040,7 @@ static int sctp_setsockopt_maxseg(struct sock *sk, char __user *optval, int optl
{ {
struct sctp_association *asoc; struct sctp_association *asoc;
struct list_head *pos; struct list_head *pos;
struct sctp_opt *sp = sctp_sk(sk); struct sctp_sock *sp = sctp_sk(sk);
int val; int val;
if (optlen < sizeof(int)) if (optlen < sizeof(int))
...@@ -2074,7 +2074,7 @@ static int sctp_setsockopt_maxseg(struct sock *sk, char __user *optval, int optl ...@@ -2074,7 +2074,7 @@ static int sctp_setsockopt_maxseg(struct sock *sk, char __user *optval, int optl
static int sctp_setsockopt_peer_primary_addr(struct sock *sk, char __user *optval, static int sctp_setsockopt_peer_primary_addr(struct sock *sk, char __user *optval,
int optlen) int optlen)
{ {
struct sctp_opt *sp; struct sctp_sock *sp;
struct sctp_endpoint *ep; struct sctp_endpoint *ep;
struct sctp_association *asoc = NULL; struct sctp_association *asoc = NULL;
struct sctp_setpeerprim prim; struct sctp_setpeerprim prim;
...@@ -2269,7 +2269,7 @@ SCTP_STATIC int sctp_setsockopt(struct sock *sk, int level, int optname, ...@@ -2269,7 +2269,7 @@ SCTP_STATIC int sctp_setsockopt(struct sock *sk, int level, int optname,
SCTP_STATIC int sctp_connect(struct sock *sk, struct sockaddr *uaddr, SCTP_STATIC int sctp_connect(struct sock *sk, struct sockaddr *uaddr,
int addr_len) int addr_len)
{ {
struct sctp_opt *sp; struct sctp_sock *sp;
struct sctp_endpoint *ep; struct sctp_endpoint *ep;
struct sctp_association *asoc; struct sctp_association *asoc;
struct sctp_transport *transport; struct sctp_transport *transport;
...@@ -2390,7 +2390,7 @@ SCTP_STATIC int sctp_disconnect(struct sock *sk, int flags) ...@@ -2390,7 +2390,7 @@ SCTP_STATIC int sctp_disconnect(struct sock *sk, int flags)
*/ */
SCTP_STATIC struct sock *sctp_accept(struct sock *sk, int flags, int *err) SCTP_STATIC struct sock *sctp_accept(struct sock *sk, int flags, int *err)
{ {
struct sctp_opt *sp; struct sctp_sock *sp;
struct sctp_endpoint *ep; struct sctp_endpoint *ep;
struct sock *newsk = NULL; struct sock *newsk = NULL;
struct sctp_association *asoc; struct sctp_association *asoc;
...@@ -2453,7 +2453,7 @@ SCTP_STATIC int sctp_ioctl(struct sock *sk, int cmd, unsigned long arg) ...@@ -2453,7 +2453,7 @@ SCTP_STATIC int sctp_ioctl(struct sock *sk, int cmd, unsigned long arg)
SCTP_STATIC int sctp_init_sock(struct sock *sk) SCTP_STATIC int sctp_init_sock(struct sock *sk)
{ {
struct sctp_endpoint *ep; struct sctp_endpoint *ep;
struct sctp_opt *sp; struct sctp_sock *sp;
SCTP_DEBUG_PRINTK("sctp_init_sock(sk: %p)\n", sk); SCTP_DEBUG_PRINTK("sctp_init_sock(sk: %p)\n", sk);
...@@ -3007,7 +3007,7 @@ static int sctp_getsockopt_peer_addrs(struct sock *sk, int len, ...@@ -3007,7 +3007,7 @@ static int sctp_getsockopt_peer_addrs(struct sock *sk, int len,
struct sctp_transport *from; struct sctp_transport *from;
void __user *to; void __user *to;
union sctp_addr temp; union sctp_addr temp;
struct sctp_opt *sp = sctp_sk(sk); struct sctp_sock *sp = sctp_sk(sk);
int addrlen; int addrlen;
if (len != sizeof(struct sctp_getaddrs)) if (len != sizeof(struct sctp_getaddrs))
...@@ -3164,7 +3164,7 @@ static int sctp_getsockopt_local_addrs(struct sock *sk, int len, ...@@ -3164,7 +3164,7 @@ static int sctp_getsockopt_local_addrs(struct sock *sk, int len,
struct sctp_sockaddr_entry *addr; struct sctp_sockaddr_entry *addr;
void __user *to; void __user *to;
union sctp_addr temp; union sctp_addr temp;
struct sctp_opt *sp = sctp_sk(sk); struct sctp_sock *sp = sctp_sk(sk);
int addrlen; int addrlen;
rwlock_t *addr_lock; rwlock_t *addr_lock;
int err = 0; int err = 0;
...@@ -3250,7 +3250,7 @@ static int sctp_getsockopt_primary_addr(struct sock *sk, int len, ...@@ -3250,7 +3250,7 @@ static int sctp_getsockopt_primary_addr(struct sock *sk, int len,
{ {
struct sctp_prim prim; struct sctp_prim prim;
struct sctp_association *asoc; struct sctp_association *asoc;
struct sctp_opt *sp = sctp_sk(sk); struct sctp_sock *sp = sctp_sk(sk);
if (len != sizeof(struct sctp_prim)) if (len != sizeof(struct sctp_prim))
return -EINVAL; return -EINVAL;
...@@ -3329,7 +3329,7 @@ static int sctp_getsockopt_default_send_param(struct sock *sk, ...@@ -3329,7 +3329,7 @@ static int sctp_getsockopt_default_send_param(struct sock *sk,
{ {
struct sctp_sndrcvinfo info; struct sctp_sndrcvinfo info;
struct sctp_association *asoc; struct sctp_association *asoc;
struct sctp_opt *sp = sctp_sk(sk); struct sctp_sock *sp = sctp_sk(sk);
if (len != sizeof(struct sctp_sndrcvinfo)) if (len != sizeof(struct sctp_sndrcvinfo))
return -EINVAL; return -EINVAL;
...@@ -3423,7 +3423,7 @@ static int sctp_getsockopt_rtoinfo(struct sock *sk, int len, ...@@ -3423,7 +3423,7 @@ static int sctp_getsockopt_rtoinfo(struct sock *sk, int len,
rtoinfo.srto_min = jiffies_to_msecs(asoc->rto_min); rtoinfo.srto_min = jiffies_to_msecs(asoc->rto_min);
} else { } else {
/* Values corresponding to the endpoint. */ /* Values corresponding to the endpoint. */
struct sctp_opt *sp = sctp_sk(sk); struct sctp_sock *sp = sctp_sk(sk);
rtoinfo.srto_initial = sp->rtoinfo.srto_initial; rtoinfo.srto_initial = sp->rtoinfo.srto_initial;
rtoinfo.srto_max = sp->rtoinfo.srto_max; rtoinfo.srto_max = sp->rtoinfo.srto_max;
...@@ -3489,7 +3489,7 @@ static int sctp_getsockopt_associnfo(struct sock *sk, int len, ...@@ -3489,7 +3489,7 @@ static int sctp_getsockopt_associnfo(struct sock *sk, int len,
assocparams.sasoc_number_peer_destinations = cnt; assocparams.sasoc_number_peer_destinations = cnt;
} else { } else {
/* Values corresponding to the endpoint */ /* Values corresponding to the endpoint */
struct sctp_opt *sp = sctp_sk(sk); struct sctp_sock *sp = sctp_sk(sk);
assocparams.sasoc_asocmaxrxt = sp->assocparams.sasoc_asocmaxrxt; assocparams.sasoc_asocmaxrxt = sp->assocparams.sasoc_asocmaxrxt;
assocparams.sasoc_peer_rwnd = sp->assocparams.sasoc_peer_rwnd; assocparams.sasoc_peer_rwnd = sp->assocparams.sasoc_peer_rwnd;
...@@ -3524,7 +3524,7 @@ static int sctp_getsockopt_mappedv4(struct sock *sk, int len, ...@@ -3524,7 +3524,7 @@ static int sctp_getsockopt_mappedv4(struct sock *sk, int len,
char __user *optval, int __user *optlen) char __user *optval, int __user *optlen)
{ {
int val; int val;
struct sctp_opt *sp = sctp_sk(sk); struct sctp_sock *sp = sctp_sk(sk);
if (len < sizeof(int)) if (len < sizeof(int))
return -EINVAL; return -EINVAL;
...@@ -3876,7 +3876,7 @@ static int sctp_get_port(struct sock *sk, unsigned short snum) ...@@ -3876,7 +3876,7 @@ static int sctp_get_port(struct sock *sk, unsigned short snum)
*/ */
SCTP_STATIC int sctp_seqpacket_listen(struct sock *sk, int backlog) SCTP_STATIC int sctp_seqpacket_listen(struct sock *sk, int backlog)
{ {
struct sctp_opt *sp = sctp_sk(sk); struct sctp_sock *sp = sctp_sk(sk);
struct sctp_endpoint *ep = sp->ep; struct sctp_endpoint *ep = sp->ep;
/* Only UDP style sockets that are not peeled off are allowed to /* Only UDP style sockets that are not peeled off are allowed to
...@@ -3925,7 +3925,7 @@ SCTP_STATIC int sctp_seqpacket_listen(struct sock *sk, int backlog) ...@@ -3925,7 +3925,7 @@ SCTP_STATIC int sctp_seqpacket_listen(struct sock *sk, int backlog)
*/ */
SCTP_STATIC int sctp_stream_listen(struct sock *sk, int backlog) SCTP_STATIC int sctp_stream_listen(struct sock *sk, int backlog)
{ {
struct sctp_opt *sp = sctp_sk(sk); struct sctp_sock *sp = sctp_sk(sk);
struct sctp_endpoint *ep = sp->ep; struct sctp_endpoint *ep = sp->ep;
/* If backlog is zero, disable listening. */ /* If backlog is zero, disable listening. */
...@@ -4026,7 +4026,7 @@ int sctp_inet_listen(struct socket *sock, int backlog) ...@@ -4026,7 +4026,7 @@ int sctp_inet_listen(struct socket *sock, int backlog)
unsigned int sctp_poll(struct file *file, struct socket *sock, poll_table *wait) unsigned int sctp_poll(struct file *file, struct socket *sock, poll_table *wait)
{ {
struct sock *sk = sock->sk; struct sock *sk = sock->sk;
struct sctp_opt *sp = sctp_sk(sk); struct sctp_sock *sp = sctp_sk(sk);
unsigned int mask; unsigned int mask;
poll_wait(file, sk->sk_sleep, wait); poll_wait(file, sk->sk_sleep, wait);
...@@ -4654,8 +4654,8 @@ static void sctp_sock_migrate(struct sock *oldsk, struct sock *newsk, ...@@ -4654,8 +4654,8 @@ static void sctp_sock_migrate(struct sock *oldsk, struct sock *newsk,
struct sctp_association *assoc, struct sctp_association *assoc,
sctp_socket_type_t type) sctp_socket_type_t type)
{ {
struct sctp_opt *oldsp = sctp_sk(oldsk); struct sctp_sock *oldsp = sctp_sk(oldsk);
struct sctp_opt *newsp = sctp_sk(newsk); struct sctp_sock *newsp = sctp_sk(newsk);
struct sctp_bind_bucket *pp; /* hash list port iterator */ struct sctp_bind_bucket *pp; /* hash list port iterator */
struct sctp_endpoint *newep = newsp->ep; struct sctp_endpoint *newep = newsp->ep;
struct sk_buff *skb, *tmp; struct sk_buff *skb, *tmp;
...@@ -4667,7 +4667,7 @@ static void sctp_sock_migrate(struct sock *oldsk, struct sock *newsk, ...@@ -4667,7 +4667,7 @@ static void sctp_sock_migrate(struct sock *oldsk, struct sock *newsk,
newsk->sk_sndbuf = oldsk->sk_sndbuf; newsk->sk_sndbuf = oldsk->sk_sndbuf;
newsk->sk_rcvbuf = oldsk->sk_rcvbuf; newsk->sk_rcvbuf = oldsk->sk_rcvbuf;
/* Brute force copy old sctp opt. */ /* Brute force copy old sctp opt. */
memcpy(newsp, oldsp, sizeof(struct sctp_opt)); inet_sk_copy_descendant(newsk, oldsk);
/* Restore the ep value that was overwritten with the above structure /* Restore the ep value that was overwritten with the above structure
* copy. * copy.
......
...@@ -237,7 +237,7 @@ void sctp_transport_pmtu(struct sctp_transport *transport) ...@@ -237,7 +237,7 @@ void sctp_transport_pmtu(struct sctp_transport *transport)
* address. * address.
*/ */
void sctp_transport_route(struct sctp_transport *transport, void sctp_transport_route(struct sctp_transport *transport,
union sctp_addr *saddr, struct sctp_opt *opt) union sctp_addr *saddr, struct sctp_sock *opt)
{ {
struct sctp_association *asoc = transport->asoc; struct sctp_association *asoc = transport->asoc;
struct sctp_af *af = transport->af_specific; struct sctp_af *af = transport->af_specific;
......
...@@ -138,8 +138,7 @@ int sctp_ulpq_tail_data(struct sctp_ulpq *ulpq, struct sctp_chunk *chunk, ...@@ -138,8 +138,7 @@ int sctp_ulpq_tail_data(struct sctp_ulpq *ulpq, struct sctp_chunk *chunk,
*/ */
int sctp_clear_pd(struct sock *sk) int sctp_clear_pd(struct sock *sk)
{ {
struct sctp_opt *sp; struct sctp_sock *sp = sctp_sk(sk);
sp = sctp_sk(sk);
sp->pd_mode = 0; sp->pd_mode = 0;
if (!skb_queue_empty(&sp->pd_lobby)) { if (!skb_queue_empty(&sp->pd_lobby)) {
......
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