Commit 018b2fb5 authored by Arnaldo Carvalho de Melo's avatar Arnaldo Carvalho de Melo Committed by David S. Miller

[INET] move inet_sock into inet_opt and rename it to inet_sock

With this we can remove all the cut'n'pasted layouts in all inet_sock
derived classes, such as tcp_sock, udp_sock, sctp_sock, etc.
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@conectiva.com.br>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 463f7d6a
...@@ -107,7 +107,14 @@ struct ip_options { ...@@ -107,7 +107,14 @@ struct ip_options {
#define optlength(opt) (sizeof(struct ip_options) + opt->optlen) #define optlength(opt) (sizeof(struct ip_options) + opt->optlen)
struct inet_opt { struct ipv6_pinfo;
struct inet_sock {
/* sk and pinet6 has to be the first two members of inet_sock */
struct sock sk;
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
struct ipv6_pinfo *pinet6;
#endif
/* Socket demultiplex comparisons on incoming packets. */ /* Socket demultiplex comparisons on incoming packets. */
__u32 daddr; /* Foreign IPv4 addr */ __u32 daddr; /* Foreign IPv4 addr */
__u32 rcv_saddr; /* Bound local IPv4 addr */ __u32 rcv_saddr; /* Bound local IPv4 addr */
...@@ -146,20 +153,9 @@ struct inet_opt { ...@@ -146,20 +153,9 @@ struct inet_opt {
#define IPCORK_OPT 1 /* ip-options has been held in ipcork.opt */ #define IPCORK_OPT 1 /* ip-options has been held in ipcork.opt */
struct ipv6_pinfo; static inline struct inet_sock *inet_sk(const struct sock *sk)
/* WARNING: don't change the layout of the members in inet_sock! */
struct inet_sock {
struct sock sk;
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
struct ipv6_pinfo *pinet6;
#endif
struct inet_opt inet;
};
static inline struct inet_opt * inet_sk(const struct sock *__sk)
{ {
return &((struct inet_sock *)__sk)->inet; return (struct inet_sock *)sk;
} }
#endif #endif
......
...@@ -256,32 +256,26 @@ struct raw6_opt { ...@@ -256,32 +256,26 @@ struct raw6_opt {
/* WARNING: don't change the layout of the members in {raw,udp,tcp}6_sock! */ /* WARNING: don't change the layout of the members in {raw,udp,tcp}6_sock! */
struct raw6_sock { struct raw6_sock {
struct sock sk; struct inet_sock inet;
struct ipv6_pinfo *pinet6;
struct inet_opt inet;
struct raw6_opt raw6; struct raw6_opt raw6;
struct ipv6_pinfo inet6; struct ipv6_pinfo inet6;
}; };
struct udp6_sock { struct udp6_sock {
struct sock sk; struct inet_sock inet;
struct ipv6_pinfo *pinet6;
struct inet_opt inet;
struct udp_opt udp; struct udp_opt udp;
struct ipv6_pinfo inet6; struct ipv6_pinfo inet6;
}; };
struct tcp6_sock { struct tcp6_sock {
struct sock sk; struct inet_sock inet;
struct ipv6_pinfo *pinet6;
struct inet_opt inet;
struct tcp_opt tcp; struct tcp_opt tcp;
struct ipv6_pinfo inet6; struct ipv6_pinfo inet6;
}; };
static inline struct ipv6_pinfo * inet6_sk(const struct sock *__sk) static inline struct ipv6_pinfo * inet6_sk(const struct sock *__sk)
{ {
return ((struct raw6_sock *)__sk)->pinet6; return inet_sk(__sk)->pinet6;
} }
static inline struct raw6_opt * raw6_sk(const struct sock *__sk) static inline struct raw6_opt * raw6_sk(const struct sock *__sk)
......
...@@ -440,11 +440,7 @@ struct tcp_opt { ...@@ -440,11 +440,7 @@ struct tcp_opt {
/* WARNING: don't change the layout of the members in tcp_sock! */ /* WARNING: don't change the layout of the members in tcp_sock! */
struct tcp_sock { struct tcp_sock {
struct sock sk; struct inet_sock inet;
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
struct ipv6_pinfo *pinet6;
#endif
struct inet_opt inet;
struct tcp_opt tcp; struct tcp_opt tcp;
}; };
......
...@@ -53,11 +53,7 @@ struct udp_opt { ...@@ -53,11 +53,7 @@ struct udp_opt {
/* WARNING: don't change the layout of the members in udp_sock! */ /* WARNING: don't change the layout of the members in udp_sock! */
struct udp_sock { struct udp_sock {
struct sock sk; struct inet_sock inet;
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
struct ipv6_pinfo *pinet6;
#endif
struct inet_opt inet;
struct udp_opt udp; struct udp_opt udp;
}; };
......
...@@ -50,15 +50,9 @@ struct raw_opt { ...@@ -50,15 +50,9 @@ struct raw_opt {
struct icmp_filter filter; struct icmp_filter filter;
}; };
struct ipv6_pinfo;
/* WARNING: don't change the layout of the members in raw_sock! */ /* WARNING: don't change the layout of the members in raw_sock! */
struct raw_sock { struct raw_sock {
struct sock sk; struct inet_sock inet;
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
struct ipv6_pinfo *pinet6;
#endif
struct inet_opt inet;
struct raw_opt raw4; struct raw_opt raw4;
}; };
......
...@@ -584,26 +584,20 @@ static inline int sctp_vtag_hashfn(__u16 lport, __u16 rport, __u32 vtag) ...@@ -584,26 +584,20 @@ static inline int sctp_vtag_hashfn(__u16 lport, __u16 rport, __u32 vtag)
/* WARNING: Do not change the layout of the members in sctp_sock! */ /* WARNING: Do not change the layout of the members in sctp_sock! */
struct sctp_sock { struct sctp_sock {
struct sock sk; struct inet_sock inet;
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
struct ipv6_pinfo *pinet6;
#endif /* CONFIG_IPV6 */
struct inet_opt inet;
struct sctp_opt sctp; struct sctp_opt sctp;
}; };
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
struct sctp6_sock { struct sctp6_sock {
struct sock sk; struct inet_sock inet;
struct ipv6_pinfo *pinet6;
struct inet_opt inet;
struct sctp_opt sctp; struct sctp_opt sctp;
struct ipv6_pinfo inet6; struct ipv6_pinfo inet6;
}; };
#endif /* CONFIG_IPV6 */ #endif /* CONFIG_IPV6 */
#define sctp_sk(__sk) (&((struct sctp_sock *)__sk)->sctp) #define sctp_sk(__sk) (&((struct sctp_sock *)__sk)->sctp)
#define sctp_opt2sk(__sp) &container_of(__sp, struct sctp_sock, sctp)->sk #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))
......
...@@ -196,7 +196,7 @@ struct tcp_tw_bucket { ...@@ -196,7 +196,7 @@ struct tcp_tw_bucket {
unsigned char tw_rcv_wscale; unsigned char tw_rcv_wscale;
__u16 tw_sport; __u16 tw_sport;
/* Socket demultiplex comparisons on incoming packets. */ /* Socket demultiplex comparisons on incoming packets. */
/* these five are in inet_opt */ /* these five are in inet_sock */
__u32 tw_daddr __u32 tw_daddr
__attribute__((aligned(TCP_ADDRCMP_ALIGN_BYTES))); __attribute__((aligned(TCP_ADDRCMP_ALIGN_BYTES)));
__u32 tw_rcv_saddr; __u32 tw_rcv_saddr;
......
...@@ -131,7 +131,7 @@ static spinlock_t inetsw_lock = SPIN_LOCK_UNLOCKED; ...@@ -131,7 +131,7 @@ static spinlock_t inetsw_lock = SPIN_LOCK_UNLOCKED;
void inet_sock_destruct(struct sock *sk) void inet_sock_destruct(struct sock *sk)
{ {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
__skb_queue_purge(&sk->sk_receive_queue); __skb_queue_purge(&sk->sk_receive_queue);
__skb_queue_purge(&sk->sk_error_queue); __skb_queue_purge(&sk->sk_error_queue);
...@@ -173,7 +173,7 @@ void inet_sock_destruct(struct sock *sk) ...@@ -173,7 +173,7 @@ void inet_sock_destruct(struct sock *sk)
static int inet_autobind(struct sock *sk) static int inet_autobind(struct sock *sk)
{ {
struct inet_opt *inet; struct inet_sock *inet;
/* We may need to bind the socket. */ /* We may need to bind the socket. */
lock_sock(sk); lock_sock(sk);
inet = inet_sk(sk); inet = inet_sk(sk);
...@@ -232,7 +232,7 @@ static int inet_create(struct socket *sock, int protocol) ...@@ -232,7 +232,7 @@ static int inet_create(struct socket *sock, int protocol)
struct sock *sk; struct sock *sk;
struct list_head *p; struct list_head *p;
struct inet_protosw *answer; struct inet_protosw *answer;
struct inet_opt *inet; struct inet_sock *inet;
struct proto *answer_prot; struct proto *answer_prot;
unsigned char answer_flags; unsigned char answer_flags;
char answer_no_check; char answer_no_check;
...@@ -389,7 +389,7 @@ int inet_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) ...@@ -389,7 +389,7 @@ int inet_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
{ {
struct sockaddr_in *addr = (struct sockaddr_in *)uaddr; struct sockaddr_in *addr = (struct sockaddr_in *)uaddr;
struct sock *sk = sock->sk; struct sock *sk = sock->sk;
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
unsigned short snum; unsigned short snum;
int chk_addr_ret; int chk_addr_ret;
int err; int err;
...@@ -623,7 +623,7 @@ int inet_getname(struct socket *sock, struct sockaddr *uaddr, ...@@ -623,7 +623,7 @@ int inet_getname(struct socket *sock, struct sockaddr *uaddr,
int *uaddr_len, int peer) int *uaddr_len, int peer)
{ {
struct sock *sk = sock->sk; struct sock *sk = sock->sk;
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct sockaddr_in *sin = (struct sockaddr_in *)uaddr; struct sockaddr_in *sin = (struct sockaddr_in *)uaddr;
sin->sin_family = AF_INET; sin->sin_family = AF_INET;
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
int ip4_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) int ip4_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
{ {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct sockaddr_in *usin = (struct sockaddr_in *) uaddr; struct sockaddr_in *usin = (struct sockaddr_in *) uaddr;
struct rtable *rt; struct rtable *rt;
u32 saddr; u32 saddr;
......
...@@ -377,7 +377,7 @@ static void icmp_push_reply(struct icmp_bxm *icmp_param, ...@@ -377,7 +377,7 @@ static void icmp_push_reply(struct icmp_bxm *icmp_param,
static void icmp_reply(struct icmp_bxm *icmp_param, struct sk_buff *skb) static void icmp_reply(struct icmp_bxm *icmp_param, struct sk_buff *skb)
{ {
struct sock *sk = icmp_socket->sk; struct sock *sk = icmp_socket->sk;
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct ipcm_cookie ipc; struct ipcm_cookie ipc;
struct rtable *rt = (struct rtable *)skb->dst; struct rtable *rt = (struct rtable *)skb->dst;
u32 daddr; u32 daddr;
...@@ -1097,7 +1097,7 @@ static struct icmp_control icmp_pointers[NR_ICMP_TYPES + 1] = { ...@@ -1097,7 +1097,7 @@ static struct icmp_control icmp_pointers[NR_ICMP_TYPES + 1] = {
void __init icmp_init(struct net_proto_family *ops) void __init icmp_init(struct net_proto_family *ops)
{ {
struct inet_opt *inet; struct inet_sock *inet;
int i; int i;
for (i = 0; i < NR_CPUS; i++) { for (i = 0; i < NR_CPUS; i++) {
......
...@@ -1617,7 +1617,7 @@ int ip_mc_join_group(struct sock *sk , struct ip_mreqn *imr) ...@@ -1617,7 +1617,7 @@ int ip_mc_join_group(struct sock *sk , struct ip_mreqn *imr)
u32 addr = imr->imr_multiaddr.s_addr; u32 addr = imr->imr_multiaddr.s_addr;
struct ip_mc_socklist *iml, *i; struct ip_mc_socklist *iml, *i;
struct in_device *in_dev; struct in_device *in_dev;
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
int count = 0; int count = 0;
if (!MULTICAST(addr)) if (!MULTICAST(addr))
...@@ -1691,7 +1691,7 @@ int ip_mc_leave_src(struct sock *sk, struct ip_mc_socklist *iml, ...@@ -1691,7 +1691,7 @@ int ip_mc_leave_src(struct sock *sk, struct ip_mc_socklist *iml,
int ip_mc_leave_group(struct sock *sk, struct ip_mreqn *imr) int ip_mc_leave_group(struct sock *sk, struct ip_mreqn *imr)
{ {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct ip_mc_socklist *iml, **imlp; struct ip_mc_socklist *iml, **imlp;
rtnl_lock(); rtnl_lock();
...@@ -1734,7 +1734,7 @@ int ip_mc_source(int add, int omode, struct sock *sk, struct ...@@ -1734,7 +1734,7 @@ int ip_mc_source(int add, int omode, struct sock *sk, struct
u32 addr = mreqs->imr_multiaddr; u32 addr = mreqs->imr_multiaddr;
struct ip_mc_socklist *pmc; struct ip_mc_socklist *pmc;
struct in_device *in_dev = NULL; struct in_device *in_dev = NULL;
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct ip_sf_socklist *psl; struct ip_sf_socklist *psl;
int i, j, rv; int i, j, rv;
...@@ -1852,7 +1852,7 @@ int ip_mc_msfilter(struct sock *sk, struct ip_msfilter *msf, int ifindex) ...@@ -1852,7 +1852,7 @@ int ip_mc_msfilter(struct sock *sk, struct ip_msfilter *msf, int ifindex)
u32 addr = msf->imsf_multiaddr; u32 addr = msf->imsf_multiaddr;
struct ip_mc_socklist *pmc; struct ip_mc_socklist *pmc;
struct in_device *in_dev; struct in_device *in_dev;
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct ip_sf_socklist *newpsl, *psl; struct ip_sf_socklist *newpsl, *psl;
if (!MULTICAST(addr)) if (!MULTICAST(addr))
...@@ -1922,7 +1922,7 @@ int ip_mc_msfget(struct sock *sk, struct ip_msfilter *msf, ...@@ -1922,7 +1922,7 @@ int ip_mc_msfget(struct sock *sk, struct ip_msfilter *msf,
u32 addr = msf->imsf_multiaddr; u32 addr = msf->imsf_multiaddr;
struct ip_mc_socklist *pmc; struct ip_mc_socklist *pmc;
struct in_device *in_dev; struct in_device *in_dev;
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct ip_sf_socklist *psl; struct ip_sf_socklist *psl;
if (!MULTICAST(addr)) if (!MULTICAST(addr))
...@@ -1980,7 +1980,7 @@ int ip_mc_gsfget(struct sock *sk, struct group_filter *gsf, ...@@ -1980,7 +1980,7 @@ int ip_mc_gsfget(struct sock *sk, struct group_filter *gsf,
struct sockaddr_in *psin; struct sockaddr_in *psin;
u32 addr; u32 addr;
struct ip_mc_socklist *pmc; struct ip_mc_socklist *pmc;
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct ip_sf_socklist *psl; struct ip_sf_socklist *psl;
psin = (struct sockaddr_in *)&gsf->gf_group; psin = (struct sockaddr_in *)&gsf->gf_group;
...@@ -2033,7 +2033,7 @@ int ip_mc_gsfget(struct sock *sk, struct group_filter *gsf, ...@@ -2033,7 +2033,7 @@ int ip_mc_gsfget(struct sock *sk, struct group_filter *gsf,
*/ */
int ip_mc_sf_allow(struct sock *sk, u32 loc_addr, u32 rmt_addr, int dif) int ip_mc_sf_allow(struct sock *sk, u32 loc_addr, u32 rmt_addr, int dif)
{ {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct ip_mc_socklist *pmc; struct ip_mc_socklist *pmc;
struct ip_sf_socklist *psl; struct ip_sf_socklist *psl;
int i; int i;
...@@ -2069,7 +2069,7 @@ int ip_mc_sf_allow(struct sock *sk, u32 loc_addr, u32 rmt_addr, int dif) ...@@ -2069,7 +2069,7 @@ int ip_mc_sf_allow(struct sock *sk, u32 loc_addr, u32 rmt_addr, int dif)
void ip_mc_drop_socket(struct sock *sk) void ip_mc_drop_socket(struct sock *sk)
{ {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct ip_mc_socklist *iml; struct ip_mc_socklist *iml;
if (inet->mc_list == NULL) if (inet->mc_list == NULL)
......
...@@ -115,7 +115,7 @@ static int ip_dev_loopback_xmit(struct sk_buff *newskb) ...@@ -115,7 +115,7 @@ static int ip_dev_loopback_xmit(struct sk_buff *newskb)
return 0; return 0;
} }
static inline int ip_select_ttl(struct inet_opt *inet, struct dst_entry *dst) static inline int ip_select_ttl(struct inet_sock *inet, struct dst_entry *dst)
{ {
int ttl = inet->uc_ttl; int ttl = inet->uc_ttl;
...@@ -131,7 +131,7 @@ static inline int ip_select_ttl(struct inet_opt *inet, struct dst_entry *dst) ...@@ -131,7 +131,7 @@ static inline int ip_select_ttl(struct inet_opt *inet, struct dst_entry *dst)
int ip_build_and_send_pkt(struct sk_buff *skb, struct sock *sk, int ip_build_and_send_pkt(struct sk_buff *skb, struct sock *sk,
u32 saddr, u32 daddr, struct ip_options *opt) u32 saddr, u32 daddr, struct ip_options *opt)
{ {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct rtable *rt = (struct rtable *)skb->dst; struct rtable *rt = (struct rtable *)skb->dst;
struct iphdr *iph; struct iphdr *iph;
...@@ -297,7 +297,7 @@ int ip_output(struct sk_buff *skb) ...@@ -297,7 +297,7 @@ int ip_output(struct sk_buff *skb)
int ip_queue_xmit(struct sk_buff *skb, int ipfragok) int ip_queue_xmit(struct sk_buff *skb, int ipfragok)
{ {
struct sock *sk = skb->sk; struct sock *sk = skb->sk;
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct ip_options *opt = inet->opt; struct ip_options *opt = inet->opt;
struct rtable *rt; struct rtable *rt;
struct iphdr *iph; struct iphdr *iph;
...@@ -712,7 +712,7 @@ int ip_append_data(struct sock *sk, ...@@ -712,7 +712,7 @@ int ip_append_data(struct sock *sk,
struct ipcm_cookie *ipc, struct rtable *rt, struct ipcm_cookie *ipc, struct rtable *rt,
unsigned int flags) unsigned int flags)
{ {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct sk_buff *skb; struct sk_buff *skb;
struct ip_options *opt = NULL; struct ip_options *opt = NULL;
...@@ -973,7 +973,7 @@ int ip_append_data(struct sock *sk, ...@@ -973,7 +973,7 @@ int ip_append_data(struct sock *sk,
ssize_t ip_append_page(struct sock *sk, struct page *page, ssize_t ip_append_page(struct sock *sk, struct page *page,
int offset, size_t size, int flags) int offset, size_t size, int flags)
{ {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct sk_buff *skb; struct sk_buff *skb;
struct rtable *rt; struct rtable *rt;
struct ip_options *opt = NULL; struct ip_options *opt = NULL;
...@@ -1112,7 +1112,7 @@ int ip_push_pending_frames(struct sock *sk) ...@@ -1112,7 +1112,7 @@ int ip_push_pending_frames(struct sock *sk)
{ {
struct sk_buff *skb, *tmp_skb; struct sk_buff *skb, *tmp_skb;
struct sk_buff **tail_skb; struct sk_buff **tail_skb;
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct ip_options *opt = NULL; struct ip_options *opt = NULL;
struct rtable *rt = inet->cork.rt; struct rtable *rt = inet->cork.rt;
struct iphdr *iph; struct iphdr *iph;
...@@ -1217,7 +1217,7 @@ int ip_push_pending_frames(struct sock *sk) ...@@ -1217,7 +1217,7 @@ int ip_push_pending_frames(struct sock *sk)
*/ */
void ip_flush_pending_frames(struct sock *sk) void ip_flush_pending_frames(struct sock *sk)
{ {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct sk_buff *skb; struct sk_buff *skb;
while ((skb = __skb_dequeue_tail(&sk->sk_write_queue)) != NULL) while ((skb = __skb_dequeue_tail(&sk->sk_write_queue)) != NULL)
...@@ -1260,7 +1260,7 @@ static int ip_reply_glue_bits(void *dptr, char *to, int offset, ...@@ -1260,7 +1260,7 @@ static int ip_reply_glue_bits(void *dptr, char *to, int offset,
void ip_send_reply(struct sock *sk, struct sk_buff *skb, struct ip_reply_arg *arg, void ip_send_reply(struct sock *sk, struct sk_buff *skb, struct ip_reply_arg *arg,
unsigned int len) unsigned int len)
{ {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct { struct {
struct ip_options opt; struct ip_options opt;
char data[40]; char data[40];
......
...@@ -112,7 +112,7 @@ void ip_cmsg_recv_retopts(struct msghdr *msg, struct sk_buff *skb) ...@@ -112,7 +112,7 @@ void ip_cmsg_recv_retopts(struct msghdr *msg, struct sk_buff *skb)
void ip_cmsg_recv(struct msghdr *msg, struct sk_buff *skb) void ip_cmsg_recv(struct msghdr *msg, struct sk_buff *skb)
{ {
struct inet_opt *inet = inet_sk(skb->sk); struct inet_sock *inet = inet_sk(skb->sk);
unsigned flags = inet->cmsg_flags; unsigned flags = inet->cmsg_flags;
/* Ordered by supposed usage frequency */ /* Ordered by supposed usage frequency */
...@@ -234,7 +234,7 @@ int ip_ra_control(struct sock *sk, unsigned char on, void (*destructor)(struct s ...@@ -234,7 +234,7 @@ int ip_ra_control(struct sock *sk, unsigned char on, void (*destructor)(struct s
void ip_icmp_error(struct sock *sk, struct sk_buff *skb, int err, void ip_icmp_error(struct sock *sk, struct sk_buff *skb, int err,
u16 port, u32 info, u8 *payload) u16 port, u32 info, u8 *payload)
{ {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct sock_exterr_skb *serr; struct sock_exterr_skb *serr;
if (!inet->recverr) if (!inet->recverr)
...@@ -263,7 +263,7 @@ void ip_icmp_error(struct sock *sk, struct sk_buff *skb, int err, ...@@ -263,7 +263,7 @@ void ip_icmp_error(struct sock *sk, struct sk_buff *skb, int err,
void ip_local_error(struct sock *sk, int err, u32 daddr, u16 port, u32 info) void ip_local_error(struct sock *sk, int err, u32 daddr, u16 port, u32 info)
{ {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct sock_exterr_skb *serr; struct sock_exterr_skb *serr;
struct iphdr *iph; struct iphdr *iph;
struct sk_buff *skb; struct sk_buff *skb;
...@@ -342,7 +342,7 @@ int ip_recv_error(struct sock *sk, struct msghdr *msg, int len) ...@@ -342,7 +342,7 @@ int ip_recv_error(struct sock *sk, struct msghdr *msg, int len)
sin = &errhdr.offender; sin = &errhdr.offender;
sin->sin_family = AF_UNSPEC; sin->sin_family = AF_UNSPEC;
if (serr->ee.ee_origin == SO_EE_ORIGIN_ICMP) { if (serr->ee.ee_origin == SO_EE_ORIGIN_ICMP) {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
sin->sin_family = AF_INET; sin->sin_family = AF_INET;
sin->sin_addr.s_addr = skb->nh.iph->saddr; sin->sin_addr.s_addr = skb->nh.iph->saddr;
...@@ -383,7 +383,7 @@ int ip_recv_error(struct sock *sk, struct msghdr *msg, int len) ...@@ -383,7 +383,7 @@ int ip_recv_error(struct sock *sk, struct msghdr *msg, int len)
int ip_setsockopt(struct sock *sk, int level, int optname, char __user *optval, int optlen) int ip_setsockopt(struct sock *sk, int level, int optname, char __user *optval, int optlen)
{ {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
int val=0,err; int val=0,err;
if (level != SOL_IP) if (level != SOL_IP)
...@@ -875,7 +875,7 @@ int ip_setsockopt(struct sock *sk, int level, int optname, char __user *optval, ...@@ -875,7 +875,7 @@ int ip_setsockopt(struct sock *sk, int level, int optname, char __user *optval,
int ip_getsockopt(struct sock *sk, int level, int optname, char __user *optval, int __user *optlen) int ip_getsockopt(struct sock *sk, int level, int optname, char __user *optval, int __user *optlen)
{ {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
int val; int val;
int len; int len;
......
...@@ -343,7 +343,7 @@ static void ip_vs_process_message(const char *buffer, const size_t buflen) ...@@ -343,7 +343,7 @@ static void ip_vs_process_message(const char *buffer, const size_t buflen)
*/ */
static void set_mcast_loop(struct sock *sk, u_char loop) static void set_mcast_loop(struct sock *sk, u_char loop)
{ {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
/* setsockopt(sock, SOL_IP, IP_MULTICAST_LOOP, &loop, sizeof(loop)); */ /* setsockopt(sock, SOL_IP, IP_MULTICAST_LOOP, &loop, sizeof(loop)); */
lock_sock(sk); lock_sock(sk);
...@@ -356,7 +356,7 @@ static void set_mcast_loop(struct sock *sk, u_char loop) ...@@ -356,7 +356,7 @@ static void set_mcast_loop(struct sock *sk, u_char loop)
*/ */
static void set_mcast_ttl(struct sock *sk, u_char ttl) static void set_mcast_ttl(struct sock *sk, u_char ttl)
{ {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
/* setsockopt(sock, SOL_IP, IP_MULTICAST_TTL, &ttl, sizeof(ttl)); */ /* setsockopt(sock, SOL_IP, IP_MULTICAST_TTL, &ttl, sizeof(ttl)); */
lock_sock(sk); lock_sock(sk);
...@@ -370,7 +370,7 @@ static void set_mcast_ttl(struct sock *sk, u_char ttl) ...@@ -370,7 +370,7 @@ static void set_mcast_ttl(struct sock *sk, u_char ttl)
static int set_mcast_if(struct sock *sk, char *ifname) static int set_mcast_if(struct sock *sk, char *ifname)
{ {
struct net_device *dev; struct net_device *dev;
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
if ((dev = __dev_get_by_name(ifname)) == NULL) if ((dev = __dev_get_by_name(ifname)) == NULL)
return -ENODEV; return -ENODEV;
......
...@@ -1229,7 +1229,7 @@ ip_ct_selective_cleanup(int (*kill)(const struct ip_conntrack *i, void *data), ...@@ -1229,7 +1229,7 @@ ip_ct_selective_cleanup(int (*kill)(const struct ip_conntrack *i, void *data),
static int static int
getorigdst(struct sock *sk, int optval, void __user *user, int *len) getorigdst(struct sock *sk, int optval, void __user *user, int *len)
{ {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct ip_conntrack_tuple_hash *h; struct ip_conntrack_tuple_hash *h;
struct ip_conntrack_tuple tuple; struct ip_conntrack_tuple tuple;
......
...@@ -109,7 +109,7 @@ struct sock *__raw_v4_lookup(struct sock *sk, unsigned short num, ...@@ -109,7 +109,7 @@ struct sock *__raw_v4_lookup(struct sock *sk, unsigned short num,
struct hlist_node *node; struct hlist_node *node;
sk_for_each_from(sk, node) { sk_for_each_from(sk, node) {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
if (inet->num == num && if (inet->num == num &&
!(inet->daddr && inet->daddr != raddr) && !(inet->daddr && inet->daddr != raddr) &&
...@@ -181,7 +181,7 @@ void raw_v4_input(struct sk_buff *skb, struct iphdr *iph, int hash) ...@@ -181,7 +181,7 @@ void raw_v4_input(struct sk_buff *skb, struct iphdr *iph, int hash)
void raw_err (struct sock *sk, struct sk_buff *skb, u32 info) void raw_err (struct sock *sk, struct sk_buff *skb, u32 info)
{ {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
int type = skb->h.icmph->type; int type = skb->h.icmph->type;
int code = skb->h.icmph->code; int code = skb->h.icmph->code;
int err = 0; int err = 0;
...@@ -263,7 +263,7 @@ static int raw_send_hdrinc(struct sock *sk, void *from, int length, ...@@ -263,7 +263,7 @@ static int raw_send_hdrinc(struct sock *sk, void *from, int length,
struct rtable *rt, struct rtable *rt,
unsigned int flags) unsigned int flags)
{ {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
int hh_len; int hh_len;
struct iphdr *iph; struct iphdr *iph;
struct sk_buff *skb; struct sk_buff *skb;
...@@ -374,7 +374,7 @@ static void raw_probe_proto_opt(struct flowi *fl, struct msghdr *msg) ...@@ -374,7 +374,7 @@ static void raw_probe_proto_opt(struct flowi *fl, struct msghdr *msg)
static int raw_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, static int raw_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
size_t len) size_t len)
{ {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct ipcm_cookie ipc; struct ipcm_cookie ipc;
struct rtable *rt = NULL; struct rtable *rt = NULL;
int free = 0; int free = 0;
...@@ -537,7 +537,7 @@ static void raw_close(struct sock *sk, long timeout) ...@@ -537,7 +537,7 @@ static void raw_close(struct sock *sk, long timeout)
/* This gets rid of all the nasties in af_inet. -DaveM */ /* This gets rid of all the nasties in af_inet. -DaveM */
static int raw_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len) static int raw_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len)
{ {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct sockaddr_in *addr = (struct sockaddr_in *) uaddr; struct sockaddr_in *addr = (struct sockaddr_in *) uaddr;
int ret = -EINVAL; int ret = -EINVAL;
int chk_addr_ret; int chk_addr_ret;
...@@ -565,7 +565,7 @@ out: return ret; ...@@ -565,7 +565,7 @@ out: return ret;
int raw_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, int raw_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
size_t len, int noblock, int flags, int *addr_len) size_t len, int noblock, int flags, int *addr_len)
{ {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
size_t copied = 0; size_t copied = 0;
int err = -EOPNOTSUPP; int err = -EOPNOTSUPP;
struct sockaddr_in *sin = (struct sockaddr_in *)msg->msg_name; struct sockaddr_in *sin = (struct sockaddr_in *)msg->msg_name;
...@@ -802,7 +802,7 @@ static void raw_seq_stop(struct seq_file *seq, void *v) ...@@ -802,7 +802,7 @@ static void raw_seq_stop(struct seq_file *seq, void *v)
static __inline__ char *get_raw_sock(struct sock *sp, char *tmpbuf, int i) static __inline__ char *get_raw_sock(struct sock *sp, char *tmpbuf, int i)
{ {
struct inet_opt *inet = inet_sk(sp); struct inet_sock *inet = inet_sk(sp);
unsigned int dest = inet->daddr, unsigned int dest = inet->daddr,
src = inet->rcv_saddr; src = inet->rcv_saddr;
__u16 destp = 0, __u16 destp = 0,
......
...@@ -460,7 +460,7 @@ int tcp_ioctl(struct sock *sk, int cmd, unsigned long arg) ...@@ -460,7 +460,7 @@ int tcp_ioctl(struct sock *sk, int cmd, unsigned long arg)
int tcp_listen_start(struct sock *sk) int tcp_listen_start(struct sock *sk)
{ {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct tcp_opt *tp = tcp_sk(sk); struct tcp_opt *tp = tcp_sk(sk);
struct tcp_listen_opt *lopt; struct tcp_listen_opt *lopt;
...@@ -1772,7 +1772,7 @@ static inline int tcp_need_reset(int state) ...@@ -1772,7 +1772,7 @@ static inline int tcp_need_reset(int state)
int tcp_disconnect(struct sock *sk, int flags) int tcp_disconnect(struct sock *sk, int flags)
{ {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct tcp_opt *tp = tcp_sk(sk); struct tcp_opt *tp = tcp_sk(sk);
int err = 0; int err = 0;
int old_state = sk->sk_state; int old_state = sk->sk_state;
......
...@@ -55,7 +55,7 @@ static struct sock *tcpnl; ...@@ -55,7 +55,7 @@ static struct sock *tcpnl;
static int tcpdiag_fill(struct sk_buff *skb, struct sock *sk, static int tcpdiag_fill(struct sk_buff *skb, struct sock *sk,
int ext, u32 pid, u32 seq, u16 nlmsg_flags) int ext, u32 pid, u32 seq, u16 nlmsg_flags)
{ {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct tcp_opt *tp = tcp_sk(sk); struct tcp_opt *tp = tcp_sk(sk);
struct tcpdiagmsg *r; struct tcpdiagmsg *r;
struct nlmsghdr *nlh; struct nlmsghdr *nlh;
...@@ -427,7 +427,7 @@ static int tcpdiag_dump_sock(struct sk_buff *skb, struct sock *sk, ...@@ -427,7 +427,7 @@ static int tcpdiag_dump_sock(struct sk_buff *skb, struct sock *sk,
if (cb->nlh->nlmsg_len > 4 + NLMSG_SPACE(sizeof(*r))) { if (cb->nlh->nlmsg_len > 4 + NLMSG_SPACE(sizeof(*r))) {
struct tcpdiag_entry entry; struct tcpdiag_entry entry;
struct rtattr *bc = (struct rtattr *)(r + 1); struct rtattr *bc = (struct rtattr *)(r + 1);
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
entry.family = sk->sk_family; entry.family = sk->sk_family;
#ifdef CONFIG_IP_TCPDIAG_IPV6 #ifdef CONFIG_IP_TCPDIAG_IPV6
...@@ -458,7 +458,7 @@ static int tcpdiag_fill_req(struct sk_buff *skb, struct sock *sk, ...@@ -458,7 +458,7 @@ static int tcpdiag_fill_req(struct sk_buff *skb, struct sock *sk,
struct open_request *req, struct open_request *req,
u32 pid, u32 seq) u32 pid, u32 seq)
{ {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
unsigned char *b = skb->tail; unsigned char *b = skb->tail;
struct tcpdiagmsg *r; struct tcpdiagmsg *r;
struct nlmsghdr *nlh; struct nlmsghdr *nlh;
...@@ -515,7 +515,7 @@ static int tcpdiag_dump_reqs(struct sk_buff *skb, struct sock *sk, ...@@ -515,7 +515,7 @@ static int tcpdiag_dump_reqs(struct sk_buff *skb, struct sock *sk,
struct tcp_opt *tp = tcp_sk(sk); struct tcp_opt *tp = tcp_sk(sk);
struct tcp_listen_opt *lopt; struct tcp_listen_opt *lopt;
struct rtattr *bc = NULL; struct rtattr *bc = NULL;
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
int j, s_j; int j, s_j;
int reqnum, s_reqnum; int reqnum, s_reqnum;
int err = 0; int err = 0;
...@@ -609,7 +609,7 @@ static int tcpdiag_dump(struct sk_buff *skb, struct netlink_callback *cb) ...@@ -609,7 +609,7 @@ static int tcpdiag_dump(struct sk_buff *skb, struct netlink_callback *cb)
num = 0; num = 0;
sk_for_each(sk, node, &tcp_listening_hash[i]) { sk_for_each(sk, node, &tcp_listening_hash[i]) {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
if (num < s_num) { if (num < s_num) {
num++; num++;
...@@ -670,7 +670,7 @@ static int tcpdiag_dump(struct sk_buff *skb, struct netlink_callback *cb) ...@@ -670,7 +670,7 @@ static int tcpdiag_dump(struct sk_buff *skb, struct netlink_callback *cb)
num = 0; num = 0;
sk_for_each(sk, node, &head->chain) { sk_for_each(sk, node, &head->chain) {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
if (num < s_num) if (num < s_num)
goto next_normal; goto next_normal;
...@@ -692,7 +692,7 @@ static int tcpdiag_dump(struct sk_buff *skb, struct netlink_callback *cb) ...@@ -692,7 +692,7 @@ static int tcpdiag_dump(struct sk_buff *skb, struct netlink_callback *cb)
if (r->tcpdiag_states&TCPF_TIME_WAIT) { if (r->tcpdiag_states&TCPF_TIME_WAIT) {
sk_for_each(sk, node, sk_for_each(sk, node,
&tcp_ehash[i + tcp_ehash_size].chain) { &tcp_ehash[i + tcp_ehash_size].chain) {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
if (num < s_num) if (num < s_num)
goto next_dying; goto next_dying;
......
...@@ -1647,7 +1647,7 @@ static __inline__ int tcp_packet_delayed(struct tcp_opt *tp) ...@@ -1647,7 +1647,7 @@ static __inline__ int tcp_packet_delayed(struct tcp_opt *tp)
#if FASTRETRANS_DEBUG > 1 #if FASTRETRANS_DEBUG > 1
static void DBGUNDO(struct sock *sk, struct tcp_opt *tp, const char *msg) static void DBGUNDO(struct sock *sk, struct tcp_opt *tp, const char *msg)
{ {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
printk(KERN_DEBUG "Undo %s %u.%u.%u.%u/%u c%u l%u ss%u/%u p%u\n", printk(KERN_DEBUG "Undo %s %u.%u.%u.%u/%u c%u l%u ss%u/%u p%u\n",
msg, msg,
NIPQUAD(inet->daddr), ntohs(inet->dport), NIPQUAD(inet->daddr), ntohs(inet->dport),
......
...@@ -115,7 +115,7 @@ static __inline__ int tcp_hashfn(__u32 laddr, __u16 lport, ...@@ -115,7 +115,7 @@ static __inline__ int tcp_hashfn(__u32 laddr, __u16 lport,
static __inline__ int tcp_sk_hashfn(struct sock *sk) static __inline__ int tcp_sk_hashfn(struct sock *sk)
{ {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
__u32 laddr = inet->rcv_saddr; __u32 laddr = inet->rcv_saddr;
__u16 lport = inet->num; __u16 lport = inet->num;
__u32 faddr = inet->daddr; __u32 faddr = inet->daddr;
...@@ -300,7 +300,7 @@ static int tcp_v4_get_port(struct sock *sk, unsigned short snum) ...@@ -300,7 +300,7 @@ static int tcp_v4_get_port(struct sock *sk, unsigned short snum)
*/ */
static void __tcp_put_port(struct sock *sk) static void __tcp_put_port(struct sock *sk)
{ {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct tcp_bind_hashbucket *head = &tcp_bhash[tcp_bhashfn(inet->num)]; struct tcp_bind_hashbucket *head = &tcp_bhash[tcp_bhashfn(inet->num)];
struct tcp_bind_bucket *tb; struct tcp_bind_bucket *tb;
...@@ -420,7 +420,7 @@ static struct sock *__tcp_v4_lookup_listener(struct hlist_head *head, u32 daddr, ...@@ -420,7 +420,7 @@ static struct sock *__tcp_v4_lookup_listener(struct hlist_head *head, u32 daddr,
hiscore=-1; hiscore=-1;
sk_for_each(sk, node, head) { sk_for_each(sk, node, head) {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
if (inet->num == hnum && !ipv6_only_sock(sk)) { if (inet->num == hnum && !ipv6_only_sock(sk)) {
__u32 rcv_saddr = inet->rcv_saddr; __u32 rcv_saddr = inet->rcv_saddr;
...@@ -457,7 +457,7 @@ static inline struct sock *tcp_v4_lookup_listener(u32 daddr, ...@@ -457,7 +457,7 @@ static inline struct sock *tcp_v4_lookup_listener(u32 daddr,
read_lock(&tcp_lhash_lock); read_lock(&tcp_lhash_lock);
head = &tcp_listening_hash[tcp_lhashfn(hnum)]; head = &tcp_listening_hash[tcp_lhashfn(hnum)];
if (!hlist_empty(head)) { if (!hlist_empty(head)) {
struct inet_opt *inet = inet_sk((sk = __sk_head(head))); struct inet_sock *inet = inet_sk((sk = __sk_head(head)));
if (inet->num == hnum && !sk->sk_node.next && if (inet->num == hnum && !sk->sk_node.next &&
(!inet->rcv_saddr || inet->rcv_saddr == daddr) && (!inet->rcv_saddr || inet->rcv_saddr == daddr) &&
...@@ -549,7 +549,7 @@ static inline __u32 tcp_v4_init_sequence(struct sock *sk, struct sk_buff *skb) ...@@ -549,7 +549,7 @@ static inline __u32 tcp_v4_init_sequence(struct sock *sk, struct sk_buff *skb)
static int __tcp_v4_check_established(struct sock *sk, __u16 lport, static int __tcp_v4_check_established(struct sock *sk, __u16 lport,
struct tcp_tw_bucket **twp) struct tcp_tw_bucket **twp)
{ {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
u32 daddr = inet->rcv_saddr; u32 daddr = inet->rcv_saddr;
u32 saddr = inet->daddr; u32 saddr = inet->daddr;
int dif = sk->sk_bound_dev_if; int dif = sk->sk_bound_dev_if;
...@@ -638,7 +638,7 @@ static int __tcp_v4_check_established(struct sock *sk, __u16 lport, ...@@ -638,7 +638,7 @@ static int __tcp_v4_check_established(struct sock *sk, __u16 lport,
static inline u32 connect_port_offset(const struct sock *sk) static inline u32 connect_port_offset(const struct sock *sk)
{ {
const struct inet_opt *inet = inet_sk(sk); const struct inet_sock *inet = inet_sk(sk);
return secure_tcp_port_ephemeral(inet->rcv_saddr, inet->daddr, return secure_tcp_port_ephemeral(inet->rcv_saddr, inet->daddr,
inet->dport); inet->dport);
...@@ -743,7 +743,7 @@ static inline int tcp_v4_hash_connect(struct sock *sk) ...@@ -743,7 +743,7 @@ static inline int tcp_v4_hash_connect(struct sock *sk)
/* This will initiate an outgoing connection. */ /* This will initiate an outgoing connection. */
int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
{ {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct tcp_opt *tp = tcp_sk(sk); struct tcp_opt *tp = tcp_sk(sk);
struct sockaddr_in *usin = (struct sockaddr_in *)uaddr; struct sockaddr_in *usin = (struct sockaddr_in *)uaddr;
struct rtable *rt; struct rtable *rt;
...@@ -917,7 +917,7 @@ static inline void do_pmtu_discovery(struct sock *sk, struct iphdr *iph, ...@@ -917,7 +917,7 @@ static inline void do_pmtu_discovery(struct sock *sk, struct iphdr *iph,
u32 mtu) u32 mtu)
{ {
struct dst_entry *dst; struct dst_entry *dst;
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct tcp_opt *tp = tcp_sk(sk); struct tcp_opt *tp = tcp_sk(sk);
/* We are not interested in TCP_LISTEN and open_requests (SYN-ACKs /* We are not interested in TCP_LISTEN and open_requests (SYN-ACKs
...@@ -980,7 +980,7 @@ void tcp_v4_err(struct sk_buff *skb, u32 info) ...@@ -980,7 +980,7 @@ void tcp_v4_err(struct sk_buff *skb, u32 info)
struct iphdr *iph = (struct iphdr *)skb->data; struct iphdr *iph = (struct iphdr *)skb->data;
struct tcphdr *th = (struct tcphdr *)(skb->data + (iph->ihl << 2)); struct tcphdr *th = (struct tcphdr *)(skb->data + (iph->ihl << 2));
struct tcp_opt *tp; struct tcp_opt *tp;
struct inet_opt *inet; struct inet_sock *inet;
int type = skb->h.icmph->type; int type = skb->h.icmph->type;
int code = skb->h.icmph->code; int code = skb->h.icmph->code;
struct sock *sk; struct sock *sk;
...@@ -1127,7 +1127,7 @@ void tcp_v4_err(struct sk_buff *skb, u32 info) ...@@ -1127,7 +1127,7 @@ void tcp_v4_err(struct sk_buff *skb, u32 info)
void tcp_v4_send_check(struct sock *sk, struct tcphdr *th, int len, void tcp_v4_send_check(struct sock *sk, struct tcphdr *th, int len,
struct sk_buff *skb) struct sk_buff *skb)
{ {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
if (skb->ip_summed == CHECKSUM_HW) { if (skb->ip_summed == CHECKSUM_HW) {
th->check = ~tcp_v4_check(th, len, inet->saddr, inet->daddr, 0); th->check = ~tcp_v4_check(th, len, inet->saddr, inet->daddr, 0);
...@@ -1549,7 +1549,7 @@ struct sock *tcp_v4_syn_recv_sock(struct sock *sk, struct sk_buff *skb, ...@@ -1549,7 +1549,7 @@ struct sock *tcp_v4_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
struct open_request *req, struct open_request *req,
struct dst_entry *dst) struct dst_entry *dst)
{ {
struct inet_opt *newinet; struct inet_sock *newinet;
struct tcp_opt *newtp; struct tcp_opt *newtp;
struct sock *newsk; struct sock *newsk;
...@@ -1856,7 +1856,7 @@ static void __tcp_v4_rehash(struct sock *sk) ...@@ -1856,7 +1856,7 @@ static void __tcp_v4_rehash(struct sock *sk)
static int tcp_v4_reselect_saddr(struct sock *sk) static int tcp_v4_reselect_saddr(struct sock *sk)
{ {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
int err; int err;
struct rtable *rt; struct rtable *rt;
__u32 old_saddr = inet->saddr; __u32 old_saddr = inet->saddr;
...@@ -1907,7 +1907,7 @@ static int tcp_v4_reselect_saddr(struct sock *sk) ...@@ -1907,7 +1907,7 @@ static int tcp_v4_reselect_saddr(struct sock *sk)
int tcp_v4_rebuild_header(struct sock *sk) int tcp_v4_rebuild_header(struct sock *sk)
{ {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct rtable *rt = (struct rtable *)__sk_dst_check(sk, 0); struct rtable *rt = (struct rtable *)__sk_dst_check(sk, 0);
u32 daddr; u32 daddr;
int err; int err;
...@@ -1956,7 +1956,7 @@ int tcp_v4_rebuild_header(struct sock *sk) ...@@ -1956,7 +1956,7 @@ int tcp_v4_rebuild_header(struct sock *sk)
static void v4_addr2sockaddr(struct sock *sk, struct sockaddr * uaddr) static void v4_addr2sockaddr(struct sock *sk, struct sockaddr * uaddr)
{ {
struct sockaddr_in *sin = (struct sockaddr_in *) uaddr; struct sockaddr_in *sin = (struct sockaddr_in *) uaddr;
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
sin->sin_family = AF_INET; sin->sin_family = AF_INET;
sin->sin_addr.s_addr = inet->daddr; sin->sin_addr.s_addr = inet->daddr;
...@@ -1971,7 +1971,7 @@ static void v4_addr2sockaddr(struct sock *sk, struct sockaddr * uaddr) ...@@ -1971,7 +1971,7 @@ static void v4_addr2sockaddr(struct sock *sk, struct sockaddr * uaddr)
int tcp_v4_remember_stamp(struct sock *sk) int tcp_v4_remember_stamp(struct sock *sk)
{ {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct tcp_opt *tp = tcp_sk(sk); struct tcp_opt *tp = tcp_sk(sk);
struct rtable *rt = (struct rtable *)__sk_dst_get(sk); struct rtable *rt = (struct rtable *)__sk_dst_get(sk);
struct inet_peer *peer = NULL; struct inet_peer *peer = NULL;
...@@ -2474,7 +2474,7 @@ static void get_tcp4_sock(struct sock *sp, char *tmpbuf, int i) ...@@ -2474,7 +2474,7 @@ static void get_tcp4_sock(struct sock *sp, char *tmpbuf, int i)
int timer_active; int timer_active;
unsigned long timer_expires; unsigned long timer_expires;
struct tcp_opt *tp = tcp_sk(sp); struct tcp_opt *tp = tcp_sk(sp);
struct inet_opt *inet = inet_sk(sp); struct inet_sock *inet = inet_sk(sp);
unsigned int dest = inet->daddr; unsigned int dest = inet->daddr;
unsigned int src = inet->rcv_saddr; unsigned int src = inet->rcv_saddr;
__u16 destp = ntohs(inet->dport); __u16 destp = ntohs(inet->dport);
......
...@@ -337,7 +337,7 @@ void tcp_time_wait(struct sock *sk, int state, int timeo) ...@@ -337,7 +337,7 @@ void tcp_time_wait(struct sock *sk, int state, int timeo)
tw = kmem_cache_alloc(tcp_timewait_cachep, SLAB_ATOMIC); tw = kmem_cache_alloc(tcp_timewait_cachep, SLAB_ATOMIC);
if(tw != NULL) { if(tw != NULL) {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
int rto = (tp->rto<<2) - (tp->rto>>1); int rto = (tp->rto<<2) - (tp->rto>>1);
/* Give us an identity. */ /* Give us an identity. */
......
...@@ -266,7 +266,7 @@ static __inline__ u16 tcp_select_window(struct sock *sk) ...@@ -266,7 +266,7 @@ static __inline__ u16 tcp_select_window(struct sock *sk)
static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb) static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb)
{ {
if (skb != NULL) { if (skb != NULL) {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct tcp_opt *tp = tcp_sk(sk); struct tcp_opt *tp = tcp_sk(sk);
struct tcp_skb_cb *tcb = TCP_SKB_CB(skb); struct tcp_skb_cb *tcb = TCP_SKB_CB(skb);
int tcp_header_size = tp->tcp_header_len; int tcp_header_size = tp->tcp_header_len;
......
...@@ -332,7 +332,7 @@ static void tcp_retransmit_timer(struct sock *sk) ...@@ -332,7 +332,7 @@ static void tcp_retransmit_timer(struct sock *sk)
*/ */
#ifdef TCP_DEBUG #ifdef TCP_DEBUG
if (net_ratelimit()) { if (net_ratelimit()) {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
printk(KERN_DEBUG "TCP: Treason uncloaked! Peer %u.%u.%u.%u:%u/%u shrinks window %u:%u. Repaired.\n", printk(KERN_DEBUG "TCP: Treason uncloaked! Peer %u.%u.%u.%u:%u/%u shrinks window %u:%u. Repaired.\n",
NIPQUAD(inet->daddr), htons(inet->dport), NIPQUAD(inet->daddr), htons(inet->dport),
inet->num, tp->snd_una, tp->snd_nxt); inet->num, tp->snd_una, tp->snd_nxt);
......
...@@ -124,7 +124,7 @@ static int udp_v4_get_port(struct sock *sk, unsigned short snum) ...@@ -124,7 +124,7 @@ static int udp_v4_get_port(struct sock *sk, unsigned short snum)
{ {
struct hlist_node *node; struct hlist_node *node;
struct sock *sk2; struct sock *sk2;
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
write_lock_bh(&udp_hash_lock); write_lock_bh(&udp_hash_lock);
if (snum == 0) { if (snum == 0) {
...@@ -171,7 +171,7 @@ static int udp_v4_get_port(struct sock *sk, unsigned short snum) ...@@ -171,7 +171,7 @@ static int udp_v4_get_port(struct sock *sk, unsigned short snum)
} else { } else {
sk_for_each(sk2, node, sk_for_each(sk2, node,
&udp_hash[snum & (UDP_HTABLE_SIZE - 1)]) { &udp_hash[snum & (UDP_HTABLE_SIZE - 1)]) {
struct inet_opt *inet2 = inet_sk(sk2); struct inet_sock *inet2 = inet_sk(sk2);
if (inet2->num == snum && if (inet2->num == snum &&
sk2 != sk && sk2 != sk &&
...@@ -227,7 +227,7 @@ struct sock *udp_v4_lookup_longway(u32 saddr, u16 sport, u32 daddr, u16 dport, i ...@@ -227,7 +227,7 @@ struct sock *udp_v4_lookup_longway(u32 saddr, u16 sport, u32 daddr, u16 dport, i
int badness = -1; int badness = -1;
sk_for_each(sk, node, &udp_hash[hnum & (UDP_HTABLE_SIZE - 1)]) { sk_for_each(sk, node, &udp_hash[hnum & (UDP_HTABLE_SIZE - 1)]) {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
if (inet->num == hnum && !ipv6_only_sock(sk)) { if (inet->num == hnum && !ipv6_only_sock(sk)) {
int score = (sk->sk_family == PF_INET ? 1 : 0); int score = (sk->sk_family == PF_INET ? 1 : 0);
...@@ -285,7 +285,7 @@ static inline struct sock *udp_v4_mcast_next(struct sock *sk, ...@@ -285,7 +285,7 @@ static inline struct sock *udp_v4_mcast_next(struct sock *sk,
unsigned short hnum = ntohs(loc_port); unsigned short hnum = ntohs(loc_port);
sk_for_each_from(s, node) { sk_for_each_from(s, node) {
struct inet_opt *inet = inet_sk(s); struct inet_sock *inet = inet_sk(s);
if (inet->num != hnum || if (inet->num != hnum ||
(inet->daddr && inet->daddr != rmt_addr) || (inet->daddr && inet->daddr != rmt_addr) ||
...@@ -316,7 +316,7 @@ static inline struct sock *udp_v4_mcast_next(struct sock *sk, ...@@ -316,7 +316,7 @@ static inline struct sock *udp_v4_mcast_next(struct sock *sk,
void udp_err(struct sk_buff *skb, u32 info) void udp_err(struct sk_buff *skb, u32 info)
{ {
struct inet_opt *inet; struct inet_sock *inet;
struct iphdr *iph = (struct iphdr*)skb->data; struct iphdr *iph = (struct iphdr*)skb->data;
struct udphdr *uh = (struct udphdr*)(skb->data+(iph->ihl<<2)); struct udphdr *uh = (struct udphdr*)(skb->data+(iph->ihl<<2));
int type = skb->h.icmph->type; int type = skb->h.icmph->type;
...@@ -398,7 +398,7 @@ static void udp_flush_pending_frames(struct sock *sk) ...@@ -398,7 +398,7 @@ static void udp_flush_pending_frames(struct sock *sk)
*/ */
static int udp_push_pending_frames(struct sock *sk, struct udp_opt *up) static int udp_push_pending_frames(struct sock *sk, struct udp_opt *up)
{ {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct flowi *fl = &inet->cork.fl; struct flowi *fl = &inet->cork.fl;
struct sk_buff *skb; struct sk_buff *skb;
struct udphdr *uh; struct udphdr *uh;
...@@ -480,7 +480,7 @@ static unsigned short udp_check(struct udphdr *uh, int len, unsigned long saddr, ...@@ -480,7 +480,7 @@ static unsigned short udp_check(struct udphdr *uh, int len, unsigned long saddr,
int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
size_t len) size_t len)
{ {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct udp_opt *up = udp_sk(sk); struct udp_opt *up = udp_sk(sk);
int ulen = len; int ulen = len;
struct ipcm_cookie ipc; struct ipcm_cookie ipc;
...@@ -773,7 +773,7 @@ static __inline__ int udp_checksum_complete(struct sk_buff *skb) ...@@ -773,7 +773,7 @@ static __inline__ int udp_checksum_complete(struct sk_buff *skb)
int udp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, int udp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
size_t len, int noblock, int flags, int *addr_len) size_t len, int noblock, int flags, int *addr_len)
{ {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct sockaddr_in *sin = (struct sockaddr_in *)msg->msg_name; struct sockaddr_in *sin = (struct sockaddr_in *)msg->msg_name;
struct sk_buff *skb; struct sk_buff *skb;
int copied, err; int copied, err;
...@@ -864,7 +864,7 @@ int udp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, ...@@ -864,7 +864,7 @@ int udp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
int udp_disconnect(struct sock *sk, int flags) int udp_disconnect(struct sock *sk, int flags)
{ {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
/* /*
* 1003.1g - break association. * 1003.1g - break association.
*/ */
...@@ -1503,7 +1503,7 @@ void udp_proc_unregister(struct udp_seq_afinfo *afinfo) ...@@ -1503,7 +1503,7 @@ void udp_proc_unregister(struct udp_seq_afinfo *afinfo)
/* ------------------------------------------------------------------------ */ /* ------------------------------------------------------------------------ */
static void udp4_format_sock(struct sock *sp, char *tmpbuf, int bucket) static void udp4_format_sock(struct sock *sp, char *tmpbuf, int bucket)
{ {
struct inet_opt *inet = inet_sk(sp); struct inet_sock *inet = inet_sk(sp);
unsigned int dest = inet->daddr; unsigned int dest = inet->daddr;
unsigned int src = inet->rcv_saddr; unsigned int src = inet->rcv_saddr;
__u16 destp = ntohs(inet->dport); __u16 destp = ntohs(inet->dport);
......
...@@ -114,10 +114,9 @@ static __inline__ struct ipv6_pinfo *inet6_sk_generic(struct sock *sk) ...@@ -114,10 +114,9 @@ static __inline__ struct ipv6_pinfo *inet6_sk_generic(struct sock *sk)
static int inet6_create(struct socket *sock, int protocol) static int inet6_create(struct socket *sock, int protocol)
{ {
struct inet_opt *inet; struct inet_sock *inet;
struct ipv6_pinfo *np; struct ipv6_pinfo *np;
struct sock *sk; struct sock *sk;
struct tcp6_sock* tcp6sk;
struct list_head *p; struct list_head *p;
struct inet_protosw *answer; struct inet_protosw *answer;
struct proto *answer_prot; struct proto *answer_prot;
...@@ -196,8 +195,7 @@ static int inet6_create(struct socket *sock, int protocol) ...@@ -196,8 +195,7 @@ static int inet6_create(struct socket *sock, int protocol)
sk->sk_backlog_rcv = answer->prot->backlog_rcv; sk->sk_backlog_rcv = answer->prot->backlog_rcv;
tcp6sk = (struct tcp6_sock *)sk; inet_sk(sk)->pinet6 = np = inet6_sk_generic(sk);
tcp6sk->pinet6 = np = inet6_sk_generic(sk);
np->hop_limit = -1; np->hop_limit = -1;
np->mcast_hops = -1; np->mcast_hops = -1;
np->mc_loop = 1; np->mc_loop = 1;
...@@ -252,7 +250,7 @@ int inet6_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) ...@@ -252,7 +250,7 @@ int inet6_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
{ {
struct sockaddr_in6 *addr=(struct sockaddr_in6 *)uaddr; struct sockaddr_in6 *addr=(struct sockaddr_in6 *)uaddr;
struct sock *sk = sock->sk; struct sock *sk = sock->sk;
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct ipv6_pinfo *np = inet6_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk);
__u32 v4addr = 0; __u32 v4addr = 0;
unsigned short snum; unsigned short snum;
...@@ -410,7 +408,7 @@ int inet6_getname(struct socket *sock, struct sockaddr *uaddr, ...@@ -410,7 +408,7 @@ int inet6_getname(struct socket *sock, struct sockaddr *uaddr,
{ {
struct sockaddr_in6 *sin=(struct sockaddr_in6 *)uaddr; struct sockaddr_in6 *sin=(struct sockaddr_in6 *)uaddr;
struct sock *sk = sock->sk; struct sock *sk = sock->sk;
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct ipv6_pinfo *np = inet6_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk);
sin->sin6_family = AF_INET6; sin->sin6_family = AF_INET6;
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
int ip6_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) int ip6_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
{ {
struct sockaddr_in6 *usin = (struct sockaddr_in6 *) uaddr; struct sockaddr_in6 *usin = (struct sockaddr_in6 *) uaddr;
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct ipv6_pinfo *np = inet6_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk);
struct in6_addr *daddr, *final_p = NULL, final; struct in6_addr *daddr, *final_p = NULL, final;
struct dst_entry *dst; struct dst_entry *dst;
...@@ -335,7 +335,7 @@ int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len) ...@@ -335,7 +335,7 @@ int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len)
if (ipv6_addr_type(&sin->sin6_addr) & IPV6_ADDR_LINKLOCAL) if (ipv6_addr_type(&sin->sin6_addr) & IPV6_ADDR_LINKLOCAL)
sin->sin6_scope_id = IP6CB(skb)->iif; sin->sin6_scope_id = IP6CB(skb)->iif;
} else { } else {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
ipv6_addr_set(&sin->sin6_addr, 0, 0, ipv6_addr_set(&sin->sin6_addr, 0, 0,
htonl(0xffff), htonl(0xffff),
......
...@@ -809,7 +809,7 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to, int offse ...@@ -809,7 +809,7 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to, int offse
int hlimit, struct ipv6_txoptions *opt, struct flowi *fl, struct rt6_info *rt, int hlimit, struct ipv6_txoptions *opt, struct flowi *fl, struct rt6_info *rt,
unsigned int flags) unsigned int flags)
{ {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct ipv6_pinfo *np = inet6_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk);
struct sk_buff *skb; struct sk_buff *skb;
unsigned int maxfraglen, fragheaderlen; unsigned int maxfraglen, fragheaderlen;
...@@ -1087,7 +1087,7 @@ int ip6_push_pending_frames(struct sock *sk) ...@@ -1087,7 +1087,7 @@ int ip6_push_pending_frames(struct sock *sk)
struct sk_buff *skb, *tmp_skb; struct sk_buff *skb, *tmp_skb;
struct sk_buff **tail_skb; struct sk_buff **tail_skb;
struct in6_addr final_dst_buf, *final_dst = &final_dst_buf; struct in6_addr final_dst_buf, *final_dst = &final_dst_buf;
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct ipv6_pinfo *np = inet6_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk);
struct ipv6hdr *hdr; struct ipv6hdr *hdr;
struct ipv6_txoptions *opt = np->cork.opt; struct ipv6_txoptions *opt = np->cork.opt;
...@@ -1165,7 +1165,7 @@ int ip6_push_pending_frames(struct sock *sk) ...@@ -1165,7 +1165,7 @@ int ip6_push_pending_frames(struct sock *sk)
void ip6_flush_pending_frames(struct sock *sk) void ip6_flush_pending_frames(struct sock *sk)
{ {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct ipv6_pinfo *np = inet6_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk);
struct sk_buff *skb; struct sk_buff *skb;
......
...@@ -178,7 +178,7 @@ void ipv6_raw_deliver(struct sk_buff *skb, int nexthdr) ...@@ -178,7 +178,7 @@ void ipv6_raw_deliver(struct sk_buff *skb, int nexthdr)
/* This cleans up af_inet6 a bit. -DaveM */ /* This cleans up af_inet6 a bit. -DaveM */
static int rawv6_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len) static int rawv6_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len)
{ {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct ipv6_pinfo *np = inet6_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk);
struct sockaddr_in6 *addr = (struct sockaddr_in6 *) uaddr; struct sockaddr_in6 *addr = (struct sockaddr_in6 *) uaddr;
__u32 v4addr = 0; __u32 v4addr = 0;
...@@ -253,7 +253,7 @@ void rawv6_err(struct sock *sk, struct sk_buff *skb, ...@@ -253,7 +253,7 @@ void rawv6_err(struct sock *sk, struct sk_buff *skb,
struct inet6_skb_parm *opt, struct inet6_skb_parm *opt,
int type, int code, int offset, u32 info) int type, int code, int offset, u32 info)
{ {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct ipv6_pinfo *np = inet6_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk);
int err; int err;
int harderr; int harderr;
...@@ -314,7 +314,7 @@ static inline int rawv6_rcv_skb(struct sock * sk, struct sk_buff * skb) ...@@ -314,7 +314,7 @@ static inline int rawv6_rcv_skb(struct sock * sk, struct sk_buff * skb)
*/ */
int rawv6_rcv(struct sock *sk, struct sk_buff *skb) int rawv6_rcv(struct sock *sk, struct sk_buff *skb)
{ {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct raw6_opt *raw_opt = raw6_sk(sk); struct raw6_opt *raw_opt = raw6_sk(sk);
if (!xfrm6_policy_check(sk, XFRM_POLICY_IN, skb)) { if (!xfrm6_policy_check(sk, XFRM_POLICY_IN, skb)) {
...@@ -505,7 +505,7 @@ static int rawv6_send_hdrinc(struct sock *sk, void *from, int length, ...@@ -505,7 +505,7 @@ static int rawv6_send_hdrinc(struct sock *sk, void *from, int length,
struct flowi *fl, struct rt6_info *rt, struct flowi *fl, struct rt6_info *rt,
unsigned int flags) unsigned int flags)
{ {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct ipv6hdr *iph; struct ipv6hdr *iph;
struct sk_buff *skb; struct sk_buff *skb;
unsigned int hh_len; unsigned int hh_len;
...@@ -607,7 +607,7 @@ static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk, ...@@ -607,7 +607,7 @@ static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk,
struct ipv6_txoptions opt_space; struct ipv6_txoptions opt_space;
struct sockaddr_in6 * sin6 = (struct sockaddr_in6 *) msg->msg_name; struct sockaddr_in6 * sin6 = (struct sockaddr_in6 *) msg->msg_name;
struct in6_addr *daddr, *final_p = NULL, final; struct in6_addr *daddr, *final_p = NULL, final;
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct ipv6_pinfo *np = inet6_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk);
struct raw6_opt *raw_opt = raw6_sk(sk); struct raw6_opt *raw_opt = raw6_sk(sk);
struct ipv6_txoptions *opt = NULL; struct ipv6_txoptions *opt = NULL;
......
...@@ -89,7 +89,7 @@ static __inline__ int tcp_v6_hashfn(struct in6_addr *laddr, u16 lport, ...@@ -89,7 +89,7 @@ static __inline__ int tcp_v6_hashfn(struct in6_addr *laddr, u16 lport,
static __inline__ int tcp_v6_sk_hashfn(struct sock *sk) static __inline__ int tcp_v6_sk_hashfn(struct sock *sk)
{ {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct ipv6_pinfo *np = inet6_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk);
struct in6_addr *laddr = &np->rcv_saddr; struct in6_addr *laddr = &np->rcv_saddr;
struct in6_addr *faddr = &np->daddr; struct in6_addr *faddr = &np->daddr;
...@@ -443,7 +443,7 @@ static __u32 tcp_v6_init_sequence(struct sock *sk, struct sk_buff *skb) ...@@ -443,7 +443,7 @@ static __u32 tcp_v6_init_sequence(struct sock *sk, struct sk_buff *skb)
static int tcp_v6_check_established(struct sock *sk) static int tcp_v6_check_established(struct sock *sk)
{ {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct ipv6_pinfo *np = inet6_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk);
struct in6_addr *daddr = &np->rcv_saddr; struct in6_addr *daddr = &np->rcv_saddr;
struct in6_addr *saddr = &np->daddr; struct in6_addr *saddr = &np->daddr;
...@@ -549,7 +549,7 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr, ...@@ -549,7 +549,7 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
int addr_len) int addr_len)
{ {
struct sockaddr_in6 *usin = (struct sockaddr_in6 *) uaddr; struct sockaddr_in6 *usin = (struct sockaddr_in6 *) uaddr;
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct ipv6_pinfo *np = inet6_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk);
struct tcp_opt *tp = tcp_sk(sk); struct tcp_opt *tp = tcp_sk(sk);
struct in6_addr *saddr = NULL, *final_p = NULL, final; struct in6_addr *saddr = NULL, *final_p = NULL, final;
...@@ -785,7 +785,7 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, ...@@ -785,7 +785,7 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
dst = __sk_dst_check(sk, np->dst_cookie); dst = __sk_dst_check(sk, np->dst_cookie);
if (dst == NULL) { if (dst == NULL) {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct flowi fl; struct flowi fl;
/* BUGGG_FUTURE: Again, it is not clear how /* BUGGG_FUTURE: Again, it is not clear how
...@@ -1281,7 +1281,7 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb, ...@@ -1281,7 +1281,7 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
{ {
struct ipv6_pinfo *newnp, *np = inet6_sk(sk); struct ipv6_pinfo *newnp, *np = inet6_sk(sk);
struct tcp6_sock *newtcp6sk; struct tcp6_sock *newtcp6sk;
struct inet_opt *newinet; struct inet_sock *newinet;
struct tcp_opt *newtp; struct tcp_opt *newtp;
struct sock *newsk; struct sock *newsk;
struct ipv6_txoptions *opt; struct ipv6_txoptions *opt;
...@@ -1297,7 +1297,7 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb, ...@@ -1297,7 +1297,7 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
return NULL; return NULL;
newtcp6sk = (struct tcp6_sock *)newsk; newtcp6sk = (struct tcp6_sock *)newsk;
newtcp6sk->pinet6 = &newtcp6sk->inet6; newtcp6sk->inet.pinet6 = &newtcp6sk->inet6;
newinet = inet_sk(newsk); newinet = inet_sk(newsk);
newnp = inet6_sk(newsk); newnp = inet6_sk(newsk);
...@@ -1390,7 +1390,7 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb, ...@@ -1390,7 +1390,7 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
~(NETIF_F_IP_CSUM | NETIF_F_TSO); ~(NETIF_F_IP_CSUM | NETIF_F_TSO);
newtcp6sk = (struct tcp6_sock *)newsk; newtcp6sk = (struct tcp6_sock *)newsk;
newtcp6sk->pinet6 = &newtcp6sk->inet6; newtcp6sk->inet.pinet6 = &newtcp6sk->inet6;
newtp = tcp_sk(newsk); newtp = tcp_sk(newsk);
newinet = inet_sk(newsk); newinet = inet_sk(newsk);
...@@ -1754,7 +1754,7 @@ static int tcp_v6_rebuild_header(struct sock *sk) ...@@ -1754,7 +1754,7 @@ static int tcp_v6_rebuild_header(struct sock *sk)
dst = __sk_dst_check(sk, np->dst_cookie); dst = __sk_dst_check(sk, np->dst_cookie);
if (dst == NULL) { if (dst == NULL) {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct in6_addr *final_p = NULL, final; struct in6_addr *final_p = NULL, final;
struct flowi fl; struct flowi fl;
...@@ -1800,7 +1800,7 @@ static int tcp_v6_rebuild_header(struct sock *sk) ...@@ -1800,7 +1800,7 @@ static int tcp_v6_rebuild_header(struct sock *sk)
static int tcp_v6_xmit(struct sk_buff *skb, int ipfragok) static int tcp_v6_xmit(struct sk_buff *skb, int ipfragok)
{ {
struct sock *sk = skb->sk; struct sock *sk = skb->sk;
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct ipv6_pinfo *np = inet6_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk);
struct flowi fl; struct flowi fl;
struct dst_entry *dst; struct dst_entry *dst;
...@@ -2006,7 +2006,7 @@ static void get_tcp6_sock(struct seq_file *seq, struct sock *sp, int i) ...@@ -2006,7 +2006,7 @@ static void get_tcp6_sock(struct seq_file *seq, struct sock *sp, int i)
__u16 destp, srcp; __u16 destp, srcp;
int timer_active; int timer_active;
unsigned long timer_expires; unsigned long timer_expires;
struct inet_opt *inet = inet_sk(sp); struct inet_sock *inet = inet_sk(sp);
struct tcp_opt *tp = tcp_sk(sp); struct tcp_opt *tp = tcp_sk(sp);
struct ipv6_pinfo *np = inet6_sk(sp); struct ipv6_pinfo *np = inet6_sk(sp);
......
...@@ -160,7 +160,7 @@ static struct sock *udp_v6_lookup(struct in6_addr *saddr, u16 sport, ...@@ -160,7 +160,7 @@ static struct sock *udp_v6_lookup(struct in6_addr *saddr, u16 sport,
read_lock(&udp_hash_lock); read_lock(&udp_hash_lock);
sk_for_each(sk, node, &udp_hash[hnum & (UDP_HTABLE_SIZE - 1)]) { sk_for_each(sk, node, &udp_hash[hnum & (UDP_HTABLE_SIZE - 1)]) {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
if (inet->num == hnum && sk->sk_family == PF_INET6) { if (inet->num == hnum && sk->sk_family == PF_INET6) {
struct ipv6_pinfo *np = inet6_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk);
...@@ -269,7 +269,7 @@ static int udpv6_recvmsg(struct kiocb *iocb, struct sock *sk, ...@@ -269,7 +269,7 @@ static int udpv6_recvmsg(struct kiocb *iocb, struct sock *sk,
sin6->sin6_scope_id = 0; sin6->sin6_scope_id = 0;
if (skb->protocol == htons(ETH_P_IP)) { if (skb->protocol == htons(ETH_P_IP)) {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
ipv6_addr_set(&sin6->sin6_addr, 0, 0, ipv6_addr_set(&sin6->sin6_addr, 0, 0,
htonl(0xffff), skb->nh.iph->saddr); htonl(0xffff), skb->nh.iph->saddr);
...@@ -386,7 +386,7 @@ static struct sock *udp_v6_mcast_next(struct sock *sk, ...@@ -386,7 +386,7 @@ static struct sock *udp_v6_mcast_next(struct sock *sk,
unsigned short num = ntohs(loc_port); unsigned short num = ntohs(loc_port);
sk_for_each_from(s, node) { sk_for_each_from(s, node) {
struct inet_opt *inet = inet_sk(s); struct inet_sock *inet = inet_sk(s);
if (inet->num == num && s->sk_family == PF_INET6) { if (inet->num == num && s->sk_family == PF_INET6) {
struct ipv6_pinfo *np = inet6_sk(s); struct ipv6_pinfo *np = inet6_sk(s);
...@@ -566,7 +566,7 @@ static int udp_v6_push_pending_frames(struct sock *sk, struct udp_opt *up) ...@@ -566,7 +566,7 @@ static int udp_v6_push_pending_frames(struct sock *sk, struct udp_opt *up)
{ {
struct sk_buff *skb; struct sk_buff *skb;
struct udphdr *uh; struct udphdr *uh;
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct flowi *fl = &inet->cork.fl; struct flowi *fl = &inet->cork.fl;
int err = 0; int err = 0;
...@@ -624,7 +624,7 @@ static int udpv6_sendmsg(struct kiocb *iocb, struct sock *sk, ...@@ -624,7 +624,7 @@ static int udpv6_sendmsg(struct kiocb *iocb, struct sock *sk,
{ {
struct ipv6_txoptions opt_space; struct ipv6_txoptions opt_space;
struct udp_opt *up = udp_sk(sk); struct udp_opt *up = udp_sk(sk);
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct ipv6_pinfo *np = inet6_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk);
struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) msg->msg_name; struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) msg->msg_name;
struct in6_addr *daddr, *final_p = NULL, final; struct in6_addr *daddr, *final_p = NULL, final;
...@@ -970,7 +970,7 @@ static struct inet6_protocol udpv6_protocol = { ...@@ -970,7 +970,7 @@ static struct inet6_protocol udpv6_protocol = {
static void udp6_sock_seq_show(struct seq_file *seq, struct sock *sp, int bucket) static void udp6_sock_seq_show(struct seq_file *seq, struct sock *sp, int bucket)
{ {
struct inet_opt *inet = inet_sk(sp); struct inet_sock *inet = inet_sk(sp);
struct ipv6_pinfo *np = inet6_sk(sp); struct ipv6_pinfo *np = inet6_sk(sp);
struct in6_addr *dest, *src; struct in6_addr *dest, *src;
__u16 destp, srcp; __u16 destp, srcp;
......
...@@ -393,7 +393,7 @@ void sctp_v4_err(struct sk_buff *skb, __u32 info) ...@@ -393,7 +393,7 @@ void sctp_v4_err(struct sk_buff *skb, __u32 info)
struct sctp_endpoint *ep; struct sctp_endpoint *ep;
struct sctp_association *asoc; struct sctp_association *asoc;
struct sctp_transport *transport; struct sctp_transport *transport;
struct inet_opt *inet; struct inet_sock *inet;
char *saveip, *savesctp; char *saveip, *savesctp;
int err; int err;
......
...@@ -580,9 +580,9 @@ static sctp_scope_t sctp_v6_scope(union sctp_addr *addr) ...@@ -580,9 +580,9 @@ static sctp_scope_t sctp_v6_scope(union sctp_addr *addr)
struct sock *sctp_v6_create_accept_sk(struct sock *sk, struct sock *sctp_v6_create_accept_sk(struct sock *sk,
struct sctp_association *asoc) struct sctp_association *asoc)
{ {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct sock *newsk; struct sock *newsk;
struct inet_opt *newinet; struct inet_sock *newinet;
struct ipv6_pinfo *newnp, *np = inet6_sk(sk); struct ipv6_pinfo *newnp, *np = inet6_sk(sk);
struct sctp6_sock *newsctp6sk; struct sctp6_sock *newsctp6sk;
...@@ -608,7 +608,7 @@ struct sock *sctp_v6_create_accept_sk(struct sock *sk, ...@@ -608,7 +608,7 @@ 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->pinet6 = &newsctp6sk->inet6; newsctp6sk->inet.pinet6 = &newsctp6sk->inet6;
newinet = inet_sk(newsk); newinet = inet_sk(newsk);
newnp = inet6_sk(newsk); newnp = inet6_sk(newsk);
......
...@@ -551,8 +551,8 @@ struct sock *sctp_v4_create_accept_sk(struct sock *sk, ...@@ -551,8 +551,8 @@ struct sock *sctp_v4_create_accept_sk(struct sock *sk,
struct sctp_association *asoc) struct sctp_association *asoc)
{ {
struct sock *newsk; struct sock *newsk;
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct inet_opt *newinet; struct inet_sock *newinet;
newsk = sk_alloc(PF_INET, GFP_KERNEL, sk->sk_prot->slab_obj_size, newsk = sk_alloc(PF_INET, GFP_KERNEL, sk->sk_prot->slab_obj_size,
sk->sk_prot->slab); sk->sk_prot->slab);
......
...@@ -566,7 +566,7 @@ void avc_audit(u32 ssid, u32 tsid, ...@@ -566,7 +566,7 @@ void avc_audit(u32 ssid, u32 tsid,
switch (sk->sk_family) { switch (sk->sk_family) {
case AF_INET: { case AF_INET: {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
avc_print_ipv4_addr(ab, inet->rcv_saddr, avc_print_ipv4_addr(ab, inet->rcv_saddr,
inet->sport, inet->sport,
...@@ -577,7 +577,7 @@ void avc_audit(u32 ssid, u32 tsid, ...@@ -577,7 +577,7 @@ void avc_audit(u32 ssid, u32 tsid,
break; break;
} }
case AF_INET6: { case AF_INET6: {
struct inet_opt *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct ipv6_pinfo *inet6 = inet6_sk(sk); struct ipv6_pinfo *inet6 = inet6_sk(sk);
avc_print_ipv6_addr(ab, &inet6->rcv_saddr, avc_print_ipv6_addr(ab, &inet6->rcv_saddr,
......
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