Skip to content

Commit 9e23832

Browse files
marceloleitnerdavem330
authored andcommitted
sctp: allow others to use sctp_input_cb
We process input path in other files too and having access to it is nice, so move it to a header where it's shared. Signed-off-by: Marcelo Ricardo Leitner <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent ce3a380 commit 9e23832

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

include/net/sctp/structs.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
#include <linux/workqueue.h> /* We need tq_struct. */
6060
#include <linux/sctp.h> /* We need sctp* header structs. */
6161
#include <net/sctp/auth.h> /* We need auth specific structs */
62+
#include <net/ip.h> /* For inet_skb_parm */
6263

6364
/* A convenience structure for handling sockaddr structures.
6465
* We should wean ourselves off this.
@@ -1092,6 +1093,20 @@ static inline void sctp_outq_cork(struct sctp_outq *q)
10921093
q->cork = 1;
10931094
}
10941095

1096+
/* SCTP skb control block.
1097+
* sctp_input_cb is currently used on rx and sock rx queue
1098+
*/
1099+
struct sctp_input_cb {
1100+
union {
1101+
struct inet_skb_parm h4;
1102+
#if IS_ENABLED(CONFIG_IPV6)
1103+
struct inet6_skb_parm h6;
1104+
#endif
1105+
} header;
1106+
struct sctp_chunk *chunk;
1107+
};
1108+
#define SCTP_INPUT_CB(__skb) ((struct sctp_input_cb *)&((__skb)->cb[0]))
1109+
10951110
/* These bind address data fields common between endpoints and associations */
10961111
struct sctp_bind_addr {
10971112

net/sctp/input.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -90,17 +90,6 @@ static inline int sctp_rcv_checksum(struct net *net, struct sk_buff *skb)
9090
return 0;
9191
}
9292

93-
struct sctp_input_cb {
94-
union {
95-
struct inet_skb_parm h4;
96-
#if IS_ENABLED(CONFIG_IPV6)
97-
struct inet6_skb_parm h6;
98-
#endif
99-
} header;
100-
struct sctp_chunk *chunk;
101-
};
102-
#define SCTP_INPUT_CB(__skb) ((struct sctp_input_cb *)&((__skb)->cb[0]))
103-
10493
/*
10594
* This is the routine which IP calls when receiving an SCTP packet.
10695
*/

0 commit comments

Comments
 (0)