On 10/29/19 1:37 AM, Jon Maloy wrote:
> @@ -3007,6 +3068,9 @@ static int tipc_setsockopt(struct socket *sock, int 
> lvl, int opt,
>       case TIPC_GROUP_LEAVE:
>               res = tipc_sk_leave(tsk);
>               break;
> +     case TIPC_NODELAY:
> +             tsk->nodelay = true;
> +             break;
>       default:
>               res = -EINVAL;
>       }

Once user sets tsk->nodelay to true, there is no chance to set it back
to false. Although this scenario rarely happens for us, it's better that
we can provide the function.

For example, below is how TCP supports TCP_NODELAY option:

        case TCP_NODELAY:
                if (val) {
                        /* TCP_NODELAY is weaker than TCP_CORK, so that
                         * this option on corked socket is remembered, but
                         * it is not activated until cork is cleared.
                         *
                         * However, when TCP_NODELAY is set we make
                         * an explicit push, which overrides even TCP_CORK
                         * for currently queued segments.
                         */
                        tp->nonagle |= TCP_NAGLE_OFF|TCP_NAGLE_PUSH;
                        tcp_push_pending_frames(sk);
                } else {
                        tp->nonagle &= ~TCP_NAGLE_OFF;
                }
                break;


_______________________________________________
tipc-discussion mailing list
tipc-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tipc-discussion

Reply via email to