All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH libiptc] libip6tc.h: Add extern "C" wrapping for C++ linking.
@ 2019-07-15 15:58 Chris PeBenito
  2019-07-30 14:43 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 2+ messages in thread
From: Chris PeBenito @ 2019-07-15 15:58 UTC (permalink / raw)
  To: netfilter-devel

Signed-off-by: Chris PeBenito <chpebeni@linux.microsoft.com>
---
 include/libiptc/libip6tc.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/include/libiptc/libip6tc.h b/include/libiptc/libip6tc.h
index 9aed80a0..eaf34d65 100644
--- a/include/libiptc/libip6tc.h
+++ b/include/libiptc/libip6tc.h
@@ -12,6 +12,10 @@
 #include <linux/netfilter_ipv6/ip6_tables.h>
 #include <libiptc/xtcshared.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #define ip6tc_handle xtc_handle
 #define ip6t_chainlabel xt_chainlabel
 
@@ -158,4 +162,8 @@ extern void dump_entries6(struct xtc_handle *const);
 
 extern const struct xtc_ops ip6tc_ops;
 
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
 #endif /* _LIBIP6TC_H */
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH libiptc] libip6tc.h: Add extern "C" wrapping for C++ linking.
  2019-07-15 15:58 [PATCH libiptc] libip6tc.h: Add extern "C" wrapping for C++ linking Chris PeBenito
@ 2019-07-30 14:43 ` Pablo Neira Ayuso
  0 siblings, 0 replies; 2+ messages in thread
From: Pablo Neira Ayuso @ 2019-07-30 14:43 UTC (permalink / raw)
  To: Chris PeBenito; +Cc: netfilter-devel

Hi Chris,

On Mon, Jul 15, 2019 at 11:58:55AM -0400, Chris PeBenito wrote:
[...]
> diff --git a/include/libiptc/libip6tc.h b/include/libiptc/libip6tc.h
> index 9aed80a0..eaf34d65 100644
> --- a/include/libiptc/libip6tc.h
> +++ b/include/libiptc/libip6tc.h
> @@ -12,6 +12,10 @@
>  #include <linux/netfilter_ipv6/ip6_tables.h>
>  #include <libiptc/xtcshared.h>
>  
> +#ifdef __cplusplus
> +extern "C" {
> +#endif

This patch is very small, it does not harm anyone I think.

However, please note that we've been discouraging people to use the
iptables blob interface for years.

This interface is prone to races (see the userspace lock and the -w
option in iptables) and the binary layout is obscure.

Not sure how advance you're in developing a userspace program using
this interface, if in early stage, I'd suggest you go for command (in
string format) pipe them to iptables-restore, which is what most
people do to implement third party software that generates rules for
iptables.

Thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-07-30 14:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-15 15:58 [PATCH libiptc] libip6tc.h: Add extern "C" wrapping for C++ linking Chris PeBenito
2019-07-30 14:43 ` Pablo Neira Ayuso

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.