Skip to content

Commit f5d258e

Browse files
marceloleitnerdavem330
authored andcommitted
sctp: reorder sctp_ulpevent and shrink msg_flags
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 9e23832 commit f5d258e

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

include/net/sctp/ulpevent.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,15 @@
4848
*/
4949
struct sctp_ulpevent {
5050
struct sctp_association *asoc;
51-
__u16 stream;
52-
__u16 ssn;
53-
__u16 flags;
51+
unsigned int rmem_len;
5452
__u32 ppid;
5553
__u32 tsn;
5654
__u32 cumtsn;
57-
int msg_flags;
5855
int iif;
59-
unsigned int rmem_len;
56+
__u16 stream;
57+
__u16 ssn;
58+
__u16 flags;
59+
__u16 msg_flags;
6060
};
6161

6262
/* Retrieve the skb this event sits inside of. */

net/sctp/ulpevent.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ static void sctp_ulpevent_release_frag_data(struct sctp_ulpevent *event);
5151

5252
/* Initialize an ULP event from an given skb. */
5353
static void sctp_ulpevent_init(struct sctp_ulpevent *event,
54-
int msg_flags,
54+
__u16 msg_flags,
5555
unsigned int len)
5656
{
5757
memset(event, 0, sizeof(struct sctp_ulpevent));
@@ -60,7 +60,7 @@ static void sctp_ulpevent_init(struct sctp_ulpevent *event,
6060
}
6161

6262
/* Create a new sctp_ulpevent. */
63-
static struct sctp_ulpevent *sctp_ulpevent_new(int size, int msg_flags,
63+
static struct sctp_ulpevent *sctp_ulpevent_new(int size, __u16 msg_flags,
6464
gfp_t gfp)
6565
{
6666
struct sctp_ulpevent *event;

0 commit comments

Comments
 (0)