summaryrefslogtreecommitdiff
path: root/net/sctp/chunk.c
diff options
context:
space:
mode:
authorThomas Graf <tgraf@infradead.org>2012-04-03 22:17:53 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-04-27 09:51:18 -0700
commit3109ea06da8538ee3ded3489b26065a3be32f360 (patch)
treedd6bb6d0624a0c9c93e43980ab6e9077137941f9 /net/sctp/chunk.c
parent8d2228dd95c656e5fc9af2e8776f9c95e269806f (diff)
downloadlwn-3109ea06da8538ee3ded3489b26065a3be32f360.tar.gz
lwn-3109ea06da8538ee3ded3489b26065a3be32f360.zip
sctp: Allow struct sctp_event_subscribe to grow without breaking binaries
[ Upstream commit acdd5985364f8dc511a0762fab2e683f29d9d692 ] getsockopt(..., SCTP_EVENTS, ...) performs a length check and returns an error if the user provides less bytes than the size of struct sctp_event_subscribe. Struct sctp_event_subscribe needs to be extended by an u8 for every new event or notification type that is added. This obviously makes getsockopt fail for binaries that are compiled against an older versions of <net/sctp/user.h> which do not contain all event types. This patch changes getsockopt behaviour to no longer return an error if not enough bytes are being provided by the user. Instead, it returns as much of sctp_event_subscribe as fits into the provided buffer. This leads to the new behavior that users see what they have been aware of at compile time. The setsockopt(..., SCTP_EVENTS, ...) API is already behaving like this. Signed-off-by: Thomas Graf <tgraf@suug.ch> Acked-by: Vlad Yasevich <vladislav.yasevich@hp.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/sctp/chunk.c')
0 files changed, 0 insertions, 0 deletions