All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Tuexen <Michael.Tuexen@lurchi.franken.de>
To: Vlad Yasevich <vyasevich@gmail.com>
Cc: David Laight <David.Laight@ACULAB.COM>,
	Geir Ola Vaagland <geirola@gmail.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-sctp@vger.kernel.org" <linux-sctp@vger.kernel.org>
Subject: Re: [PATCH net-next 0/6] A step closer to RFC 6458 compliancy
Date: Wed, 18 Jun 2014 15:29:34 +0200	[thread overview]
Message-ID: <B7899B51-FDA0-4189-8DBA-FDC193C1D6ED@lurchi.franken.de> (raw)
In-Reply-To: <53A19339.80908@gmail.com>


On 18 Jun 2014, at 15:25, Vlad Yasevich <vyasevich@gmail.com> wrote:

> On 06/18/2014 09:16 AM, David Laight wrote:
>> From: Michael Tuexen [ 
>>> On 18 Jun 2014, at 10:42, David Laight <David.Laight@ACULAB.COM> wrote:
>>> 
>>>> From: Vlad Yasevich
>>>>> On 06/17/2014 11:36 AM, David Laight wrote:
>>>>>> From: Of Geir Ola Vaagland
>>>>>>> These patches are part of my master thesis project. I have been searching for discrepancies
>>> between
>>>>>>> the socket API specificiation in RFC 6458 and the current Linux SCTP implementation. The
>>> following
>>>>>>> patches are my humble attempts at getting somewhat closer to compliancy.
>>>>>> 
>>>>>> I've just been reading RFC 6458 - HTF did it get past the editors and
>>>>>> then published in its current form?
>>>>>> Lots of the structures have implied padding.
>>>> ...
>>>>> I've argued the padding issue, but the editor stance is that it's implementation
>>>>> dependent.
>>>> 
>>>> It wouldn't be as bad if the RFC said that the structure contained the
>>>> fields that followed (as is typical of the posix definitions),
>>>> but instead it gives a definition of the structure.
>> 
>>> That would have been a possibility, but it was never suggested.
>>> As far as I know, C does not guarantee the memory layout for structs,
>>> except for the sequence of the components. So a compiler might add
>>> some padding at any place. When implementing this, you need to take
>>> care of this (and your job might be simpler, since you might only
>>> work with a specific set of compilers).
>>> In FreeBSD we also added some padding to some structures since they
>>> "evolved" during the lifetime of of the internet draft and we wanted
>>> to preserve some compatibility.
>>> I agree, that one must take care of the implied padding and I will double
>>> check how this is handled in FreeBSD. Not sure...
>> 
>> You need to add explicit named pad fields in order to zero them.
>> (since you don't really want a memset())
>> That is against my reading of the RFC.
>> 
>> What does FreeBSD do about the 'sockaddr_storage'?
>> I'd have thought it had the same rules as NetBSD - where (IIRC) it should never
>> be instantiated, but only exists as a pointer type for function parameters.
>> 
> 
> I don't remember any such rules when sockaddr_storage was defined.  Can you
> point to any document stating such rules?
> It is definitely useful as a container object at times.
I agree. The description would be OK for struct sockaddr. I have never instantiated
a variable of that type. The only use (I know of) of struct sockaddr_storage
is as a container object.

Best regards
Michael
> 
> -vlad
> 
> 

WARNING: multiple messages have this Message-ID (diff)
From: Michael Tuexen <Michael.Tuexen@lurchi.franken.de>
To: Vlad Yasevich <vyasevich@gmail.com>
Cc: David Laight <David.Laight@ACULAB.COM>,
	Geir Ola Vaagland <geirola@gmail.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-sctp@vger.kernel.org" <linux-sctp@vger.kernel.org>
Subject: Re: [PATCH net-next 0/6] A step closer to RFC 6458 compliancy
Date: Wed, 18 Jun 2014 13:29:34 +0000	[thread overview]
Message-ID: <B7899B51-FDA0-4189-8DBA-FDC193C1D6ED@lurchi.franken.de> (raw)
In-Reply-To: <53A19339.80908@gmail.com>


On 18 Jun 2014, at 15:25, Vlad Yasevich <vyasevich@gmail.com> wrote:

> On 06/18/2014 09:16 AM, David Laight wrote:
>> From: Michael Tuexen [ 
>>> On 18 Jun 2014, at 10:42, David Laight <David.Laight@ACULAB.COM> wrote:
>>> 
>>>> From: Vlad Yasevich
>>>>> On 06/17/2014 11:36 AM, David Laight wrote:
>>>>>> From: Of Geir Ola Vaagland
>>>>>>> These patches are part of my master thesis project. I have been searching for discrepancies
>>> between
>>>>>>> the socket API specificiation in RFC 6458 and the current Linux SCTP implementation. The
>>> following
>>>>>>> patches are my humble attempts at getting somewhat closer to compliancy.
>>>>>> 
>>>>>> I've just been reading RFC 6458 - HTF did it get past the editors and
>>>>>> then published in its current form?
>>>>>> Lots of the structures have implied padding.
>>>> ...
>>>>> I've argued the padding issue, but the editor stance is that it's implementation
>>>>> dependent.
>>>> 
>>>> It wouldn't be as bad if the RFC said that the structure contained the
>>>> fields that followed (as is typical of the posix definitions),
>>>> but instead it gives a definition of the structure.
>> 
>>> That would have been a possibility, but it was never suggested.
>>> As far as I know, C does not guarantee the memory layout for structs,
>>> except for the sequence of the components. So a compiler might add
>>> some padding at any place. When implementing this, you need to take
>>> care of this (and your job might be simpler, since you might only
>>> work with a specific set of compilers).
>>> In FreeBSD we also added some padding to some structures since they
>>> "evolved" during the lifetime of of the internet draft and we wanted
>>> to preserve some compatibility.
>>> I agree, that one must take care of the implied padding and I will double
>>> check how this is handled in FreeBSD. Not sure...
>> 
>> You need to add explicit named pad fields in order to zero them.
>> (since you don't really want a memset())
>> That is against my reading of the RFC.
>> 
>> What does FreeBSD do about the 'sockaddr_storage'?
>> I'd have thought it had the same rules as NetBSD - where (IIRC) it should never
>> be instantiated, but only exists as a pointer type for function parameters.
>> 
> 
> I don't remember any such rules when sockaddr_storage was defined.  Can you
> point to any document stating such rules?
> It is definitely useful as a container object at times.
I agree. The description would be OK for struct sockaddr. I have never instantiated
a variable of that type. The only use (I know of) of struct sockaddr_storage
is as a container object.

Best regards
Michael
> 
> -vlad
> 
> 


  reply	other threads:[~2014-06-18 13:29 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-17 15:01 [PATCH net-next 0/6] A step closer to RFC 6458 compliancy Geir Ola Vaagland
2014-06-17 15:01 ` Geir Ola Vaagland
2014-06-17 15:01 ` [PATCH net-next 1/6] Support for SCTP_RECVRCVINFO socket option Geir Ola Vaagland
2014-06-17 15:01   ` Geir Ola Vaagland
2014-06-18 23:30   ` David Miller
2014-06-18 23:30     ` David Miller
2014-06-17 15:01 ` [PATCH net-next 2/6] Support for SCTP_RCVINFO ancillary data Geir Ola Vaagland
2014-06-17 15:01   ` Geir Ola Vaagland
2014-06-18 23:30   ` David Miller
2014-06-18 23:30     ` David Miller
2014-06-17 15:01 ` [PATCH net-next 3/6] Support for SCTP_SNDINFO " Geir Ola Vaagland
2014-06-17 15:01   ` Geir Ola Vaagland
2014-06-17 15:01 ` [PATCH net-next 4/6] Support for SCTP_NXTINFO socket option Geir Ola Vaagland
2014-06-17 15:01   ` Geir Ola Vaagland
2014-06-17 15:01 ` [PATCH net-next 5/6] Support for receiving SCTP_NXTINFO ancillary data Geir Ola Vaagland
2014-06-17 15:01   ` Geir Ola Vaagland
2014-06-17 15:01 ` [PATCH net-next 6/6] Support for SCTP_DEFAULT_SNDINFO socket option Geir Ola Vaagland
2014-06-17 15:01   ` Geir Ola Vaagland
2014-06-18 23:33   ` David Miller
2014-06-18 23:33     ` David Miller
2014-06-17 15:14 ` [PATCH net-next 0/6] A step closer to RFC 6458 compliancy David Laight
2014-06-17 15:36 ` David Laight
2014-06-17 18:42   ` Vlad Yasevich
2014-06-17 18:42     ` Vlad Yasevich
2014-06-18  8:42     ` David Laight
2014-06-18 12:43       ` Michael Tuexen
2014-06-18 12:43         ` Michael Tuexen
2014-06-18 13:16         ` David Laight
2014-06-18 13:24           ` Michael Tuexen
2014-06-18 13:24             ` Michael Tuexen
2014-06-18 13:25           ` Vlad Yasevich
2014-06-18 13:25             ` Vlad Yasevich
2014-06-18 13:29             ` Michael Tuexen [this message]
2014-06-18 13:29               ` Michael Tuexen
2014-06-18 13:53               ` David Laight
  -- strict thread matches above, loose matches on Subject: below --
2014-06-17 11:57 Geir Ola Vaagland
2014-06-17 11:57 ` Geir Ola Vaagland
2014-06-17 11:57 ` [PATCH net-next 1/6] Support for SCTP_RECVRCVINFO socket option Geir Ola Vaagland
2014-06-17 11:57   ` Geir Ola Vaagland
2014-06-17 12:35   ` David Laight
2014-06-17 12:35     ` David Laight
2014-06-17 13:57   ` Vlad Yasevich
2014-06-17 13:57     ` Vlad Yasevich
2014-06-17 11:57 ` [PATCH net-next 2/6] Support for SCTP_RCVINFO ancillary data Geir Ola Vaagland
2014-06-17 11:57   ` Geir Ola Vaagland
2014-06-17 12:36   ` David Laight
2014-06-17 14:07   ` Vlad Yasevich
2014-06-17 14:07     ` Vlad Yasevich
2014-06-17 11:57 ` [PATCH net-next 3/6] Support for SCTP_SNDINFO " Geir Ola Vaagland
2014-06-17 11:57   ` Geir Ola Vaagland
2014-06-17 12:38   ` David Laight
2014-06-17 14:29     ` Vlad Yasevich
2014-06-17 14:29       ` Vlad Yasevich
2014-06-17 14:42       ` David Laight
2014-06-17 11:57 ` [PATCH net-next 4/6] Support for SCTP_NXTINFO socket option Geir Ola Vaagland
2014-06-17 11:57   ` Geir Ola Vaagland
2014-06-17 11:57 ` [PATCH net-next 5/6] Support for receiving SCTP_NXTINFO ancillary data Geir Ola Vaagland
2014-06-17 11:57   ` Geir Ola Vaagland
2014-06-17 11:57 ` [PATCH net-next 6/6] Support for SCTP_DEFAULT_SNDINFO socket option Geir Ola Vaagland
2014-06-17 11:57   ` Geir Ola Vaagland
2014-06-17 12:32 ` [PATCH net-next 0/6] A step closer to RFC 6458 compliancy David Laight
2014-06-17 13:40 ` Vlad Yasevich
2014-06-17 13:40   ` Vlad Yasevich

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=B7899B51-FDA0-4189-8DBA-FDC193C1D6ED@lurchi.franken.de \
    --to=michael.tuexen@lurchi.franken.de \
    --cc=David.Laight@ACULAB.COM \
    --cc=geirola@gmail.com \
    --cc=linux-sctp@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=vyasevich@gmail.com \
    /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 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.