summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitchell Blank Jr. <mitch@sfgoth.com>2004-12-07 05:03:48 -0800
committerDavid S. Miller <davem@nuts.davemloft.net>2004-12-07 05:03:48 -0800
commit7149bf75cc34dbcdbffd559688f7b97ab9685826 (patch)
tree1fd144d9931ace472cfe77164b95c764eb138015
parentdcd9a62643335bdf300ebd6ade333f3c8b882e77 (diff)
[IPV4]: Do not use udp_poll for RAW sockets.
Signed-off-by: Mitchell Blank Jr <mitch@sfgoth.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/ipv4/af_inet.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index d127c16746bf..56872058ebce 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -821,6 +821,31 @@ struct proto_ops inet_dgram_ops = {
.sendpage = inet_sendpage,
};
+/*
+ * For SOCK_RAW sockets; should be the same as inet_dgram_ops but without
+ * udp_poll
+ */
+static struct proto_ops inet_sockraw_ops = {
+ .family = PF_INET,
+ .owner = THIS_MODULE,
+ .release = inet_release,
+ .bind = inet_bind,
+ .connect = inet_dgram_connect,
+ .socketpair = sock_no_socketpair,
+ .accept = sock_no_accept,
+ .getname = inet_getname,
+ .poll = datagram_poll,
+ .ioctl = inet_ioctl,
+ .listen = sock_no_listen,
+ .shutdown = inet_shutdown,
+ .setsockopt = sock_common_setsockopt,
+ .getsockopt = sock_common_getsockopt,
+ .sendmsg = inet_sendmsg,
+ .recvmsg = sock_common_recvmsg,
+ .mmap = sock_no_mmap,
+ .sendpage = inet_sendpage,
+};
+
static struct net_proto_family inet_family_ops = {
.family = PF_INET,
.create = inet_create,
@@ -861,7 +886,7 @@ static struct inet_protosw inetsw_array[] =
.type = SOCK_RAW,
.protocol = IPPROTO_IP, /* wild card */
.prot = &raw_prot,
- .ops = &inet_dgram_ops,
+ .ops = &inet_sockraw_ops,
.capability = CAP_NET_RAW,
.no_check = UDP_CSUM_DEFAULT,
.flags = INET_PROTOSW_REUSE,