]> granicus.if.org Git - ipset/commitdiff
Fix the include guards on the include/libipset/linux_ip_set*.h
authorJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Thu, 14 Sep 2017 17:48:03 +0000 (19:48 +0200)
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Thu, 14 Sep 2017 17:48:03 +0000 (19:48 +0200)
The include guards did not prevent including the "same" userspace
and kernel header files.

Fixes bugzilla id #1139, reported and solution suggested by Quentin Armitage.

Makefile.am
include/libipset/linux_ip_set.h
include/libipset/linux_ip_set_bitmap.h
include/libipset/linux_ip_set_hash.h
include/libipset/linux_ip_set_list.h

index e3404fae6a98b374ab1925835d428af578f6986b..8d718e1ca67638b12e81acc78f6b8d537df7248f 100644 (file)
@@ -88,8 +88,10 @@ endif
 
 update_includes:
        for x in ip_set.h ip_set_bitmap.h ip_set_hash.h ip_set_list.h; do \
-           cp kernel/include/uapi/linux/netfilter/ipset/$$x \
-               include/libipset/linux_$$x; \
+           sed -r -e 's@#(ifndef|define|endif[ \t]*/[*])[ \t]*_UAPI@#\1 @' \
+                  -e 's@^#include <linux/netfilter/ipset/ip_set.h>@@' \
+               kernel/include/uapi/linux/netfilter/ipset/$$x \
+               > include/libipset/linux_$$x; \
        done
 
 update_utils:
index def91b9d308457a5b1ee9d2eafb5fe79c7af3fe1..883922d3260dd31cc8291195c9fb70a69f676e1d 100644 (file)
@@ -7,8 +7,8 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-#ifndef _UAPI_IP_SET_H
-#define _UAPI_IP_SET_H
+#ifndef _IP_SET_H
+#define _IP_SET_H
 
 #include <linux/types.h>
 
@@ -118,6 +118,7 @@ enum {
        IPSET_ATTR_SKBMARK,
        IPSET_ATTR_SKBPRIO,
        IPSET_ATTR_SKBQUEUE,
+       IPSET_ATTR_PAD,
        __IPSET_ATTR_ADT_MAX,
 };
 #define IPSET_ATTR_ADT_MAX     (__IPSET_ATTR_ADT_MAX - 1)
@@ -300,4 +301,4 @@ struct ip_set_req_version {
        unsigned int version;
 };
 
-#endif /* _UAPI_IP_SET_H */
+#endif /* _IP_SET_H */
index 6a2c038d18885941a2ff84c048d2fa045131cf54..c4b63d650b55c86774327c8ed1dc2989a2c4cde3 100644 (file)
@@ -1,5 +1,7 @@
-#ifndef _UAPI__IP_SET_BITMAP_H
-#define _UAPI__IP_SET_BITMAP_H
+#ifndef __IP_SET_BITMAP_H
+#define __IP_SET_BITMAP_H
+
+
 
 /* Bitmap type specific error codes */
 enum {
@@ -10,4 +12,4 @@ enum {
 };
 
 
-#endif /* _UAPI__IP_SET_BITMAP_H */
+#endif /* __IP_SET_BITMAP_H */
index 352eeccdc7f201dacf470e9b6a40e46d41814114..73d40d715b78b5e9a8adf804b0d96e1a796b5994 100644 (file)
@@ -1,5 +1,7 @@
-#ifndef _UAPI__IP_SET_HASH_H
-#define _UAPI__IP_SET_HASH_H
+#ifndef __IP_SET_HASH_H
+#define __IP_SET_HASH_H
+
+
 
 /* Hash type specific error codes */
 enum {
@@ -18,4 +20,4 @@ enum {
 };
 
 
-#endif /* _UAPI__IP_SET_HASH_H */
+#endif /* __IP_SET_HASH_H */
index a44efaa98213e08b59daed0663c0f35b81afff41..f8cb89ea2bcaa997806bc8a6df554c79a9575600 100644 (file)
@@ -1,5 +1,7 @@
-#ifndef _UAPI__IP_SET_LIST_H
-#define _UAPI__IP_SET_LIST_H
+#ifndef __IP_SET_LIST_H
+#define __IP_SET_LIST_H
+
+
 
 /* List type specific error codes */
 enum {
@@ -18,4 +20,4 @@ enum {
 };
 
 
-#endif /* _UAPI__IP_SET_LIST_H */
+#endif /* __IP_SET_LIST_H */