Skip to content

Commit

Permalink
netfilter: use macros to create module aliases.
Browse files Browse the repository at this point in the history
Each NAT helper creates a module alias which follows a pattern.
Use macros for consistency.

Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
  • Loading branch information
Flavio Leitner authored and Pablo Neira Ayuso committed Apr 30, 2019
1 parent 8f14c99 commit e1f172e
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 7 deletions.
4 changes: 4 additions & 0 deletions include/net/netfilter/nf_conntrack_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
#include <net/netfilter/nf_conntrack_extend.h>
#include <net/netfilter/nf_conntrack_expect.h>

#define NF_NAT_HELPER_NAME(name) "ip_nat_" name
#define MODULE_ALIAS_NF_NAT_HELPER(name) \
MODULE_ALIAS(NF_NAT_HELPER_NAME(name))

struct module;

enum nf_ct_helper_flags {
Expand Down
2 changes: 1 addition & 1 deletion net/ipv4/netfilter/nf_nat_h323.c
Original file line number Diff line number Diff line change
Expand Up @@ -631,4 +631,4 @@ module_exit(fini);
MODULE_AUTHOR("Jing Min Zhao <zhaojingmin@users.sourceforge.net>");
MODULE_DESCRIPTION("H.323 NAT helper");
MODULE_LICENSE("GPL");
MODULE_ALIAS("ip_nat_h323");
MODULE_ALIAS_NF_NAT_HELPER("h323");
2 changes: 1 addition & 1 deletion net/ipv4/netfilter/nf_nat_pptp.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Harald Welte <laforge@gnumonks.org>");
MODULE_DESCRIPTION("Netfilter NAT helper module for PPTP");
MODULE_ALIAS("ip_nat_pptp");
MODULE_ALIAS_NF_NAT_HELPER("pptp");

static void pptp_nat_expected(struct nf_conn *ct,
struct nf_conntrack_expect *exp)
Expand Down
2 changes: 1 addition & 1 deletion net/netfilter/nf_nat_amanda.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
MODULE_AUTHOR("Brian J. Murrell <netfilter@interlinx.bc.ca>");
MODULE_DESCRIPTION("Amanda NAT helper");
MODULE_LICENSE("GPL");
MODULE_ALIAS("ip_nat_amanda");
MODULE_ALIAS_NF_NAT_HELPER("amanda");

static unsigned int help(struct sk_buff *skb,
enum ip_conntrack_info ctinfo,
Expand Down
2 changes: 1 addition & 1 deletion net/netfilter/nf_nat_ftp.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Rusty Russell <rusty@rustcorp.com.au>");
MODULE_DESCRIPTION("ftp NAT helper");
MODULE_ALIAS("ip_nat_ftp");
MODULE_ALIAS_NF_NAT_HELPER("ftp");

/* FIXME: Time out? --RR */

Expand Down
2 changes: 1 addition & 1 deletion net/netfilter/nf_nat_irc.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
MODULE_AUTHOR("Harald Welte <laforge@gnumonks.org>");
MODULE_DESCRIPTION("IRC (DCC) NAT helper");
MODULE_LICENSE("GPL");
MODULE_ALIAS("ip_nat_irc");
MODULE_ALIAS_NF_NAT_HELPER("irc");

static unsigned int help(struct sk_buff *skb,
enum ip_conntrack_info ctinfo,
Expand Down
2 changes: 1 addition & 1 deletion net/netfilter/nf_nat_sip.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Christian Hentschel <chentschel@arnet.com.ar>");
MODULE_DESCRIPTION("SIP NAT helper");
MODULE_ALIAS("ip_nat_sip");
MODULE_ALIAS_NF_NAT_HELPER("sip");


static unsigned int mangle_packet(struct sk_buff *skb, unsigned int protoff,
Expand Down
2 changes: 1 addition & 1 deletion net/netfilter/nf_nat_tftp.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
MODULE_AUTHOR("Magnus Boden <mb@ozaba.mine.nu>");
MODULE_DESCRIPTION("TFTP NAT helper");
MODULE_LICENSE("GPL");
MODULE_ALIAS("ip_nat_tftp");
MODULE_ALIAS_NF_NAT_HELPER("tftp");

static unsigned int help(struct sk_buff *skb,
enum ip_conntrack_info ctinfo,
Expand Down

0 comments on commit e1f172e

Please sign in to comment.