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 {
#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. */
__u32 daddr; /* Foreign IPv4 addr */
__u32 rcv_saddr; /* Bound local IPv4 addr */
......@@ -146,20 +153,9 @@ struct inet_opt {
#define IPCORK_OPT 1 /* ip-options has been held in ipcork.opt */
struct ipv6_pinfo;
/* 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)
static inline struct inet_sock *inet_sk(const struct sock *sk)
{
return &((struct inet_sock *)__sk)->inet;
return (struct inet_sock *)sk;
}
#endif
......
......@@ -256,32 +256,26 @@ struct raw6_opt {
/* WARNING: don't change the layout of the members in {raw,udp,tcp}6_sock! */
struct raw6_sock {
struct sock sk;
struct ipv6_pinfo *pinet6;
struct inet_opt inet;
struct inet_sock inet;
struct raw6_opt raw6;
struct ipv6_pinfo inet6;
};
struct udp6_sock {
struct sock sk;
struct ipv6_pinfo *pinet6;
struct inet_opt inet;
struct inet_sock inet;
struct udp_opt udp;
struct ipv6_pinfo inet6;
};
struct tcp6_sock {
struct sock sk;
struct ipv6_pinfo *pinet6;
struct inet_opt inet;
struct inet_sock inet;
struct tcp_opt tcp;
struct ipv6_pinfo inet6;
};
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)
......
......@@ -440,11 +440,7 @@ struct tcp_opt {
/* WARNING: don't change the layout of the members in tcp_sock! */
struct tcp_sock {
struct sock sk;
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
struct ipv6_pinfo *pinet6;
#endif
struct inet_opt inet;
struct inet_sock inet;
struct tcp_opt tcp;
};
......
......@@ -53,11 +53,7 @@ struct udp_opt {
/* WARNING: don't change the layout of the members in udp_sock! */
struct udp_sock {
struct sock sk;
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
struct ipv6_pinfo *pinet6;
#endif
struct inet_opt inet;
struct inet_sock inet;
struct udp_opt udp;
};
......
......@@ -50,15 +50,9 @@ struct raw_opt {
struct icmp_filter filter;
};
struct ipv6_pinfo;
/* WARNING: don't change the layout of the members in raw_sock! */
struct raw_sock {
struct sock sk;
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
struct ipv6_pinfo *pinet6;
#endif
struct inet_opt inet;
struct inet_sock inet;
struct raw_opt raw4;
};
......
......@@ -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! */
struct sctp_sock {
struct sock sk;
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
struct ipv6_pinfo *pinet6;
#endif /* CONFIG_IPV6 */
struct inet_opt inet;
struct inet_sock inet;
struct sctp_opt sctp;
};
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
struct sctp6_sock {
struct sock sk;
struct ipv6_pinfo *pinet6;
struct inet_opt inet;
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)->sk
#define sctp_opt2sk(__sp) &container_of(__sp, struct sctp_sock, sctp)->inet.sk
/* Is a socket of this style? */
#define sctp_style(sk, style) __sctp_style((sk), (SCTP_SOCKET_##style))
......
......@@ -196,7 +196,7 @@ struct tcp_tw_bucket {
unsigned char tw_rcv_wscale;
__u16 tw_sport;
/* Socket demultiplex comparisons on incoming packets. */
/* these five are in inet_opt */
/* these five are in inet_sock */
__u32 tw_daddr
__attribute__((aligned(TCP_ADDRCMP_ALIGN_BYTES)));
__u32 tw_rcv_saddr;
......
......@@ -131,7 +131,7 @@ static spinlock_t inetsw_lock = SPIN_LOCK_UNLOCKED;
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_error_queue);
......@@ -173,7 +173,7 @@ void inet_sock_destruct(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. */
lock_sock(sk);
inet = inet_sk(sk);
......@@ -232,7 +232,7 @@ static int inet_create(struct socket *sock, int protocol)
struct sock *sk;
struct list_head *p;
struct inet_protosw *answer;
struct inet_opt *inet;
struct inet_sock *inet;
struct proto *answer_prot;
unsigned char answer_flags;
char answer_no_check;
......@@ -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 sock *sk = sock->sk;
struct inet_opt *inet = inet_sk(sk);
struct inet_sock *inet = inet_sk(sk);
unsigned short snum;
int chk_addr_ret;
int err;
......@@ -623,7 +623,7 @@ int inet_getname(struct socket *sock, struct sockaddr *uaddr,
int *uaddr_len, int peer)
{
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;
sin->sin_family = AF_INET;
......
......@@ -22,7 +22,7 @@
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 rtable *rt;
u32 saddr;
......
......@@ -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)
{
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 rtable *rt = (struct rtable *)skb->dst;
u32 daddr;
......@@ -1097,7 +1097,7 @@ static struct icmp_control icmp_pointers[NR_ICMP_TYPES + 1] = {
void __init icmp_init(struct net_proto_family *ops)
{
struct inet_opt *inet;
struct inet_sock *inet;
int i;
for (i = 0; i < NR_CPUS; i++) {
......
......@@ -1617,7 +1617,7 @@ int ip_mc_join_group(struct sock *sk , struct ip_mreqn *imr)
u32 addr = imr->imr_multiaddr.s_addr;
struct ip_mc_socklist *iml, *i;
struct in_device *in_dev;
struct inet_opt *inet = inet_sk(sk);
struct inet_sock *inet = inet_sk(sk);
int count = 0;
if (!MULTICAST(addr))
......@@ -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)
{
struct inet_opt *inet = inet_sk(sk);
struct inet_sock *inet = inet_sk(sk);
struct ip_mc_socklist *iml, **imlp;
rtnl_lock();
......@@ -1734,7 +1734,7 @@ int ip_mc_source(int add, int omode, struct sock *sk, struct
u32 addr = mreqs->imr_multiaddr;
struct ip_mc_socklist *pmc;
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;
int i, j, rv;
......@@ -1852,7 +1852,7 @@ int ip_mc_msfilter(struct sock *sk, struct ip_msfilter *msf, int ifindex)
u32 addr = msf->imsf_multiaddr;
struct ip_mc_socklist *pmc;
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;
if (!MULTICAST(addr))
......@@ -1922,7 +1922,7 @@ int ip_mc_msfget(struct sock *sk, struct ip_msfilter *msf,
u32 addr = msf->imsf_multiaddr;
struct ip_mc_socklist *pmc;
struct in_device *in_dev;
struct inet_opt *inet = inet_sk(sk);
struct inet_sock *inet = inet_sk(sk);
struct ip_sf_socklist *psl;
if (!MULTICAST(addr))
......@@ -1980,7 +1980,7 @@ int ip_mc_gsfget(struct sock *sk, struct group_filter *gsf,
struct sockaddr_in *psin;
u32 addr;
struct ip_mc_socklist *pmc;
struct inet_opt *inet = inet_sk(sk);
struct inet_sock *inet = inet_sk(sk);
struct ip_sf_socklist *psl;
psin = (struct sockaddr_in *)&gsf->gf_group;
......@@ -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)
{
struct inet_opt *inet = inet_sk(sk);
struct inet_sock *inet = inet_sk(sk);
struct ip_mc_socklist *pmc;
struct ip_sf_socklist *psl;
int i;
......@@ -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)
{
struct inet_opt *inet = inet_sk(sk);
struct inet_sock *inet = inet_sk(sk);
struct ip_mc_socklist *iml;
if (inet->mc_list == NULL)
......
......@@ -115,7 +115,7 @@ static int ip_dev_loopback_xmit(struct sk_buff *newskb)
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;
......@@ -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,
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 iphdr *iph;
......@@ -297,7 +297,7 @@ int ip_output(struct sk_buff *skb)
int ip_queue_xmit(struct sk_buff *skb, int ipfragok)
{
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 rtable *rt;
struct iphdr *iph;
......@@ -712,7 +712,7 @@ int ip_append_data(struct sock *sk,
struct ipcm_cookie *ipc, struct rtable *rt,
unsigned int flags)
{
struct inet_opt *inet = inet_sk(sk);
struct inet_sock *inet = inet_sk(sk);
struct sk_buff *skb;
struct ip_options *opt = NULL;
......@@ -973,7 +973,7 @@ int ip_append_data(struct sock *sk,
ssize_t ip_append_page(struct sock *sk, struct page *page,
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 rtable *rt;
struct ip_options *opt = NULL;
......@@ -1112,7 +1112,7 @@ int ip_push_pending_frames(struct sock *sk)
{
struct sk_buff *skb, *tmp_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 rtable *rt = inet->cork.rt;
struct iphdr *iph;
......@@ -1217,7 +1217,7 @@ int ip_push_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;
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,
void ip_send_reply(struct sock *sk, struct sk_buff *skb, struct ip_reply_arg *arg,
unsigned int len)
{
struct inet_opt *inet = inet_sk(sk);
struct inet_sock *inet = inet_sk(sk);
struct {
struct ip_options opt;
char data[40];
......
......@@ -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)
{
struct inet_opt *inet = inet_sk(skb->sk);
struct inet_sock *inet = inet_sk(skb->sk);
unsigned flags = inet->cmsg_flags;
/* Ordered by supposed usage frequency */
......@@ -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,
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;
if (!inet->recverr)
......@@ -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)
{
struct inet_opt *inet = inet_sk(sk);
struct inet_sock *inet = inet_sk(sk);
struct sock_exterr_skb *serr;
struct iphdr *iph;
struct sk_buff *skb;
......@@ -342,7 +342,7 @@ int ip_recv_error(struct sock *sk, struct msghdr *msg, int len)
sin = &errhdr.offender;
sin->sin_family = AF_UNSPEC;
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_addr.s_addr = skb->nh.iph->saddr;
......@@ -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)
{
struct inet_opt *inet = inet_sk(sk);
struct inet_sock *inet = inet_sk(sk);
int val=0,err;
if (level != SOL_IP)
......@@ -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)
{
struct inet_opt *inet = inet_sk(sk);
struct inet_sock *inet = inet_sk(sk);
int val;
int len;
......
......@@ -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)
{
struct inet_opt *inet = inet_sk(sk);
struct inet_sock *inet = inet_sk(sk);
/* setsockopt(sock, SOL_IP, IP_MULTICAST_LOOP, &loop, sizeof(loop)); */
lock_sock(sk);
......@@ -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)
{
struct inet_opt *inet = inet_sk(sk);
struct inet_sock *inet = inet_sk(sk);
/* setsockopt(sock, SOL_IP, IP_MULTICAST_TTL, &ttl, sizeof(ttl)); */
lock_sock(sk);
......@@ -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)
{
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)
return -ENODEV;
......
......@@ -1229,7 +1229,7 @@ ip_ct_selective_cleanup(int (*kill)(const struct ip_conntrack *i, void *data),
static int
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 tuple;
......
......@@ -109,7 +109,7 @@ struct sock *__raw_v4_lookup(struct sock *sk, unsigned short num,
struct hlist_node *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 &&
!(inet->daddr && inet->daddr != raddr) &&
......@@ -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)
{
struct inet_opt *inet = inet_sk(sk);
struct inet_sock *inet = inet_sk(sk);
int type = skb->h.icmph->type;
int code = skb->h.icmph->code;
int err = 0;
......@@ -263,7 +263,7 @@ static int raw_send_hdrinc(struct sock *sk, void *from, int length,
struct rtable *rt,
unsigned int flags)
{
struct inet_opt *inet = inet_sk(sk);
struct inet_sock *inet = inet_sk(sk);
int hh_len;
struct iphdr *iph;
struct sk_buff *skb;
......@@ -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,
size_t len)
{
struct inet_opt *inet = inet_sk(sk);
struct inet_sock *inet = inet_sk(sk);
struct ipcm_cookie ipc;
struct rtable *rt = NULL;
int free = 0;
......@@ -537,7 +537,7 @@ static void raw_close(struct sock *sk, long timeout)
/* This gets rid of all the nasties in af_inet. -DaveM */
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;
int ret = -EINVAL;
int chk_addr_ret;
......@@ -565,7 +565,7 @@ out: return ret;
int raw_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
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;
int err = -EOPNOTSUPP;
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)
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,
src = inet->rcv_saddr;
__u16 destp = 0,
......
......@@ -460,7 +460,7 @@ int tcp_ioctl(struct sock *sk, int cmd, unsigned long arg)
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_listen_opt *lopt;
......@@ -1772,7 +1772,7 @@ static inline int tcp_need_reset(int state)
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);
int err = 0;
int old_state = sk->sk_state;
......
......@@ -55,7 +55,7 @@ static struct sock *tcpnl;
static int tcpdiag_fill(struct sk_buff *skb, struct sock *sk,
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 tcpdiagmsg *r;
struct nlmsghdr *nlh;
......@@ -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))) {
struct tcpdiag_entry entry;
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;
#ifdef CONFIG_IP_TCPDIAG_IPV6
......@@ -458,7 +458,7 @@ static int tcpdiag_fill_req(struct sk_buff *skb, struct sock *sk,
struct open_request *req,
u32 pid, u32 seq)
{
struct inet_opt *inet = inet_sk(sk);
struct inet_sock *inet = inet_sk(sk);
unsigned char *b = skb->tail;
struct tcpdiagmsg *r;
struct nlmsghdr *nlh;
......@@ -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_listen_opt *lopt;
struct rtattr *bc = NULL;
struct inet_opt *inet = inet_sk(sk);
struct inet_sock *inet = inet_sk(sk);
int j, s_j;
int reqnum, s_reqnum;
int err = 0;
......@@ -609,7 +609,7 @@ static int tcpdiag_dump(struct sk_buff *skb, struct netlink_callback *cb)
num = 0;
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) {
num++;
......@@ -670,7 +670,7 @@ static int tcpdiag_dump(struct sk_buff *skb, struct netlink_callback *cb)
num = 0;
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)
goto next_normal;
......@@ -692,7 +692,7 @@ static int tcpdiag_dump(struct sk_buff *skb, struct netlink_callback *cb)
if (r->tcpdiag_states&TCPF_TIME_WAIT) {
sk_for_each(sk, node,
&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)
goto next_dying;
......
......@@ -1647,7 +1647,7 @@ static __inline__ int tcp_packet_delayed(struct tcp_opt *tp)
#if FASTRETRANS_DEBUG > 1
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",
msg,
NIPQUAD(inet->daddr), ntohs(inet->dport),
......
......@@ -115,7 +115,7 @@ static __inline__ int tcp_hashfn(__u32 laddr, __u16 lport,
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;
__u16 lport = inet->num;
__u32 faddr = inet->daddr;
......@@ -300,7 +300,7 @@ static int tcp_v4_get_port(struct sock *sk, unsigned short snum)
*/
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_bucket *tb;
......@@ -420,7 +420,7 @@ static struct sock *__tcp_v4_lookup_listener(struct hlist_head *head, u32 daddr,
hiscore=-1;
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)) {
__u32 rcv_saddr = inet->rcv_saddr;
......@@ -457,7 +457,7 @@ static inline struct sock *tcp_v4_lookup_listener(u32 daddr,
read_lock(&tcp_lhash_lock);
head = &tcp_listening_hash[tcp_lhashfn(hnum)];
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 &&
(!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)
static int __tcp_v4_check_established(struct sock *sk, __u16 lport,
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 saddr = inet->daddr;
int dif = sk->sk_bound_dev_if;
......@@ -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)
{
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,
inet->dport);
......@@ -743,7 +743,7 @@ static inline int tcp_v4_hash_connect(struct sock *sk)
/* This will initiate an outgoing connection. */
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 sockaddr_in *usin = (struct sockaddr_in *)uaddr;
struct rtable *rt;
......@@ -917,7 +917,7 @@ static inline void do_pmtu_discovery(struct sock *sk, struct iphdr *iph,
u32 mtu)
{
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);
/* 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)
struct iphdr *iph = (struct iphdr *)skb->data;
struct tcphdr *th = (struct tcphdr *)(skb->data + (iph->ihl << 2));
struct tcp_opt *tp;
struct inet_opt *inet;
struct inet_sock *inet;
int type = skb->h.icmph->type;
int code = skb->h.icmph->code;
struct sock *sk;
......@@ -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,
struct sk_buff *skb)
{
struct inet_opt *inet = inet_sk(sk);
struct inet_sock *inet = inet_sk(sk);
if (skb->ip_summed == CHECKSUM_HW) {
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,
struct open_request *req,
struct dst_entry *dst)
{
struct inet_opt *newinet;
struct inet_sock *newinet;
struct tcp_opt *newtp;
struct sock *newsk;
......@@ -1856,7 +1856,7 @@ static void __tcp_v4_rehash(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;
struct rtable *rt;
__u32 old_saddr = inet->saddr;
......@@ -1907,7 +1907,7 @@ static int tcp_v4_reselect_saddr(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);
u32 daddr;
int err;
......@@ -1956,7 +1956,7 @@ int tcp_v4_rebuild_header(struct sock *sk)
static void v4_addr2sockaddr(struct sock *sk, struct sockaddr * 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_addr.s_addr = inet->daddr;
......@@ -1971,7 +1971,7 @@ static void v4_addr2sockaddr(struct sock *sk, struct sockaddr * uaddr)
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 rtable *rt = (struct rtable *)__sk_dst_get(sk);
struct inet_peer *peer = NULL;
......@@ -2474,7 +2474,7 @@ static void get_tcp4_sock(struct sock *sp, char *tmpbuf, int i)
int timer_active;
unsigned long timer_expires;
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 src = inet->rcv_saddr;
__u16 destp = ntohs(inet->dport);
......
......@@ -337,7 +337,7 @@ void tcp_time_wait(struct sock *sk, int state, int timeo)
tw = kmem_cache_alloc(tcp_timewait_cachep, SLAB_ATOMIC);
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);
/* Give us an identity. */
......
......@@ -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)
{
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_skb_cb *tcb = TCP_SKB_CB(skb);
int tcp_header_size = tp->tcp_header_len;
......
......@@ -332,7 +332,7 @@ static void tcp_retransmit_timer(struct sock *sk)
*/
#ifdef TCP_DEBUG
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",
NIPQUAD(inet->daddr), htons(inet->dport),
inet->num, tp->snd_una, tp->snd_nxt);
......
......@@ -124,7 +124,7 @@ static int udp_v4_get_port(struct sock *sk, unsigned short snum)
{
struct hlist_node *node;
struct sock *sk2;
struct inet_opt *inet = inet_sk(sk);
struct inet_sock *inet = inet_sk(sk);
write_lock_bh(&udp_hash_lock);
if (snum == 0) {
......@@ -171,7 +171,7 @@ static int udp_v4_get_port(struct sock *sk, unsigned short snum)
} else {
sk_for_each(sk2, node,
&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 &&
sk2 != sk &&
......@@ -227,7 +227,7 @@ struct sock *udp_v4_lookup_longway(u32 saddr, u16 sport, u32 daddr, u16 dport, i
int badness = -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)) {
int score = (sk->sk_family == PF_INET ? 1 : 0);
......@@ -285,7 +285,7 @@ static inline struct sock *udp_v4_mcast_next(struct sock *sk,
unsigned short hnum = ntohs(loc_port);
sk_for_each_from(s, node) {
struct inet_opt *inet = inet_sk(s);
struct inet_sock *inet = inet_sk(s);
if (inet->num != hnum ||
(inet->daddr && inet->daddr != rmt_addr) ||
......@@ -316,7 +316,7 @@ static inline struct sock *udp_v4_mcast_next(struct sock *sk,
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 udphdr *uh = (struct udphdr*)(skb->data+(iph->ihl<<2));
int type = skb->h.icmph->type;
......@@ -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)
{
struct inet_opt *inet = inet_sk(sk);
struct inet_sock *inet = inet_sk(sk);
struct flowi *fl = &inet->cork.fl;
struct sk_buff *skb;
struct udphdr *uh;
......@@ -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,
size_t len)
{
struct inet_opt *inet = inet_sk(sk);
struct inet_sock *inet = inet_sk(sk);
struct udp_opt *up = udp_sk(sk);
int ulen = len;
struct ipcm_cookie ipc;
......@@ -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,
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 sk_buff *skb;
int copied, err;
......@@ -864,7 +864,7 @@ int udp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
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.
*/
......@@ -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)
{
struct inet_opt *inet = inet_sk(sp);
struct inet_sock *inet = inet_sk(sp);
unsigned int dest = inet->daddr;
unsigned int src = inet->rcv_saddr;
__u16 destp = ntohs(inet->dport);
......
......@@ -114,10 +114,9 @@ static __inline__ struct ipv6_pinfo *inet6_sk_generic(struct sock *sk)
static int inet6_create(struct socket *sock, int protocol)
{
struct inet_opt *inet;
struct inet_sock *inet;
struct ipv6_pinfo *np;
struct sock *sk;
struct tcp6_sock* tcp6sk;
struct list_head *p;
struct inet_protosw *answer;
struct proto *answer_prot;
......@@ -196,8 +195,7 @@ static int inet6_create(struct socket *sock, int protocol)
sk->sk_backlog_rcv = answer->prot->backlog_rcv;
tcp6sk = (struct tcp6_sock *)sk;
tcp6sk->pinet6 = np = inet6_sk_generic(sk);
inet_sk(sk)->pinet6 = np = inet6_sk_generic(sk);
np->hop_limit = -1;
np->mcast_hops = -1;
np->mc_loop = 1;
......@@ -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 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);
__u32 v4addr = 0;
unsigned short snum;
......@@ -410,7 +408,7 @@ int inet6_getname(struct socket *sock, struct sockaddr *uaddr,
{
struct sockaddr_in6 *sin=(struct sockaddr_in6 *)uaddr;
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);
sin->sin6_family = AF_INET6;
......
......@@ -36,7 +36,7 @@
int ip6_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
{
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 in6_addr *daddr, *final_p = NULL, final;
struct dst_entry *dst;
......@@ -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)
sin->sin6_scope_id = IP6CB(skb)->iif;
} else {
struct inet_opt *inet = inet_sk(sk);
struct inet_sock *inet = inet_sk(sk);
ipv6_addr_set(&sin->sin6_addr, 0, 0,
htonl(0xffff),
......
......@@ -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,
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 sk_buff *skb;
unsigned int maxfraglen, fragheaderlen;
......@@ -1087,7 +1087,7 @@ int ip6_push_pending_frames(struct sock *sk)
struct sk_buff *skb, *tmp_skb;
struct sk_buff **tail_skb;
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 ipv6hdr *hdr;
struct ipv6_txoptions *opt = np->cork.opt;
......@@ -1165,7 +1165,7 @@ int ip6_push_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 sk_buff *skb;
......
......@@ -178,7 +178,7 @@ void ipv6_raw_deliver(struct sk_buff *skb, int nexthdr)
/* This cleans up af_inet6 a bit. -DaveM */
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 sockaddr_in6 *addr = (struct sockaddr_in6 *) uaddr;
__u32 v4addr = 0;
......@@ -253,7 +253,7 @@ void rawv6_err(struct sock *sk, struct sk_buff *skb,
struct inet6_skb_parm *opt,
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);
int err;
int harderr;
......@@ -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)
{
struct inet_opt *inet = inet_sk(sk);
struct inet_sock *inet = inet_sk(sk);
struct raw6_opt *raw_opt = raw6_sk(sk);
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,
struct flowi *fl, struct rt6_info *rt,
unsigned int flags)
{
struct inet_opt *inet = inet_sk(sk);
struct inet_sock *inet = inet_sk(sk);
struct ipv6hdr *iph;
struct sk_buff *skb;
unsigned int hh_len;
......@@ -607,7 +607,7 @@ static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk,
struct ipv6_txoptions opt_space;
struct sockaddr_in6 * sin6 = (struct sockaddr_in6 *) msg->msg_name;
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 raw6_opt *raw_opt = raw6_sk(sk);
struct ipv6_txoptions *opt = NULL;
......
......@@ -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)
{
struct inet_opt *inet = inet_sk(sk);
struct inet_sock *inet = inet_sk(sk);
struct ipv6_pinfo *np = inet6_sk(sk);
struct in6_addr *laddr = &np->rcv_saddr;
struct in6_addr *faddr = &np->daddr;
......@@ -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)
{
struct inet_opt *inet = inet_sk(sk);
struct inet_sock *inet = inet_sk(sk);
struct ipv6_pinfo *np = inet6_sk(sk);
struct in6_addr *daddr = &np->rcv_saddr;
struct in6_addr *saddr = &np->daddr;
......@@ -549,7 +549,7 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
int addr_len)
{
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 tcp_opt *tp = tcp_sk(sk);
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,
dst = __sk_dst_check(sk, np->dst_cookie);
if (dst == NULL) {
struct inet_opt *inet = inet_sk(sk);
struct inet_sock *inet = inet_sk(sk);
struct flowi fl;
/* 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,
{
struct ipv6_pinfo *newnp, *np = inet6_sk(sk);
struct tcp6_sock *newtcp6sk;
struct inet_opt *newinet;
struct inet_sock *newinet;
struct tcp_opt *newtp;
struct sock *newsk;
struct ipv6_txoptions *opt;
......@@ -1297,7 +1297,7 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
return NULL;
newtcp6sk = (struct tcp6_sock *)newsk;
newtcp6sk->pinet6 = &newtcp6sk->inet6;
newtcp6sk->inet.pinet6 = &newtcp6sk->inet6;
newinet = inet_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,
~(NETIF_F_IP_CSUM | NETIF_F_TSO);
newtcp6sk = (struct tcp6_sock *)newsk;
newtcp6sk->pinet6 = &newtcp6sk->inet6;
newtcp6sk->inet.pinet6 = &newtcp6sk->inet6;
newtp = tcp_sk(newsk);
newinet = inet_sk(newsk);
......@@ -1754,7 +1754,7 @@ static int tcp_v6_rebuild_header(struct sock *sk)
dst = __sk_dst_check(sk, np->dst_cookie);
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 flowi fl;
......@@ -1800,7 +1800,7 @@ static int tcp_v6_rebuild_header(struct sock *sk)
static int tcp_v6_xmit(struct sk_buff *skb, int ipfragok)
{
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 flowi fl;
struct dst_entry *dst;
......@@ -2006,7 +2006,7 @@ static void get_tcp6_sock(struct seq_file *seq, struct sock *sp, int i)
__u16 destp, srcp;
int timer_active;
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 ipv6_pinfo *np = inet6_sk(sp);
......
......@@ -160,7 +160,7 @@ static struct sock *udp_v6_lookup(struct in6_addr *saddr, u16 sport,
read_lock(&udp_hash_lock);
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) {
struct ipv6_pinfo *np = inet6_sk(sk);
......@@ -269,7 +269,7 @@ static int udpv6_recvmsg(struct kiocb *iocb, struct sock *sk,
sin6->sin6_scope_id = 0;
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,
htonl(0xffff), skb->nh.iph->saddr);
......@@ -386,7 +386,7 @@ static struct sock *udp_v6_mcast_next(struct sock *sk,
unsigned short num = ntohs(loc_port);
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) {
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)
{
struct sk_buff *skb;
struct udphdr *uh;
struct inet_opt *inet = inet_sk(sk);
struct inet_sock *inet = inet_sk(sk);
struct flowi *fl = &inet->cork.fl;
int err = 0;
......@@ -624,7 +624,7 @@ static int udpv6_sendmsg(struct kiocb *iocb, struct sock *sk,
{
struct ipv6_txoptions opt_space;
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 sockaddr_in6 *sin6 = (struct sockaddr_in6 *) msg->msg_name;
struct in6_addr *daddr, *final_p = NULL, final;
......@@ -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)
{
struct inet_opt *inet = inet_sk(sp);
struct inet_sock *inet = inet_sk(sp);
struct ipv6_pinfo *np = inet6_sk(sp);
struct in6_addr *dest, *src;
__u16 destp, srcp;
......
......@@ -393,7 +393,7 @@ void sctp_v4_err(struct sk_buff *skb, __u32 info)
struct sctp_endpoint *ep;
struct sctp_association *asoc;
struct sctp_transport *transport;
struct inet_opt *inet;
struct inet_sock *inet;
char *saveip, *savesctp;
int err;
......
......@@ -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 sctp_association *asoc)
{
struct inet_opt *inet = inet_sk(sk);
struct inet_sock *inet = inet_sk(sk);
struct sock *newsk;
struct inet_opt *newinet;
struct inet_sock *newinet;
struct ipv6_pinfo *newnp, *np = inet6_sk(sk);
struct sctp6_sock *newsctp6sk;
......@@ -608,7 +608,7 @@ struct sock *sctp_v6_create_accept_sk(struct sock *sk,
newsk->sk_shutdown = sk->sk_shutdown;
newsctp6sk = (struct sctp6_sock *)newsk;
newsctp6sk->pinet6 = &newsctp6sk->inet6;
newsctp6sk->inet.pinet6 = &newsctp6sk->inet6;
newinet = inet_sk(newsk);
newnp = inet6_sk(newsk);
......
......@@ -551,8 +551,8 @@ struct sock *sctp_v4_create_accept_sk(struct sock *sk,
struct sctp_association *asoc)
{
struct sock *newsk;
struct inet_opt *inet = inet_sk(sk);
struct inet_opt *newinet;
struct inet_sock *inet = inet_sk(sk);
struct inet_sock *newinet;
newsk = sk_alloc(PF_INET, GFP_KERNEL, sk->sk_prot->slab_obj_size,
sk->sk_prot->slab);
......
......@@ -566,7 +566,7 @@ void avc_audit(u32 ssid, u32 tsid,
switch (sk->sk_family) {
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,
inet->sport,
......@@ -577,7 +577,7 @@ void avc_audit(u32 ssid, u32 tsid,
break;
}
case AF_INET6: {
struct inet_opt *inet = inet_sk(sk);
struct inet_sock *inet = inet_sk(sk);
struct ipv6_pinfo *inet6 = inet6_sk(sk);
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