Commit 7149bf75 authored by Mitchell Blank Jr's avatar Mitchell Blank Jr Committed by David S. Miller

[IPV4]: Do not use udp_poll for RAW sockets.

Signed-off-by: default avatarMitchell Blank Jr <mitch@sfgoth.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent dcd9a626
...@@ -821,6 +821,31 @@ struct proto_ops inet_dgram_ops = { ...@@ -821,6 +821,31 @@ struct proto_ops inet_dgram_ops = {
.sendpage = inet_sendpage, .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 = { static struct net_proto_family inet_family_ops = {
.family = PF_INET, .family = PF_INET,
.create = inet_create, .create = inet_create,
...@@ -861,7 +886,7 @@ static struct inet_protosw inetsw_array[] = ...@@ -861,7 +886,7 @@ static struct inet_protosw inetsw_array[] =
.type = SOCK_RAW, .type = SOCK_RAW,
.protocol = IPPROTO_IP, /* wild card */ .protocol = IPPROTO_IP, /* wild card */
.prot = &raw_prot, .prot = &raw_prot,
.ops = &inet_dgram_ops, .ops = &inet_sockraw_ops,
.capability = CAP_NET_RAW, .capability = CAP_NET_RAW,
.no_check = UDP_CSUM_DEFAULT, .no_check = UDP_CSUM_DEFAULT,
.flags = INET_PROTOSW_REUSE, .flags = INET_PROTOSW_REUSE,
......
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