From: Mateusz Majewski Date: Thu, 24 Dec 2020 10:46:57 +0000 (+0100) Subject: Add revision support in __add_target X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=24c97cbdc2a1aefb3d7521cd29cd3cc36de3f833;p=platform%2Fcore%2Fconnectivity%2Fstc-iptables.git Add revision support in __add_target Change-Id: I7f0c9fa93b783d8de63a633eb6771a11897181d1 --- diff --git a/src/helper/helper-ip6tables.c b/src/helper/helper-ip6tables.c index 046428d..a8c429a 100755 --- a/src/helper/helper-ip6tables.c +++ b/src/helper/helper-ip6tables.c @@ -93,7 +93,8 @@ static unsigned int __add_match(const char *name, ip6t_entry_match_t *start, return match->u.match_size; } -static unsigned int __add_target(const char *name, ip6t_entry_target_t *start, size_t size, void *data) +static unsigned int __add_target(const char *name, ip6t_entry_target_t *start, + int revision, size_t size, void *data) { ip6t_entry_target_t *target = start; @@ -101,6 +102,7 @@ static unsigned int __add_target(const char *name, ip6t_entry_target_t *start, s g_strlcpy(target->u.user.name, name, XT_EXTENSION_MAXNAMELEN); memcpy(target->data, data, size); + target->u.user.revision = revision; return target->u.target_size; } @@ -280,7 +282,7 @@ static unsigned int __add_log_target(unsigned char level, const char *prefix, log.level = level; g_strlcpy(log.prefix, prefix, 30); /* target_log */ - return __add_target(IP6TC_LOG, start, sizeof(ip6t_log_info_t), &log); + return __add_target(IP6TC_LOG, start, 0, sizeof(ip6t_log_info_t), &log); } static unsigned int __add_nflog_target(unsigned int group, const char *prefix, @@ -294,7 +296,7 @@ static unsigned int __add_nflog_target(unsigned int group, const char *prefix, nflog.len = range; nflog.threshold = threshold; /* target_nflog */ - return __add_target(IP6TC_NFLOG, start, sizeof(ip6t_nflog_info_t), &nflog); + return __add_target(IP6TC_NFLOG, start, 0, sizeof(ip6t_nflog_info_t), &nflog); } static int __create_entry_data(unsigned char *entry, unsigned char *mask, diff --git a/src/helper/helper-iptables.c b/src/helper/helper-iptables.c index 8678ba6..e4cc3ae 100755 --- a/src/helper/helper-iptables.c +++ b/src/helper/helper-iptables.c @@ -92,7 +92,8 @@ static unsigned int __add_match(const char *name, ipt_entry_match_t *start, return match->u.match_size; } -static unsigned int __add_target(const char *name, ipt_entry_target_t *start, size_t size, void *data) +static unsigned int __add_target(const char *name, ipt_entry_target_t *start, + int revision, size_t size, void *data) { ipt_entry_target_t *target = start; @@ -100,6 +101,7 @@ static unsigned int __add_target(const char *name, ipt_entry_target_t *start, si g_strlcpy(target->u.user.name, name, XT_EXTENSION_MAXNAMELEN); memcpy(target->data, data, size); + target->u.user.revision = revision; return target->u.target_size; } @@ -279,7 +281,7 @@ static unsigned int __add_log_target(unsigned char level, const char *prefix, log.level = level; g_strlcpy(log.prefix, prefix, 30); /* target_log */ - return __add_target(IPTC_LOG, start, sizeof(ipt_log_info_t), &log); + return __add_target(IPTC_LOG, start, 0, sizeof(ipt_log_info_t), &log); } static unsigned int __add_nflog_target(unsigned int group, const char *prefix, @@ -293,7 +295,7 @@ static unsigned int __add_nflog_target(unsigned int group, const char *prefix, nflog.len = range; nflog.threshold = threshold; /* target_nflog */ - return __add_target(IPTC_NFLOG, start, sizeof(ipt_nflog_info_t), &nflog); + return __add_target(IPTC_NFLOG, start, 0, sizeof(ipt_nflog_info_t), &nflog); } static int __create_entry_data(unsigned char *entry, unsigned char *mask,