sctp: move SCTP_PAD4 and SCTP_TRUNC4 to linux/sctp.h

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2189292
Tested: compile only

commit 647541ea06a7bbbcf941e501c726b3e26328c102
Author: Xin Long <lucien.xin@gmail.com>
Date:   Tue Nov 15 10:40:21 2022 -0500

    sctp: move SCTP_PAD4 and SCTP_TRUNC4 to linux/sctp.h

    Move these two macros from net/sctp/sctp.h to linux/sctp.h, so that
    it will be enough to include only linux/sctp.h in nft_exthdr.c and
    xt_sctp.c. It should not include "net/sctp/sctp.h" if a module does
    not have a dependence on SCTP module.

    Signed-off-by: Xin Long <lucien.xin@gmail.com>
    Reviewed-by: Saeed Mahameed <saeed@kernel.org>
    Link: https://lore.kernel.org/r/ef6468a687f36da06f575c2131cd4612f6b7be88.1668526821.git.lucien.xin@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Xin Long <lxin@redhat.com>
This commit is contained in:
Xin Long 2023-04-24 18:40:09 -04:00
parent 2889972cba
commit fc20e63081
4 changed files with 5 additions and 7 deletions

View File

@ -820,4 +820,9 @@ struct sctp_new_encap_port_hdr {
__be16 new_port;
};
/* Round an int up to the next multiple of 4. */
#define SCTP_PAD4(s) (((s)+3)&~3)
/* Truncate to the previous multiple of 4. */
#define SCTP_TRUNC4(s) ((s)&~3)
#endif /* __LINUX_SCTP_H__ */

View File

@ -67,11 +67,6 @@
#define SCTP_PROTOSW_FLAG INET_PROTOSW_PERMANENT
#endif
/* Round an int up to the next multiple of 4. */
#define SCTP_PAD4(s) (((s)+3)&~3)
/* Truncate to the previous multiple of 4. */
#define SCTP_TRUNC4(s) ((s)&~3)
/*
* Function declarations.
*/

View File

@ -13,7 +13,6 @@
#include <linux/sctp.h>
#include <net/netfilter/nf_tables_core.h>
#include <net/netfilter/nf_tables.h>
#include <net/sctp/sctp.h>
#include <net/tcp.h>
struct nft_exthdr {

View File

@ -4,7 +4,6 @@
#include <linux/skbuff.h>
#include <net/ip.h>
#include <net/ipv6.h>
#include <net/sctp/sctp.h>
#include <linux/sctp.h>
#include <linux/netfilter/x_tables.h>