* [PATCH net] sctp: report SCTP_ERROR_INV_STRM as cpu endian
@ 2017-11-17 6:15 Xin Long
2017-11-17 15:04 ` Marcelo Ricardo Leitner
0 siblings, 1 reply; 4+ messages in thread
From: Xin Long @ 2017-11-17 6:15 UTC (permalink / raw)
To: network dev, linux-sctp; +Cc: davem, Marcelo Ricardo Leitner, Neil Horman
rfc6458 demands the send_error in SCTP_SEND_FAILED_EVENT should
be in cpu endian, while SCTP_ERROR_INV_STRM is in big endian.
This issue is there since very beginning, Eric noticed it by
running 'make C=2 M=net/sctp/'.
This patch is to convert it before reporting it.
Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
---
net/sctp/stream.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/sctp/stream.c b/net/sctp/stream.c
index a11db21..f86ceee 100644
--- a/net/sctp/stream.c
+++ b/net/sctp/stream.c
@@ -64,7 +64,7 @@ static void sctp_stream_outq_migrate(struct sctp_stream *stream,
*/
/* Mark as failed send. */
- sctp_chunk_fail(ch, SCTP_ERROR_INV_STRM);
+ sctp_chunk_fail(ch, be16_to_cpu(SCTP_ERROR_INV_STRM));
if (asoc->peer.prsctp_capable &&
SCTP_PR_PRIO_ENABLED(ch->sinfo.sinfo_flags))
asoc->sent_cnt_removable--;
--
2.1.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net] sctp: report SCTP_ERROR_INV_STRM as cpu endian
2017-11-17 6:15 [PATCH net] sctp: report SCTP_ERROR_INV_STRM as cpu endian Xin Long
@ 2017-11-17 15:04 ` Marcelo Ricardo Leitner
2017-11-18 18:20 ` Xin Long
0 siblings, 1 reply; 4+ messages in thread
From: Marcelo Ricardo Leitner @ 2017-11-17 15:04 UTC (permalink / raw)
To: Xin Long; +Cc: network dev, linux-sctp, davem, Neil Horman
On Fri, Nov 17, 2017 at 02:15:02PM +0800, Xin Long wrote:
> rfc6458 demands the send_error in SCTP_SEND_FAILED_EVENT should
> be in cpu endian, while SCTP_ERROR_INV_STRM is in big endian.
>
> This issue is there since very beginning, Eric noticed it by
> running 'make C=2 M=net/sctp/'.
>
> This patch is to convert it before reporting it.
Unfortunatelly we can't fix this as this will break UAPI. It will
break applications that are currently matching on the current value.
>
> Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
> Signed-off-by: Xin Long <lucien.xin@gmail.com>
> ---
> net/sctp/stream.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/sctp/stream.c b/net/sctp/stream.c
> index a11db21..f86ceee 100644
> --- a/net/sctp/stream.c
> +++ b/net/sctp/stream.c
> @@ -64,7 +64,7 @@ static void sctp_stream_outq_migrate(struct sctp_stream *stream,
> */
>
> /* Mark as failed send. */
> - sctp_chunk_fail(ch, SCTP_ERROR_INV_STRM);
> + sctp_chunk_fail(ch, be16_to_cpu(SCTP_ERROR_INV_STRM));
> if (asoc->peer.prsctp_capable &&
> SCTP_PR_PRIO_ENABLED(ch->sinfo.sinfo_flags))
> asoc->sent_cnt_removable--;
> --
> 2.1.0
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net] sctp: report SCTP_ERROR_INV_STRM as cpu endian
2017-11-17 15:04 ` Marcelo Ricardo Leitner
@ 2017-11-18 18:20 ` Xin Long
2017-11-20 12:29 ` Marcelo Ricardo Leitner
0 siblings, 1 reply; 4+ messages in thread
From: Xin Long @ 2017-11-18 18:20 UTC (permalink / raw)
To: Marcelo Ricardo Leitner; +Cc: network dev, linux-sctp, davem, Neil Horman
On Fri, Nov 17, 2017 at 11:04 PM, Marcelo Ricardo Leitner
<marcelo.leitner@gmail.com> wrote:
> On Fri, Nov 17, 2017 at 02:15:02PM +0800, Xin Long wrote:
>> rfc6458 demands the send_error in SCTP_SEND_FAILED_EVENT should
>> be in cpu endian, while SCTP_ERROR_INV_STRM is in big endian.
>>
>> This issue is there since very beginning, Eric noticed it by
>> running 'make C=2 M=net/sctp/'.
>>
>> This patch is to convert it before reporting it.
>
> Unfortunatelly we can't fix this as this will break UAPI. It will
> break applications that are currently matching on the current value.
yes, you're right, seems all other send_errors also come in big endian now.
what do you think of using:
sctp_chunk_fail(ch, (__force __u16)SCTP_ERROR_INV_STRM); or
sctp_chunk_fail(ch, (__force __u32)SCTP_ERROR_INV_STRM);
to avoid this warning ?
>
>>
>> Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
>> Signed-off-by: Xin Long <lucien.xin@gmail.com>
>> ---
>> net/sctp/stream.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/net/sctp/stream.c b/net/sctp/stream.c
>> index a11db21..f86ceee 100644
>> --- a/net/sctp/stream.c
>> +++ b/net/sctp/stream.c
>> @@ -64,7 +64,7 @@ static void sctp_stream_outq_migrate(struct sctp_stream *stream,
>> */
>>
>> /* Mark as failed send. */
>> - sctp_chunk_fail(ch, SCTP_ERROR_INV_STRM);
>> + sctp_chunk_fail(ch, be16_to_cpu(SCTP_ERROR_INV_STRM));
>> if (asoc->peer.prsctp_capable &&
>> SCTP_PR_PRIO_ENABLED(ch->sinfo.sinfo_flags))
>> asoc->sent_cnt_removable--;
>> --
>> 2.1.0
>>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net] sctp: report SCTP_ERROR_INV_STRM as cpu endian
2017-11-18 18:20 ` Xin Long
@ 2017-11-20 12:29 ` Marcelo Ricardo Leitner
0 siblings, 0 replies; 4+ messages in thread
From: Marcelo Ricardo Leitner @ 2017-11-20 12:29 UTC (permalink / raw)
To: Xin Long; +Cc: network dev, linux-sctp, davem, Neil Horman
On Sun, Nov 19, 2017 at 02:20:04AM +0800, Xin Long wrote:
> On Fri, Nov 17, 2017 at 11:04 PM, Marcelo Ricardo Leitner
> <marcelo.leitner@gmail.com> wrote:
> > On Fri, Nov 17, 2017 at 02:15:02PM +0800, Xin Long wrote:
> >> rfc6458 demands the send_error in SCTP_SEND_FAILED_EVENT should
> >> be in cpu endian, while SCTP_ERROR_INV_STRM is in big endian.
> >>
> >> This issue is there since very beginning, Eric noticed it by
> >> running 'make C=2 M=net/sctp/'.
> >>
> >> This patch is to convert it before reporting it.
> >
> > Unfortunatelly we can't fix this as this will break UAPI. It will
> > break applications that are currently matching on the current value.
> yes, you're right, seems all other send_errors also come in big endian now.
>
> what do you think of using:
> sctp_chunk_fail(ch, (__force __u16)SCTP_ERROR_INV_STRM); or
>
> sctp_chunk_fail(ch, (__force __u32)SCTP_ERROR_INV_STRM);
>
> to avoid this warning ?
It's good. The last one is more interesting as it matches function
prototype already.
Marcelo
>
> >
> >>
> >> Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
> >> Signed-off-by: Xin Long <lucien.xin@gmail.com>
> >> ---
> >> net/sctp/stream.c | 2 +-
> >> 1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/net/sctp/stream.c b/net/sctp/stream.c
> >> index a11db21..f86ceee 100644
> >> --- a/net/sctp/stream.c
> >> +++ b/net/sctp/stream.c
> >> @@ -64,7 +64,7 @@ static void sctp_stream_outq_migrate(struct sctp_stream *stream,
> >> */
> >>
> >> /* Mark as failed send. */
> >> - sctp_chunk_fail(ch, SCTP_ERROR_INV_STRM);
> >> + sctp_chunk_fail(ch, be16_to_cpu(SCTP_ERROR_INV_STRM));
> >> if (asoc->peer.prsctp_capable &&
> >> SCTP_PR_PRIO_ENABLED(ch->sinfo.sinfo_flags))
> >> asoc->sent_cnt_removable--;
> >> --
> >> 2.1.0
> >>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-11-20 12:29 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-17 6:15 [PATCH net] sctp: report SCTP_ERROR_INV_STRM as cpu endian Xin Long
2017-11-17 15:04 ` Marcelo Ricardo Leitner
2017-11-18 18:20 ` Xin Long
2017-11-20 12:29 ` Marcelo Ricardo Leitner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).