aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/af_inet.c120
-rw-r--r--net/ipv4/ip_sockglue.c35
-rw-r--r--net/ipv4/raw.c46
-rw-r--r--net/ipv4/tcp.c16
-rw-r--r--net/ipv4/tcp_ipv4.c34
-rw-r--r--net/ipv4/udp.c48
6 files changed, 146 insertions, 153 deletions
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index 454e523b506a..dc206f1f914f 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -788,53 +788,53 @@ int inet_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
788} 788}
789 789
790const struct proto_ops inet_stream_ops = { 790const struct proto_ops inet_stream_ops = {
791 .family = PF_INET, 791 .family = PF_INET,
792 .owner = THIS_MODULE, 792 .owner = THIS_MODULE,
793 .release = inet_release, 793 .release = inet_release,
794 .bind = inet_bind, 794 .bind = inet_bind,
795 .connect = inet_stream_connect, 795 .connect = inet_stream_connect,
796 .socketpair = sock_no_socketpair, 796 .socketpair = sock_no_socketpair,
797 .accept = inet_accept, 797 .accept = inet_accept,
798 .getname = inet_getname, 798 .getname = inet_getname,
799 .poll = tcp_poll, 799 .poll = tcp_poll,
800 .ioctl = inet_ioctl, 800 .ioctl = inet_ioctl,
801 .listen = inet_listen, 801 .listen = inet_listen,
802 .shutdown = inet_shutdown, 802 .shutdown = inet_shutdown,
803 .setsockopt = sock_common_setsockopt, 803 .setsockopt = sock_common_setsockopt,
804 .getsockopt = sock_common_getsockopt, 804 .getsockopt = sock_common_getsockopt,
805 .sendmsg = inet_sendmsg,
806 .recvmsg = sock_common_recvmsg,
807 .mmap = sock_no_mmap,
808 .sendpage = tcp_sendpage,
805#ifdef CONFIG_COMPAT 809#ifdef CONFIG_COMPAT
806 .compat_setsockopt = compat_sock_common_setsockopt, 810 .compat_setsockopt = compat_sock_common_setsockopt,
807 .compat_getsockopt = compat_sock_common_getsockopt, 811 .compat_getsockopt = compat_sock_common_getsockopt,
808#endif 812#endif
809 .sendmsg = inet_sendmsg,
810 .recvmsg = sock_common_recvmsg,
811 .mmap = sock_no_mmap,
812 .sendpage = tcp_sendpage
813}; 813};
814 814
815const struct proto_ops inet_dgram_ops = { 815const struct proto_ops inet_dgram_ops = {
816 .family = PF_INET, 816 .family = PF_INET,
817 .owner = THIS_MODULE, 817 .owner = THIS_MODULE,
818 .release = inet_release, 818 .release = inet_release,
819 .bind = inet_bind, 819 .bind = inet_bind,
820 .connect = inet_dgram_connect, 820 .connect = inet_dgram_connect,
821 .socketpair = sock_no_socketpair, 821 .socketpair = sock_no_socketpair,
822 .accept = sock_no_accept, 822 .accept = sock_no_accept,
823 .getname = inet_getname, 823 .getname = inet_getname,
824 .poll = udp_poll, 824 .poll = udp_poll,
825 .ioctl = inet_ioctl, 825 .ioctl = inet_ioctl,
826 .listen = sock_no_listen, 826 .listen = sock_no_listen,
827 .shutdown = inet_shutdown, 827 .shutdown = inet_shutdown,
828 .setsockopt = sock_common_setsockopt, 828 .setsockopt = sock_common_setsockopt,
829 .getsockopt = sock_common_getsockopt, 829 .getsockopt = sock_common_getsockopt,
830 .sendmsg = inet_sendmsg,
831 .recvmsg = sock_common_recvmsg,
832 .mmap = sock_no_mmap,
833 .sendpage = inet_sendpage,
830#ifdef CONFIG_COMPAT 834#ifdef CONFIG_COMPAT
831 .compat_setsockopt = compat_sock_common_setsockopt, 835 .compat_setsockopt = compat_sock_common_setsockopt,
832 .compat_getsockopt = compat_sock_common_getsockopt, 836 .compat_getsockopt = compat_sock_common_getsockopt,
833#endif 837#endif
834 .sendmsg = inet_sendmsg,
835 .recvmsg = sock_common_recvmsg,
836 .mmap = sock_no_mmap,
837 .sendpage = inet_sendpage,
838}; 838};
839 839
840/* 840/*
@@ -842,28 +842,28 @@ const struct proto_ops inet_dgram_ops = {
842 * udp_poll 842 * udp_poll
843 */ 843 */
844static const struct proto_ops inet_sockraw_ops = { 844static const struct proto_ops inet_sockraw_ops = {
845 .family = PF_INET, 845 .family = PF_INET,
846 .owner = THIS_MODULE, 846 .owner = THIS_MODULE,
847 .release = inet_release, 847 .release = inet_release,
848 .bind = inet_bind, 848 .bind = inet_bind,
849 .connect = inet_dgram_connect, 849 .connect = inet_dgram_connect,
850 .socketpair = sock_no_socketpair, 850 .socketpair = sock_no_socketpair,
851 .accept = sock_no_accept, 851 .accept = sock_no_accept,
852 .getname = inet_getname, 852 .getname = inet_getname,
853 .poll = datagram_poll, 853 .poll = datagram_poll,
854 .ioctl = inet_ioctl, 854 .ioctl = inet_ioctl,
855 .listen = sock_no_listen, 855 .listen = sock_no_listen,
856 .shutdown = inet_shutdown, 856 .shutdown = inet_shutdown,
857 .setsockopt = sock_common_setsockopt, 857 .setsockopt = sock_common_setsockopt,
858 .getsockopt = sock_common_getsockopt, 858 .getsockopt = sock_common_getsockopt,
859 .sendmsg = inet_sendmsg,
860 .recvmsg = sock_common_recvmsg,
861 .mmap = sock_no_mmap,
862 .sendpage = inet_sendpage,
859#ifdef CONFIG_COMPAT 863#ifdef CONFIG_COMPAT
860 .compat_setsockopt = compat_sock_common_setsockopt, 864 .compat_setsockopt = compat_sock_common_setsockopt,
861 .compat_getsockopt = compat_sock_common_getsockopt, 865 .compat_getsockopt = compat_sock_common_getsockopt,
862#endif 866#endif
863 .sendmsg = inet_sendmsg,
864 .recvmsg = sock_common_recvmsg,
865 .mmap = sock_no_mmap,
866 .sendpage = inet_sendpage,
867}; 867};
868 868
869static struct net_proto_family inet_family_ops = { 869static struct net_proto_family inet_family_ops = {
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c
index 49ff1cd4e1c9..12e0bf19f24a 100644
--- a/net/ipv4/ip_sockglue.c
+++ b/net/ipv4/ip_sockglue.c
@@ -910,8 +910,8 @@ int ip_setsockopt(struct sock *sk, int level,
910} 910}
911 911
912#ifdef CONFIG_COMPAT 912#ifdef CONFIG_COMPAT
913int compat_ip_setsockopt(struct sock *sk, int level, 913int compat_ip_setsockopt(struct sock *sk, int level, int optname,
914 int optname, char __user *optval, int optlen) 914 char __user *optval, int optlen)
915{ 915{
916 int err; 916 int err;
917 917
@@ -922,19 +922,21 @@ int compat_ip_setsockopt(struct sock *sk, int level,
922#ifdef CONFIG_NETFILTER 922#ifdef CONFIG_NETFILTER
923 /* we need to exclude all possible ENOPROTOOPTs except default case */ 923 /* we need to exclude all possible ENOPROTOOPTs except default case */
924 if (err == -ENOPROTOOPT && optname != IP_HDRINCL && 924 if (err == -ENOPROTOOPT && optname != IP_HDRINCL &&
925 optname != IP_IPSEC_POLICY && optname != IP_XFRM_POLICY 925 optname != IP_IPSEC_POLICY && optname != IP_XFRM_POLICY
926#ifdef CONFIG_IP_MROUTE 926#ifdef CONFIG_IP_MROUTE
927 && (optname < MRT_BASE || optname > (MRT_BASE + 10)) 927 && (optname < MRT_BASE || optname > (MRT_BASE + 10))
928#endif 928#endif
929 ) { 929 ) {
930 lock_sock(sk); 930 lock_sock(sk);
931 err = compat_nf_setsockopt(sk, PF_INET, 931 err = compat_nf_setsockopt(sk, PF_INET, optname,
932 optname, optval, optlen); 932 optval, optlen);
933 release_sock(sk); 933 release_sock(sk);
934 } 934 }
935#endif 935#endif
936 return err; 936 return err;
937} 937}
938
939EXPORT_SYMBOL(compat_ip_setsockopt);
938#endif 940#endif
939 941
940/* 942/*
@@ -1180,27 +1182,24 @@ int ip_getsockopt(struct sock *sk, int level,
1180} 1182}
1181 1183
1182#ifdef CONFIG_COMPAT 1184#ifdef CONFIG_COMPAT
1183int compat_ip_getsockopt(struct sock *sk, int level, 1185int compat_ip_getsockopt(struct sock *sk, int level, int optname,
1184 int optname, char __user *optval, int __user *optlen) 1186 char __user *optval, int __user *optlen)
1185{ 1187{
1186 int err; 1188 int err = do_ip_getsockopt(sk, level, optname, optval, optlen);
1187
1188 err = do_ip_getsockopt(sk, level, optname, optval, optlen);
1189#ifdef CONFIG_NETFILTER 1189#ifdef CONFIG_NETFILTER
1190 /* we need to exclude all possible ENOPROTOOPTs except default case */ 1190 /* we need to exclude all possible ENOPROTOOPTs except default case */
1191 if (err == -ENOPROTOOPT && optname != IP_PKTOPTIONS 1191 if (err == -ENOPROTOOPT && optname != IP_PKTOPTIONS
1192#ifdef CONFIG_IP_MROUTE 1192#ifdef CONFIG_IP_MROUTE
1193 && (optname < MRT_BASE || optname > MRT_BASE+10) 1193 && (optname < MRT_BASE || optname > MRT_BASE+10)
1194#endif 1194#endif
1195 ) { 1195 ) {
1196 int len; 1196 int len;
1197 1197
1198 if(get_user(len,optlen)) 1198 if (get_user(len, optlen))
1199 return -EFAULT; 1199 return -EFAULT;
1200 1200
1201 lock_sock(sk); 1201 lock_sock(sk);
1202 err = compat_nf_getsockopt(sk, PF_INET, 1202 err = compat_nf_getsockopt(sk, PF_INET, optname, optval, &len);
1203 optname, optval, &len);
1204 release_sock(sk); 1203 release_sock(sk);
1205 if (err >= 0) 1204 if (err >= 0)
1206 err = put_user(len, optlen); 1205 err = put_user(len, optlen);
@@ -1209,13 +1208,11 @@ int compat_ip_getsockopt(struct sock *sk, int level,
1209#endif 1208#endif
1210 return err; 1209 return err;
1211} 1210}
1211
1212EXPORT_SYMBOL(compat_ip_getsockopt);
1212#endif 1213#endif
1213 1214
1214EXPORT_SYMBOL(ip_cmsg_recv); 1215EXPORT_SYMBOL(ip_cmsg_recv);
1215 1216
1216EXPORT_SYMBOL(ip_getsockopt); 1217EXPORT_SYMBOL(ip_getsockopt);
1217EXPORT_SYMBOL(ip_setsockopt); 1218EXPORT_SYMBOL(ip_setsockopt);
1218#ifdef CONFIG_COMPAT
1219EXPORT_SYMBOL(compat_ip_getsockopt);
1220EXPORT_SYMBOL(compat_ip_setsockopt);
1221#endif
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c
index f1b02b34fc0a..fc2562415555 100644
--- a/net/ipv4/raw.c
+++ b/net/ipv4/raw.c
@@ -682,11 +682,10 @@ static int raw_setsockopt(struct sock *sk, int level, int optname,
682 682
683#ifdef CONFIG_COMPAT 683#ifdef CONFIG_COMPAT
684static int compat_raw_setsockopt(struct sock *sk, int level, int optname, 684static int compat_raw_setsockopt(struct sock *sk, int level, int optname,
685 char __user *optval, int optlen) 685 char __user *optval, int optlen)
686{ 686{
687 if (level != SOL_RAW) 687 if (level != SOL_RAW)
688 return compat_ip_setsockopt(sk, level, 688 return compat_ip_setsockopt(sk, level, optname, optval, optlen);
689 optname, optval, optlen);
690 return do_raw_setsockopt(sk, level, optname, optval, optlen); 689 return do_raw_setsockopt(sk, level, optname, optval, optlen);
691} 690}
692#endif 691#endif
@@ -713,11 +712,10 @@ static int raw_getsockopt(struct sock *sk, int level, int optname,
713 712
714#ifdef CONFIG_COMPAT 713#ifdef CONFIG_COMPAT
715static int compat_raw_getsockopt(struct sock *sk, int level, int optname, 714static int compat_raw_getsockopt(struct sock *sk, int level, int optname,
716 char __user *optval, int __user *optlen) 715 char __user *optval, int __user *optlen)
717{ 716{
718 if (level != SOL_RAW) 717 if (level != SOL_RAW)
719 return compat_ip_getsockopt(sk, level, 718 return compat_ip_getsockopt(sk, level, optname, optval, optlen);
720 optname, optval, optlen);
721 return do_raw_getsockopt(sk, level, optname, optval, optlen); 719 return do_raw_getsockopt(sk, level, optname, optval, optlen);
722} 720}
723#endif 721#endif
@@ -751,26 +749,26 @@ static int raw_ioctl(struct sock *sk, int cmd, unsigned long arg)
751} 749}
752 750
753struct proto raw_prot = { 751struct proto raw_prot = {
754 .name = "RAW", 752 .name = "RAW",
755 .owner = THIS_MODULE, 753 .owner = THIS_MODULE,
756 .close = raw_close, 754 .close = raw_close,
757 .connect = ip4_datagram_connect, 755 .connect = ip4_datagram_connect,
758 .disconnect = udp_disconnect, 756 .disconnect = udp_disconnect,
759 .ioctl = raw_ioctl, 757 .ioctl = raw_ioctl,
760 .init = raw_init, 758 .init = raw_init,
761 .setsockopt = raw_setsockopt, 759 .setsockopt = raw_setsockopt,
762 .getsockopt = raw_getsockopt, 760 .getsockopt = raw_getsockopt,
761 .sendmsg = raw_sendmsg,
762 .recvmsg = raw_recvmsg,
763 .bind = raw_bind,
764 .backlog_rcv = raw_rcv_skb,
765 .hash = raw_v4_hash,
766 .unhash = raw_v4_unhash,
767 .obj_size = sizeof(struct raw_sock),
763#ifdef CONFIG_COMPAT 768#ifdef CONFIG_COMPAT
764 .compat_setsockopt = compat_raw_setsockopt, 769 .compat_setsockopt = compat_raw_setsockopt,
765 .compat_getsockopt = compat_raw_getsockopt, 770 .compat_getsockopt = compat_raw_getsockopt,
766#endif 771#endif
767 .sendmsg = raw_sendmsg,
768 .recvmsg = raw_recvmsg,
769 .bind = raw_bind,
770 .backlog_rcv = raw_rcv_skb,
771 .hash = raw_v4_hash,
772 .unhash = raw_v4_unhash,
773 .obj_size = sizeof(struct raw_sock),
774}; 772};
775 773
776#ifdef CONFIG_PROC_FS 774#ifdef CONFIG_PROC_FS
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 89da253e33f0..4b0272c92d66 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -1879,14 +1879,16 @@ int tcp_setsockopt(struct sock *sk, int level, int optname, char __user *optval,
1879} 1879}
1880 1880
1881#ifdef CONFIG_COMPAT 1881#ifdef CONFIG_COMPAT
1882int compat_tcp_setsockopt(struct sock *sk, int level, 1882int compat_tcp_setsockopt(struct sock *sk, int level, int optname,
1883 int optname, char __user *optval, int optlen) 1883 char __user *optval, int optlen)
1884{ 1884{
1885 if (level != SOL_TCP) 1885 if (level != SOL_TCP)
1886 return inet_csk_compat_setsockopt(sk, level, optname, 1886 return inet_csk_compat_setsockopt(sk, level, optname,
1887 optval, optlen); 1887 optval, optlen);
1888 return do_tcp_setsockopt(sk, level, optname, optval, optlen); 1888 return do_tcp_setsockopt(sk, level, optname, optval, optlen);
1889} 1889}
1890
1891EXPORT_SYMBOL(compat_tcp_setsockopt);
1890#endif 1892#endif
1891 1893
1892/* Return information about state of tcp endpoint in API format. */ 1894/* Return information about state of tcp endpoint in API format. */
@@ -2051,14 +2053,16 @@ int tcp_getsockopt(struct sock *sk, int level, int optname, char __user *optval,
2051} 2053}
2052 2054
2053#ifdef CONFIG_COMPAT 2055#ifdef CONFIG_COMPAT
2054int compat_tcp_getsockopt(struct sock *sk, int level, 2056int compat_tcp_getsockopt(struct sock *sk, int level, int optname,
2055 int optname, char __user *optval, int __user *optlen) 2057 char __user *optval, int __user *optlen)
2056{ 2058{
2057 if (level != SOL_TCP) 2059 if (level != SOL_TCP)
2058 return inet_csk_compat_getsockopt(sk, level, optname, 2060 return inet_csk_compat_getsockopt(sk, level, optname,
2059 optval, optlen); 2061 optval, optlen);
2060 return do_tcp_getsockopt(sk, level, optname, optval, optlen); 2062 return do_tcp_getsockopt(sk, level, optname, optval, optlen);
2061} 2063}
2064
2065EXPORT_SYMBOL(compat_tcp_getsockopt);
2062#endif 2066#endif
2063 2067
2064extern void __skb_cb_too_small_for_tcp(int, int); 2068extern void __skb_cb_too_small_for_tcp(int, int);
@@ -2177,7 +2181,3 @@ EXPORT_SYMBOL(tcp_sendpage);
2177EXPORT_SYMBOL(tcp_setsockopt); 2181EXPORT_SYMBOL(tcp_setsockopt);
2178EXPORT_SYMBOL(tcp_shutdown); 2182EXPORT_SYMBOL(tcp_shutdown);
2179EXPORT_SYMBOL(tcp_statistics); 2183EXPORT_SYMBOL(tcp_statistics);
2180#ifdef CONFIG_COMPAT
2181EXPORT_SYMBOL(compat_tcp_setsockopt);
2182EXPORT_SYMBOL(compat_tcp_getsockopt);
2183#endif
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 249ef6c88959..9e85c0416109 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -1217,21 +1217,21 @@ int tcp_v4_tw_remember_stamp(struct inet_timewait_sock *tw)
1217} 1217}
1218 1218
1219struct inet_connection_sock_af_ops ipv4_specific = { 1219struct inet_connection_sock_af_ops ipv4_specific = {
1220 .queue_xmit = ip_queue_xmit, 1220 .queue_xmit = ip_queue_xmit,
1221 .send_check = tcp_v4_send_check, 1221 .send_check = tcp_v4_send_check,
1222 .rebuild_header = inet_sk_rebuild_header, 1222 .rebuild_header = inet_sk_rebuild_header,
1223 .conn_request = tcp_v4_conn_request, 1223 .conn_request = tcp_v4_conn_request,
1224 .syn_recv_sock = tcp_v4_syn_recv_sock, 1224 .syn_recv_sock = tcp_v4_syn_recv_sock,
1225 .remember_stamp = tcp_v4_remember_stamp, 1225 .remember_stamp = tcp_v4_remember_stamp,
1226 .net_header_len = sizeof(struct iphdr), 1226 .net_header_len = sizeof(struct iphdr),
1227 .setsockopt = ip_setsockopt, 1227 .setsockopt = ip_setsockopt,
1228 .getsockopt = ip_getsockopt, 1228 .getsockopt = ip_getsockopt,
1229 .addr2sockaddr = inet_csk_addr2sockaddr,
1230 .sockaddr_len = sizeof(struct sockaddr_in),
1229#ifdef CONFIG_COMPAT 1231#ifdef CONFIG_COMPAT
1230 .compat_setsockopt = compat_ip_setsockopt, 1232 .compat_setsockopt = compat_ip_setsockopt,
1231 .compat_getsockopt = compat_ip_getsockopt, 1233 .compat_getsockopt = compat_ip_getsockopt,
1232#endif 1234#endif
1233 .addr2sockaddr = inet_csk_addr2sockaddr,
1234 .sockaddr_len = sizeof(struct sockaddr_in),
1235}; 1235};
1236 1236
1237/* NOTE: A lot of things set to zero explicitly by call to 1237/* NOTE: A lot of things set to zero explicitly by call to
@@ -1812,10 +1812,6 @@ struct proto tcp_prot = {
1812 .shutdown = tcp_shutdown, 1812 .shutdown = tcp_shutdown,
1813 .setsockopt = tcp_setsockopt, 1813 .setsockopt = tcp_setsockopt,
1814 .getsockopt = tcp_getsockopt, 1814 .getsockopt = tcp_getsockopt,
1815#ifdef CONFIG_COMPAT
1816 .compat_setsockopt = compat_tcp_setsockopt,
1817 .compat_getsockopt = compat_tcp_getsockopt,
1818#endif
1819 .sendmsg = tcp_sendmsg, 1815 .sendmsg = tcp_sendmsg,
1820 .recvmsg = tcp_recvmsg, 1816 .recvmsg = tcp_recvmsg,
1821 .backlog_rcv = tcp_v4_do_rcv, 1817 .backlog_rcv = tcp_v4_do_rcv,
@@ -1834,6 +1830,10 @@ struct proto tcp_prot = {
1834 .obj_size = sizeof(struct tcp_sock), 1830 .obj_size = sizeof(struct tcp_sock),
1835 .twsk_prot = &tcp_timewait_sock_ops, 1831 .twsk_prot = &tcp_timewait_sock_ops,
1836 .rsk_prot = &tcp_request_sock_ops, 1832 .rsk_prot = &tcp_request_sock_ops,
1833#ifdef CONFIG_COMPAT
1834 .compat_setsockopt = compat_tcp_setsockopt,
1835 .compat_getsockopt = compat_tcp_getsockopt,
1836#endif
1837}; 1837};
1838 1838
1839void __init tcp_v4_init(struct net_proto_family *ops) 1839void __init tcp_v4_init(struct net_proto_family *ops)
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 0b0721bd45c6..3f93292b0ad8 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -1263,11 +1263,10 @@ static int udp_setsockopt(struct sock *sk, int level, int optname,
1263 1263
1264#ifdef CONFIG_COMPAT 1264#ifdef CONFIG_COMPAT
1265static int compat_udp_setsockopt(struct sock *sk, int level, int optname, 1265static int compat_udp_setsockopt(struct sock *sk, int level, int optname,
1266 char __user *optval, int optlen) 1266 char __user *optval, int optlen)
1267{ 1267{
1268 if (level != SOL_UDP) 1268 if (level != SOL_UDP)
1269 return compat_ip_setsockopt(sk, level, 1269 return compat_ip_setsockopt(sk, level, optname, optval, optlen);
1270 optname, optval, optlen);
1271 return do_udp_setsockopt(sk, level, optname, optval, optlen); 1270 return do_udp_setsockopt(sk, level, optname, optval, optlen);
1272} 1271}
1273#endif 1272#endif
@@ -1316,11 +1315,10 @@ static int udp_getsockopt(struct sock *sk, int level, int optname,
1316 1315
1317#ifdef CONFIG_COMPAT 1316#ifdef CONFIG_COMPAT
1318static int compat_udp_getsockopt(struct sock *sk, int level, int optname, 1317static int compat_udp_getsockopt(struct sock *sk, int level, int optname,
1319 char __user *optval, int __user *optlen) 1318 char __user *optval, int __user *optlen)
1320{ 1319{
1321 if (level != SOL_UDP) 1320 if (level != SOL_UDP)
1322 return compat_ip_getsockopt(sk, level, 1321 return compat_ip_getsockopt(sk, level, optname, optval, optlen);
1323 optname, optval, optlen);
1324 return do_udp_getsockopt(sk, level, optname, optval, optlen); 1322 return do_udp_getsockopt(sk, level, optname, optval, optlen);
1325} 1323}
1326#endif 1324#endif
@@ -1372,27 +1370,27 @@ unsigned int udp_poll(struct file *file, struct socket *sock, poll_table *wait)
1372} 1370}
1373 1371
1374struct proto udp_prot = { 1372struct proto udp_prot = {
1375 .name = "UDP", 1373 .name = "UDP",
1376 .owner = THIS_MODULE, 1374 .owner = THIS_MODULE,
1377 .close = udp_close, 1375 .close = udp_close,
1378 .connect = ip4_datagram_connect, 1376 .connect = ip4_datagram_connect,
1379 .disconnect = udp_disconnect, 1377 .disconnect = udp_disconnect,
1380 .ioctl = udp_ioctl, 1378 .ioctl = udp_ioctl,
1381 .destroy = udp_destroy_sock, 1379 .destroy = udp_destroy_sock,
1382 .setsockopt = udp_setsockopt, 1380 .setsockopt = udp_setsockopt,
1383 .getsockopt = udp_getsockopt, 1381 .getsockopt = udp_getsockopt,
1382 .sendmsg = udp_sendmsg,
1383 .recvmsg = udp_recvmsg,
1384 .sendpage = udp_sendpage,
1385 .backlog_rcv = udp_queue_rcv_skb,
1386 .hash = udp_v4_hash,
1387 .unhash = udp_v4_unhash,
1388 .get_port = udp_v4_get_port,
1389 .obj_size = sizeof(struct udp_sock),
1384#ifdef CONFIG_COMPAT 1390#ifdef CONFIG_COMPAT
1385 .compat_setsockopt = compat_udp_setsockopt, 1391 .compat_setsockopt = compat_udp_setsockopt,
1386 .compat_getsockopt = compat_udp_getsockopt, 1392 .compat_getsockopt = compat_udp_getsockopt,
1387#endif 1393#endif
1388 .sendmsg = udp_sendmsg,
1389 .recvmsg = udp_recvmsg,
1390 .sendpage = udp_sendpage,
1391 .backlog_rcv = udp_queue_rcv_skb,
1392 .hash = udp_v4_hash,
1393 .unhash = udp_v4_unhash,
1394 .get_port = udp_v4_get_port,
1395 .obj_size = sizeof(struct udp_sock),
1396}; 1394};
1397 1395
1398/* ------------------------------------------------------------------------ */ 1396/* ------------------------------------------------------------------------ */