netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mitchell Blank Jr <mitch@sfgoth.com>
To: Phil Oester <kernel@linuxace.com>,
	"David S. Miller" <davem@davemloft.net>,
	shemminger@osdl.org
Cc: linux-net@vger.kernel.org, linux-kernel@vger.kernel.org,
	netdev@oss.sgi.com
Subject: [PATCH] fix select() for SOCK_RAW sockets
Date: Tue, 7 Dec 2004 07:08:34 -0800	[thread overview]
Message-ID: <20041207150834.GA75700@gaz.sfgoth.com> (raw)
In-Reply-To: <20041207054840.GD61527@gaz.sfgoth.com>

Phil: Here's a real patch for you to test.  I actually left inet_dgram_ops
alone since it's an exported symbol (two of the users just want the .do_ioctl
value which is the same between SOCK_DGRAM and SOCK_RAW; the other is ipv6
where it's clearly dealing with a UDP socket -- therefore I think its safest
to leave inet_dgram_ops to have the UDP behavior)

Davem: I only tested that this doesn't break UDP; if it works for Phil and
Stephen can verify that it doesn't break his bad-checksum UDP tests then
please push it for 2.6.10.

Patch is versus 2.6.10-rc3.

Signed-off-by: Mitchell Blank Jr <mitch@sfgoth.com>

-Mitch
--- linux-2.6.10-rc3-VIRGIN/net/ipv4/af_inet.c	2004-12-07 06:37:52.480082706 -0800
+++ linux-2.6.10-rc3/net/ipv4/af_inet.c	2004-12-07 06:57:47.799013216 -0800
@@ -821,6 +821,31 @@
 	.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 @@
                .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,

  reply	other threads:[~2004-12-07 15:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20041207003525.GA22933@linuxace.com>
     [not found] ` <20041207025218.GB61527@gaz.sfgoth.com>
     [not found]   ` <20041207045302.GA23746@linuxace.com>
2004-12-07  5:48     ` Recent select() handling change breaks Poptop Mitchell Blank Jr
2004-12-07 15:08       ` Mitchell Blank Jr [this message]
2004-12-07 17:28         ` [PATCH] fix select() for SOCK_RAW sockets Phil Oester
2004-12-07 17:35         ` YOSHIFUJI Hideaki / 吉藤英明
2004-12-07 18:01           ` [PATCH] fix select() for SOCK_RAW sockets (ipv6) Stephen Hemminger
2004-12-07 18:48             ` David S. Miller
2004-12-07 18:56               ` Stephen Hemminger
2004-12-08  7:58               ` YOSHIFUJI Hideaki / 吉藤英明
2004-12-07 17:45         ` [PATCH] fix select() for SOCK_RAW sockets Stephen Hemminger
2004-12-08  5:28         ` David S. Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041207150834.GA75700@gaz.sfgoth.com \
    --to=mitch@sfgoth.com \
    --cc=davem@davemloft.net \
    --cc=kernel@linuxace.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-net@vger.kernel.org \
    --cc=netdev@oss.sgi.com \
    --cc=shemminger@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).