Commit b6238c04 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by David S. Miller

net/ipv4: remove compat_ip_{get,set}sockopt

Handle the few cases that need special treatment in-line using
in_compat_syscall().
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 02caad7c
...@@ -727,10 +727,6 @@ int ip_setsockopt(struct sock *sk, int level, int optname, char __user *optval, ...@@ -727,10 +727,6 @@ int ip_setsockopt(struct sock *sk, int level, int optname, char __user *optval,
unsigned int optlen); unsigned int optlen);
int ip_getsockopt(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 __user *optlen);
int compat_ip_setsockopt(struct sock *sk, int level, int optname,
char __user *optval, unsigned int optlen);
int compat_ip_getsockopt(struct sock *sk, int level, int optname,
char __user *optval, int __user *optlen);
int ip_ra_control(struct sock *sk, unsigned char on, int ip_ra_control(struct sock *sk, unsigned char on,
void (*destructor)(struct sock *)); void (*destructor)(struct sock *));
......
...@@ -913,10 +913,6 @@ static const struct inet_connection_sock_af_ops dccp_ipv4_af_ops = { ...@@ -913,10 +913,6 @@ static const struct inet_connection_sock_af_ops dccp_ipv4_af_ops = {
.getsockopt = ip_getsockopt, .getsockopt = ip_getsockopt,
.addr2sockaddr = inet_csk_addr2sockaddr, .addr2sockaddr = inet_csk_addr2sockaddr,
.sockaddr_len = sizeof(struct sockaddr_in), .sockaddr_len = sizeof(struct sockaddr_in),
#ifdef CONFIG_COMPAT
.compat_setsockopt = compat_ip_setsockopt,
.compat_getsockopt = compat_ip_getsockopt,
#endif
}; };
static int dccp_v4_init_sock(struct sock *sk) static int dccp_v4_init_sock(struct sock *sk)
......
This diff is collapsed.
...@@ -857,16 +857,6 @@ static int raw_setsockopt(struct sock *sk, int level, int optname, ...@@ -857,16 +857,6 @@ static int raw_setsockopt(struct sock *sk, int level, int optname,
return do_raw_setsockopt(sk, level, optname, optval, optlen); return do_raw_setsockopt(sk, level, optname, optval, optlen);
} }
#ifdef CONFIG_COMPAT
static int compat_raw_setsockopt(struct sock *sk, int level, int optname,
char __user *optval, unsigned int optlen)
{
if (level != SOL_RAW)
return compat_ip_setsockopt(sk, level, optname, optval, optlen);
return do_raw_setsockopt(sk, level, optname, optval, optlen);
}
#endif
static int do_raw_getsockopt(struct sock *sk, int level, int optname, static int do_raw_getsockopt(struct sock *sk, int level, int optname,
char __user *optval, int __user *optlen) char __user *optval, int __user *optlen)
{ {
...@@ -887,16 +877,6 @@ static int raw_getsockopt(struct sock *sk, int level, int optname, ...@@ -887,16 +877,6 @@ static int raw_getsockopt(struct sock *sk, int level, int optname,
return do_raw_getsockopt(sk, level, optname, optval, optlen); return do_raw_getsockopt(sk, level, optname, optval, optlen);
} }
#ifdef CONFIG_COMPAT
static int compat_raw_getsockopt(struct sock *sk, int level, int optname,
char __user *optval, int __user *optlen)
{
if (level != SOL_RAW)
return compat_ip_getsockopt(sk, level, optname, optval, optlen);
return do_raw_getsockopt(sk, level, optname, optval, optlen);
}
#endif
static int raw_ioctl(struct sock *sk, int cmd, unsigned long arg) static int raw_ioctl(struct sock *sk, int cmd, unsigned long arg)
{ {
switch (cmd) { switch (cmd) {
...@@ -980,8 +960,6 @@ struct proto raw_prot = { ...@@ -980,8 +960,6 @@ struct proto raw_prot = {
.usersize = sizeof_field(struct raw_sock, filter), .usersize = sizeof_field(struct raw_sock, filter),
.h.raw_hash = &raw_v4_hashinfo, .h.raw_hash = &raw_v4_hashinfo,
#ifdef CONFIG_COMPAT #ifdef CONFIG_COMPAT
.compat_setsockopt = compat_raw_setsockopt,
.compat_getsockopt = compat_raw_getsockopt,
.compat_ioctl = compat_raw_ioctl, .compat_ioctl = compat_raw_ioctl,
#endif #endif
.diag_destroy = raw_abort, .diag_destroy = raw_abort,
......
...@@ -2134,10 +2134,6 @@ const struct inet_connection_sock_af_ops ipv4_specific = { ...@@ -2134,10 +2134,6 @@ const struct inet_connection_sock_af_ops ipv4_specific = {
.getsockopt = ip_getsockopt, .getsockopt = ip_getsockopt,
.addr2sockaddr = inet_csk_addr2sockaddr, .addr2sockaddr = inet_csk_addr2sockaddr,
.sockaddr_len = sizeof(struct sockaddr_in), .sockaddr_len = sizeof(struct sockaddr_in),
#ifdef CONFIG_COMPAT
.compat_setsockopt = compat_ip_setsockopt,
.compat_getsockopt = compat_ip_getsockopt,
#endif
.mtu_reduced = tcp_v4_mtu_reduced, .mtu_reduced = tcp_v4_mtu_reduced,
}; };
EXPORT_SYMBOL(ipv4_specific); EXPORT_SYMBOL(ipv4_specific);
......
...@@ -2656,17 +2656,6 @@ int udp_setsockopt(struct sock *sk, int level, int optname, ...@@ -2656,17 +2656,6 @@ int udp_setsockopt(struct sock *sk, int level, int optname,
return ip_setsockopt(sk, level, optname, optval, optlen); return ip_setsockopt(sk, level, optname, optval, optlen);
} }
#ifdef CONFIG_COMPAT
int compat_udp_setsockopt(struct sock *sk, int level, int optname,
char __user *optval, unsigned int optlen)
{
if (level == SOL_UDP || level == SOL_UDPLITE)
return udp_lib_setsockopt(sk, level, optname, optval, optlen,
udp_push_pending_frames);
return compat_ip_setsockopt(sk, level, optname, optval, optlen);
}
#endif
int udp_lib_getsockopt(struct sock *sk, int level, int optname, int udp_lib_getsockopt(struct sock *sk, int level, int optname,
char __user *optval, int __user *optlen) char __user *optval, int __user *optlen)
{ {
...@@ -2732,15 +2721,6 @@ int udp_getsockopt(struct sock *sk, int level, int optname, ...@@ -2732,15 +2721,6 @@ int udp_getsockopt(struct sock *sk, int level, int optname,
return ip_getsockopt(sk, level, optname, optval, optlen); return ip_getsockopt(sk, level, optname, optval, optlen);
} }
#ifdef CONFIG_COMPAT
int compat_udp_getsockopt(struct sock *sk, int level, int optname,
char __user *optval, int __user *optlen)
{
if (level == SOL_UDP || level == SOL_UDPLITE)
return udp_lib_getsockopt(sk, level, optname, optval, optlen);
return compat_ip_getsockopt(sk, level, optname, optval, optlen);
}
#endif
/** /**
* udp_poll - wait for a UDP event. * udp_poll - wait for a UDP event.
* @file: - file struct * @file: - file struct
...@@ -2812,10 +2792,6 @@ struct proto udp_prot = { ...@@ -2812,10 +2792,6 @@ struct proto udp_prot = {
.sysctl_rmem_offset = offsetof(struct net, ipv4.sysctl_udp_rmem_min), .sysctl_rmem_offset = offsetof(struct net, ipv4.sysctl_udp_rmem_min),
.obj_size = sizeof(struct udp_sock), .obj_size = sizeof(struct udp_sock),
.h.udp_table = &udp_table, .h.udp_table = &udp_table,
#ifdef CONFIG_COMPAT
.compat_setsockopt = compat_udp_setsockopt,
.compat_getsockopt = compat_udp_getsockopt,
#endif
.diag_destroy = udp_abort, .diag_destroy = udp_abort,
}; };
EXPORT_SYMBOL(udp_prot); EXPORT_SYMBOL(udp_prot);
......
...@@ -17,12 +17,6 @@ int udp_setsockopt(struct sock *sk, int level, int optname, ...@@ -17,12 +17,6 @@ int udp_setsockopt(struct sock *sk, int level, int optname,
int udp_getsockopt(struct sock *sk, int level, int optname, int udp_getsockopt(struct sock *sk, int level, int optname,
char __user *optval, int __user *optlen); char __user *optval, int __user *optlen);
#ifdef CONFIG_COMPAT
int compat_udp_setsockopt(struct sock *sk, int level, int optname,
char __user *optval, unsigned int optlen);
int compat_udp_getsockopt(struct sock *sk, int level, int optname,
char __user *optval, int __user *optlen);
#endif
int udp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, int noblock, int udp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, int noblock,
int flags, int *addr_len); int flags, int *addr_len);
int udp_sendpage(struct sock *sk, struct page *page, int offset, size_t size, int udp_sendpage(struct sock *sk, struct page *page, int offset, size_t size,
......
...@@ -56,10 +56,6 @@ struct proto udplite_prot = { ...@@ -56,10 +56,6 @@ struct proto udplite_prot = {
.sysctl_mem = sysctl_udp_mem, .sysctl_mem = sysctl_udp_mem,
.obj_size = sizeof(struct udp_sock), .obj_size = sizeof(struct udp_sock),
.h.udp_table = &udplite_table, .h.udp_table = &udplite_table,
#ifdef CONFIG_COMPAT
.compat_setsockopt = compat_udp_setsockopt,
.compat_getsockopt = compat_udp_getsockopt,
#endif
}; };
EXPORT_SYMBOL(udplite_prot); EXPORT_SYMBOL(udplite_prot);
......
...@@ -612,10 +612,6 @@ static struct proto l2tp_ip_prot = { ...@@ -612,10 +612,6 @@ static struct proto l2tp_ip_prot = {
.hash = l2tp_ip_hash, .hash = l2tp_ip_hash,
.unhash = l2tp_ip_unhash, .unhash = l2tp_ip_unhash,
.obj_size = sizeof(struct l2tp_ip_sock), .obj_size = sizeof(struct l2tp_ip_sock),
#ifdef CONFIG_COMPAT
.compat_setsockopt = compat_ip_setsockopt,
.compat_getsockopt = compat_ip_getsockopt,
#endif
}; };
static const struct proto_ops l2tp_ip_ops = { static const struct proto_ops l2tp_ip_ops = {
......
...@@ -1089,10 +1089,6 @@ static struct sctp_af sctp_af_inet = { ...@@ -1089,10 +1089,6 @@ static struct sctp_af sctp_af_inet = {
.net_header_len = sizeof(struct iphdr), .net_header_len = sizeof(struct iphdr),
.sockaddr_len = sizeof(struct sockaddr_in), .sockaddr_len = sizeof(struct sockaddr_in),
.ip_options_len = sctp_v4_ip_options_len, .ip_options_len = sctp_v4_ip_options_len,
#ifdef CONFIG_COMPAT
.compat_setsockopt = compat_ip_setsockopt,
.compat_getsockopt = compat_ip_getsockopt,
#endif
}; };
struct sctp_pf *sctp_get_pf_specific(sa_family_t family) struct sctp_pf *sctp_get_pf_specific(sa_family_t family)
......
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