public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Sabrina Dubroca <sd@queasysnail.net>
To: acme@ghostprotocols.net
Cc: davem@davemloft.net, netdev@vger.kernel.org, 00cpxxx@gmail.com
Subject: Re: [PATCH] ipx: implement shutdown()
Date: Sun, 9 Feb 2014 00:17:43 +0100	[thread overview]
Message-ID: <20140208231743.GB12704@kria> (raw)
In-Reply-To: <1391900669-880-1-git-send-email-sd@queasysnail.net>

2014-02-09, 00:04:29 +0100, Sabrina Dubroca wrote:
> +static int ipx_shutdown(struct socket *sock, int mode)
> +{
> +	struct sock *sk = sock->sk;
> +
> +	printk(KERN_INFO "IPX: shutting down %d\n", mode);
> +	if (mode < SHUT_RD || mode > SHUT_RDWR)
> +		return -EINVAL;
> +	/* This maps:
> +	 * SHUT_RD   (0) -> RCV_SHUTDOWN  (1)
> +	 * SHUT_WR   (1) -> SEND_SHUTDOWN (2)
> +	 * SHUT_RDWR (2) -> SHUTDOWN_MASK (3)
> +	 */
> +	++mode;
> +
> +	lock_sock(sk);
> +	sk->sk_shutdown |= mode;
> +	release_sock(sk);
> +	sk->sk_state_change(sk);
> +	printk(KERN_INFO "IPX: socket shut down\n");
> +
> +	return 0;
> +}

Sorry, I sent the version with the debugging in. I'll resend a clean one.

-- 
Sabrina

      reply	other threads:[~2014-02-08 23:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-08 23:04 [PATCH] ipx: implement shutdown() Sabrina Dubroca
2014-02-08 23:17 ` Sabrina Dubroca [this message]

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=20140208231743.GB12704@kria \
    --to=sd@queasysnail.net \
    --cc=00cpxxx@gmail.com \
    --cc=acme@ghostprotocols.net \
    --cc=davem@davemloft.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