From: Stephen Hemminger <shemminger@osdl.org>
To: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: netdev@vger.kernel.org
Subject: [PATCH 1/5] llc: allow datagram recvmsg
Date: Tue, 23 May 2006 17:04:15 -0700 [thread overview]
Message-ID: <20060524000529.852155000@localhost.localdomain> (raw)
In-Reply-To: 20060524000414.052569000@localhost.localdomain
[-- Attachment #1: llc-dgram-recv.patch --]
[-- Type: text/plain, Size: 884 bytes --]
LLC receive is broken for SOCK_DGRAM.
If an application does recv() on a datagram socket and there
is no data present, don't return "not connected". Instead, just
do normal datagram semantics.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
--- llc.orig/net/llc/af_llc.c
+++ llc/net/llc/af_llc.c
@@ -674,7 +674,7 @@ static int llc_ui_recvmsg(struct kiocb *
lock_sock(sk);
copied = -ENOTCONN;
- if (sk->sk_state == TCP_LISTEN)
+ if (unlikely(sk->sk_type == SOCK_STREAM && sk->sk_state == TCP_LISTEN))
goto out;
timeo = sock_rcvtimeo(sk, nonblock);
@@ -733,7 +733,7 @@ static int llc_ui_recvmsg(struct kiocb *
if (sk->sk_shutdown & RCV_SHUTDOWN)
break;
- if (sk->sk_state == TCP_CLOSE) {
+ if (sk->sk_type == SOCK_STREAM && sk->sk_state == TCP_CLOSE) {
if (!sock_flag(sk, SOCK_DONE)) {
/*
* This occurs when user tries to read
--
next prev parent reply other threads:[~2006-05-24 0:05 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-24 0:04 [PATCH 0/5] LLC SOCK_DGRAM enhancements Stephen Hemminger
2006-05-24 0:04 ` Stephen Hemminger [this message]
2006-05-24 0:04 ` [PATCH 2/5] llc: use rcu_dereference on receive handler Stephen Hemminger
2006-05-24 0:04 ` [PATCH 3/5] llc: allow applications to get copy of kernel datagrams Stephen Hemminger
2006-05-31 17:00 ` [PATCH 3/5] llc: allow applications to get copy of kernel datagrams (redo) Stephen Hemminger
2006-05-24 0:04 ` [PATCH 4/5] llc: use more efficient ether address routines Stephen Hemminger
2006-05-24 0:04 ` [PATCH 5/5] llc: add multicast support for datagrams Stephen Hemminger
2006-05-25 22:11 ` [PATCH 0/5] LLC SOCK_DGRAM enhancements David 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=20060524000529.852155000@localhost.localdomain \
--to=shemminger@osdl.org \
--cc=acme@ghostprotocols.net \
--cc=netdev@vger.kernel.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