Fix build warnings 81/280681/1
authorAnjali Nijhara <a.nijhara@samsung.com>
Fri, 2 Sep 2022 06:27:21 +0000 (11:57 +0530)
committerAnjali Nijhara <a.nijhara@samsung.com>
Fri, 2 Sep 2022 06:27:21 +0000 (11:57 +0530)
Change-Id: Ib5ccfc0f48c447c81e3ed9f53e04f3da9fd077b8

src/helper/helper-ip6tables.c
src/helper/helper-iptables.c
src/helper/helper-log.c

index 55f2516c9a8e3f62d1d7e67c506df055fa19adee..f1c6d54a0ad913f1970d562cc6a4f0a54ec2f6f4 100755 (executable)
@@ -27,7 +27,7 @@
 #include <linux/netfilter/xt_nfacct.h>
 #include <linux/netfilter/xt_iprange.h>
 #include <linux/netfilter/xt_NFLOG.h>
-#include <linux/netfilter_ipv6/ip6t_LOG.h>
+#include <linux/netfilter/xt_LOG.h>
 
 #include "stc-iptables-error.h"
 #include "stc-iptables-util.h"
@@ -64,7 +64,7 @@ typedef struct xt_nfacct_match_info  ip6t_nfacct_info_t;
 typedef struct xt_iprange_mtinfo     ip6t_iprange_info_t;
 
 /* target */
-typedef struct ip6t_log_info         ip6t_log_info_t;
+typedef struct xt_log_info           xt_log_info_t;
 typedef struct xt_nflog_info         ip6t_nflog_info_t;
 
 #define SIZE_ENTRY IP6T_ALIGN(sizeof(ip6t_entry_t))
@@ -74,7 +74,7 @@ typedef struct xt_nflog_info         ip6t_nflog_info_t;
 #define SIZE_NFACCT_MATCH IP6T_ALIGN(sizeof(ip6t_entry_match_t)) + IP6T_ALIGN(sizeof(ip6t_nfacct_info_t))
 #define SIZE_IPRANGE_MATCH IP6T_ALIGN(sizeof(ip6t_entry_match_t)) + IP6T_ALIGN(sizeof(ip6t_iprange_info_t))
 #define SIZE_TARGET IP6T_ALIGN(sizeof(ip6t_entry_target_t)) + IP6T_ALIGN(sizeof(int))
-#define SIZE_TARGET_LOG IP6T_ALIGN(sizeof(ip6t_log_info_t))
+#define SIZE_TARGET_LOG IP6T_ALIGN(sizeof(xt_log_info_t))
 #define SIZE_TARGET_NFLOG IP6T_ALIGN(sizeof(ip6t_nflog_info_t))
 #define SIZE_TOTAL SIZE_ENTRY + SIZE_TCP_MATCH + SIZE_UDP_MATCH + SIZE_CGROUP_MATCH \
                                        + SIZE_NFACCT_MATCH + SIZE_IPRANGE_MATCH + SIZE_TARGET \
@@ -271,12 +271,12 @@ static unsigned int __add_log_target(unsigned char level, const char *prefix,
                                                ip6t_entry_target_t *start)
 {
        /* log => "--log-level --log-prefix" */
-       ip6t_log_info_t log;
-       memset(&log, 0, sizeof(ip6t_log_info_t));
+       xt_log_info_t log;
+       memset(&log, 0, sizeof(xt_log_info_t));
        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, sizeof(xt_log_info_t), &log);
 }
 
 static unsigned int __add_nflog_target(unsigned int group, const char *prefix,
index 7604725252fece2ede11d017e958ab72d243e167..e117e93fd9bc576ac451138e8e2c3a017a5498bb 100755 (executable)
@@ -26,7 +26,7 @@
 #include <linux/netfilter/xt_nfacct.h>
 #include <linux/netfilter/xt_iprange.h>
 #include <linux/netfilter/xt_NFLOG.h>
-#include <linux/netfilter_ipv4/ipt_LOG.h>
+#include <linux/netfilter/xt_LOG.h>
 
 #include "stc-iptables-error.h"
 #include "stc-iptables-util.h"
@@ -63,7 +63,7 @@ typedef struct xt_nfacct_match_info  ipt_nfacct_info_t;
 typedef struct xt_iprange_mtinfo     ipt_iprange_info_t;
 
 /* target */
-typedef struct ipt_log_info          ipt_log_info_t;
+typedef struct xt_log_info           xt_log_info_t;
 typedef struct xt_nflog_info         ipt_nflog_info_t;
 
 #define SIZE_ENTRY IPT_ALIGN(sizeof(ipt_entry_t))
@@ -73,7 +73,7 @@ typedef struct xt_nflog_info         ipt_nflog_info_t;
 #define SIZE_NFACCT_MATCH IPT_ALIGN(sizeof(ipt_entry_match_t)) + IPT_ALIGN(sizeof(ipt_nfacct_info_t))
 #define SIZE_IPRANGE_MATCH IPT_ALIGN(sizeof(ipt_entry_match_t)) + IPT_ALIGN(sizeof(ipt_iprange_info_t))
 #define SIZE_TARGET IPT_ALIGN(sizeof(ipt_entry_target_t)) + IPT_ALIGN(sizeof(int))
-#define SIZE_TARGET_LOG IPT_ALIGN(sizeof(ipt_log_info_t))
+#define SIZE_TARGET_LOG IPT_ALIGN(sizeof(xt_log_info_t))
 #define SIZE_TARGET_NFLOG IPT_ALIGN(sizeof(ipt_nflog_info_t))
 #define SIZE_TOTAL SIZE_ENTRY + SIZE_TCP_MATCH + SIZE_UDP_MATCH + SIZE_CGROUP_MATCH \
                                        + SIZE_NFACCT_MATCH + SIZE_IPRANGE_MATCH + SIZE_TARGET \
@@ -278,12 +278,12 @@ static unsigned int __add_log_target(unsigned char level, const char *prefix,
                                                ipt_entry_target_t *start)
 {
        /* log => "--log-level --log-prefix" */
-       ipt_log_info_t log;
-       memset(&log, 0, sizeof(ipt_log_info_t));
+       xt_log_info_t log;
+       memset(&log, 0, sizeof(xt_log_info_t));
        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, sizeof(xt_log_info_t), &log);
 }
 
 static unsigned int __add_nflog_target(unsigned int group, const char *prefix,
index edcf9c708fb9c4c9d7306a9a9be7421f8d742ea5..007daa99e48cadacf67991b20113fa6f870e3bd0 100755 (executable)
@@ -97,7 +97,7 @@ void helper_log(const char *format, ...)
        int log_size = 0;
        struct stat buf;
        char str[256];
-       char strtime[40];
+       char strtime[41];
 
        if (g_log_mode == 0)
                return;