Re: [RFC PATCH v3] sctp: fix the sendmsg() flag SCTP_EOF to comply to spec

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Wei Yongjun wrote:
>   
>>> Wei Yongjun wrote:
>>>   
>>>       
>>> Interesting approach and I applaud for creativity, but it doesn't work if there is
>>> data loss.
>>>
>>> I see only one way out of this mess and that's to remove the SHUTDOWN_PENDING
>>> state and make that a modifier/flag that can be set on other states <= ESTABLISHED.
>>>   
>>>       
>> Do you mean we should support multi send() with EOF flag?
>>
>> send(msg, SCTP_EOF);
>> send(msg, SCTP_EOF);
>> ...
>>     
> As long as they are for different associations.  SCTP_EOF is a way to do
> shutdown() for 1-to-many sockets.  If the second send() is for the same
> association, it should fail.
>
> I just realized that this might actually work....  Autoclose timer isn't started
> until association is up, so that takes care of any INIT retransmissions.
> And the autoclose will do the right thing by entering SHUTDOWN_PENDING and
> retransmitting DATA as needed.
>
> The only thing still missing is something that prevents the above multiple send
> scenario.
>
> That's why I though that removing the SHUTDOWN_PENDING state and changing it into
> a bit/flag would work.  This way, sends would return failure because even though
> we may be in COOKIE_WAIT, if the SHUTDOWN_PENDING flag is set, further writes are
> disallowed.
>
> With this code, multiple writes with EOF for the same association will work,
> if the init process takes a long time (due to retransmissions or long rto).
>   

I got it, thank you very much.

Wei Yongjun

> -vlad
>
>   
>>     
>>> In other words, if the user has queued up data to the association, even if it is
>>> not established, we should exhaust all retransmits before failing.
>>>   
>>>       
>> shutdown after all the outdata is acked?
>>
>>     
>>> -vlad
>>>
>>>   
>>>       
>>>>  	/* If we are already past ASSOCIATE, the lower
>>>>  	 * layers are responsible for association cleanup.
>>>>  	 */
>>>>     
>>>>         
>>>   
>>>       
>>     
>
>   
--
To unsubscribe from this list: send the line "unsubscribe linux-sctp" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Networking Development]     [Linux OMAP]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux