Skip to content

Commit

Permalink
sctp: reorder sctp_ulpevent and shrink msg_flags
Browse files Browse the repository at this point in the history
The next patch needs 8 bytes in there. sctp_ulpevent has a hole due to
bad alignment; msg_flags is using 4 bytes while it actually uses only 2, so
we shrink it, and iif member (4 bytes) which can be easily fetched from
another place once the next patch is there, so we remove it and thus
creating space for 8 bytes.

Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Marcelo Ricardo Leitner authored and David S. Miller committed Jul 14, 2016
1 parent 9e23832 commit f5d258e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions include/net/sctp/ulpevent.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@
*/
struct sctp_ulpevent {
struct sctp_association *asoc;
__u16 stream;
__u16 ssn;
__u16 flags;
unsigned int rmem_len;
__u32 ppid;
__u32 tsn;
__u32 cumtsn;
int msg_flags;
int iif;
unsigned int rmem_len;
__u16 stream;
__u16 ssn;
__u16 flags;
__u16 msg_flags;
};

/* Retrieve the skb this event sits inside of. */
Expand Down
4 changes: 2 additions & 2 deletions net/sctp/ulpevent.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ static void sctp_ulpevent_release_frag_data(struct sctp_ulpevent *event);

/* Initialize an ULP event from an given skb. */
static void sctp_ulpevent_init(struct sctp_ulpevent *event,
int msg_flags,
__u16 msg_flags,
unsigned int len)
{
memset(event, 0, sizeof(struct sctp_ulpevent));
Expand All @@ -60,7 +60,7 @@ static void sctp_ulpevent_init(struct sctp_ulpevent *event,
}

/* Create a new sctp_ulpevent. */
static struct sctp_ulpevent *sctp_ulpevent_new(int size, int msg_flags,
static struct sctp_ulpevent *sctp_ulpevent_new(int size, __u16 msg_flags,
gfp_t gfp)
{
struct sctp_ulpevent *event;
Expand Down

0 comments on commit f5d258e

Please sign in to comment.