From e2be9e1571ac4c485c2b74d8da92721005c57586 Mon Sep 17 00:00:00 2001 From: Thomas Bernard Date: Tue, 14 Nov 2023 23:56:16 +0100 Subject: [PATCH] add comments to rule_set_filter6() and rule_set_filter_common() --- miniupnpd/netfilter_nft/nftnlrdr_misc.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/miniupnpd/netfilter_nft/nftnlrdr_misc.c b/miniupnpd/netfilter_nft/nftnlrdr_misc.c index fc18e40..98a287a 100644 --- a/miniupnpd/netfilter_nft/nftnlrdr_misc.c +++ b/miniupnpd/netfilter_nft/nftnlrdr_misc.c @@ -1068,6 +1068,13 @@ rule_set_filter(uint8_t family, const char * ifname, uint8_t proto, return r; } +/* + * Create the IP6 filter rule + * called by add_pinhole() and update_pinhole() + * eport is always 0 + * iport is the destination port of the filter rule + * rport is the (optional) source port of the rule + */ struct nftnl_rule * rule_set_filter6(uint8_t family, const char * ifname, uint8_t proto, struct in6_addr *rhost6, struct in6_addr *iaddr6, @@ -1108,6 +1115,12 @@ rule_set_filter6(uint8_t family, const char * ifname, uint8_t proto, return r; } +/* + * Create common parts for the filter rules (IPv4 or IPv6) + * eport is ignored + * iport is the destination port of the filter rule + * rport is the (optional) source port of the rule + */ struct nftnl_rule * rule_set_filter_common(struct nftnl_rule *r, uint8_t family, const char * ifname, uint8_t proto, unsigned short eport, unsigned short iport,