* [MPTCP] Re: [RFC 6/7] add mptcp_subflow_shutdown
@ 2019-11-25 12:23 Florian Westphal
0 siblings, 0 replies; 3+ messages in thread
From: Florian Westphal @ 2019-11-25 12:23 UTC (permalink / raw)
To: mptcp
[-- Attachment #1: Type: text/plain, Size: 998 bytes --]
Paolo Abeni <pabeni(a)redhat.com> wrote:
> On Mon, 2019-11-25 at 03:15 +0100, Florian Westphal wrote:
> > +static void mptcp_subflow_shutdown(struct sock *ssk, int how)
> > +{
> > + lock_sock(ssk);
> > +
> > + switch (ssk->sk_state) {
> > + case TCP_LISTEN:
> > + if (!(how & RCV_SHUTDOWN))
> > + break;
> > + /* fall through */
> > + case TCP_SYN_SENT:
> > + tcp_disconnect(ssk, O_NONBLOCK);
> > + break;
> > + default:
> > + ssk->sk_shutdown |= how;
> > + tcp_shutdown(ssk, how);
> > + break;
> > + }
> > +
> > + /* Wake up anyone sleeping in poll. */
> > + ssk->sk_state_change(ssk);
> > + release_sock(ssk);
> > +}
>
> I think we can move this one can be moved to subflow.c.
>
> Yep, it will lose the 'static' scope, but protocol.c is becoming quite
> big...
Yes, but its still small compared to e.g. tcp_input.c.
> WDYT?
I like static scope. For every visible symbol one needs to check where
else it might be used before making changes to it...
^ permalink raw reply [flat|nested] 3+ messages in thread* [MPTCP] Re: [RFC 6/7] add mptcp_subflow_shutdown
@ 2019-11-25 14:58 Paolo Abeni
0 siblings, 0 replies; 3+ messages in thread
From: Paolo Abeni @ 2019-11-25 14:58 UTC (permalink / raw)
To: mptcp
[-- Attachment #1: Type: text/plain, Size: 1186 bytes --]
On Mon, 2019-11-25 at 13:23 +0100, Florian Westphal wrote:
> Paolo Abeni <pabeni(a)redhat.com> wrote:
> > On Mon, 2019-11-25 at 03:15 +0100, Florian Westphal wrote:
> > > +static void mptcp_subflow_shutdown(struct sock *ssk, int how)
> > > +{
> > > + lock_sock(ssk);
> > > +
> > > + switch (ssk->sk_state) {
> > > + case TCP_LISTEN:
> > > + if (!(how & RCV_SHUTDOWN))
> > > + break;
> > > + /* fall through */
> > > + case TCP_SYN_SENT:
> > > + tcp_disconnect(ssk, O_NONBLOCK);
> > > + break;
> > > + default:
> > > + ssk->sk_shutdown |= how;
> > > + tcp_shutdown(ssk, how);
> > > + break;
> > > + }
> > > +
> > > + /* Wake up anyone sleeping in poll. */
> > > + ssk->sk_state_change(ssk);
> > > + release_sock(ssk);
> > > +}
> >
> > I think we can move this one can be moved to subflow.c.
> >
> > Yep, it will lose the 'static' scope, but protocol.c is becoming quite
> > big...
>
> Yes, but its still small compared to e.g. tcp_input.c.
>
> > WDYT?
>
> I like static scope. For every visible symbol one needs to check where
> else it might be used before making changes to it...
Oks, no objections on my side.
Cheers,
Paolo
^ permalink raw reply [flat|nested] 3+ messages in thread* [MPTCP] Re: [RFC 6/7] add mptcp_subflow_shutdown
@ 2019-11-25 12:09 Paolo Abeni
0 siblings, 0 replies; 3+ messages in thread
From: Paolo Abeni @ 2019-11-25 12:09 UTC (permalink / raw)
To: mptcp
[-- Attachment #1: Type: text/plain, Size: 734 bytes --]
On Mon, 2019-11-25 at 03:15 +0100, Florian Westphal wrote:
> +static void mptcp_subflow_shutdown(struct sock *ssk, int how)
> +{
> + lock_sock(ssk);
> +
> + switch (ssk->sk_state) {
> + case TCP_LISTEN:
> + if (!(how & RCV_SHUTDOWN))
> + break;
> + /* fall through */
> + case TCP_SYN_SENT:
> + tcp_disconnect(ssk, O_NONBLOCK);
> + break;
> + default:
> + ssk->sk_shutdown |= how;
> + tcp_shutdown(ssk, how);
> + break;
> + }
> +
> + /* Wake up anyone sleeping in poll. */
> + ssk->sk_state_change(ssk);
> + release_sock(ssk);
> +}
I think we can move this one can be moved to subflow.c.
Yep, it will lose the 'static' scope, but protocol.c is becoming quite
big...
WDYT?
Thanks,
Paolo
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-11-25 14:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-25 12:23 [MPTCP] Re: [RFC 6/7] add mptcp_subflow_shutdown Florian Westphal
-- strict thread matches above, loose matches on Subject: below --
2019-11-25 14:58 Paolo Abeni
2019-11-25 12:09 Paolo Abeni
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.