netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xt_AUDIT.c: remove ipv6 dependencies
@ 2011-05-21 22:37 Mr Dash Four
  2011-05-22  9:43 ` Eric Dumazet
  0 siblings, 1 reply; 5+ messages in thread
From: Mr Dash Four @ 2011-05-21 22:37 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Thomas Graf, Patrick McHardy, Eric Paris, Al Viro

All,


This patch follows the one I submitted yesterday and removes the dependencies on ipv6 allowing the AUDIT target be compiled on systems where no ipv6 is implemented or running.

Signed-off-by: Mr Dash Four <mr.dash.four@googlemail.com>
---
 net/netfilter/xt_AUDIT.c |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/net/netfilter/xt_AUDIT.c b/net/netfilter/xt_AUDIT.c
index e823f18..5cea31e 100644
--- a/net/netfilter/xt_AUDIT.c
+++ b/net/netfilter/xt_AUDIT.c
@@ -23,14 +23,18 @@
 #ifdef CONFIG_NF_CONNTRACK_SECMARK
 #include <linux/security.h>
 #endif
+#ifdef CONFIG_IPV6
 #include <net/ipv6.h>
+#endif
 #include <net/ip.h>
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Thomas Graf <tgraf@redhat.com>");
 MODULE_DESCRIPTION("Xtables: creates audit records for dropped/accepted packets");
 MODULE_ALIAS("ipt_AUDIT");
+#ifdef CONFIG_IPV6
 MODULE_ALIAS("ip6t_AUDIT");
+#endif
 MODULE_ALIAS("ebt_AUDIT");
 MODULE_ALIAS("arpt_AUDIT");
 
@@ -55,8 +59,10 @@ static void audit_proto(struct audit_buffer *ab, struct sk_buff *skb,
 		}
 		break;
 
-	case IPPROTO_ICMP:
-	case IPPROTO_ICMPV6: {
+#ifdef CONFIG_IPV6
+	case IPPROTO_ICMPV6:
+#endif
+	case IPPROTO_ICMP: {
 		const u8 *iptr;
 		u8 _ih[2];
 
@@ -96,6 +102,7 @@ static void audit_ip4(struct audit_buffer *ab, struct sk_buff *skb)
 	audit_proto(ab, skb, ih->protocol, ih->ihl * 4);
 }
 
+#ifdef CONFIG_IPV6
 static void audit_ip6(struct audit_buffer *ab, struct sk_buff *skb)
 {
 	struct ipv6hdr _ip6h;
@@ -120,6 +127,7 @@ static void audit_ip6(struct audit_buffer *ab, struct sk_buff *skb)
 		audit_proto(ab, skb, nexthdr, offset);
 }
 
+#endif
 static unsigned int
 audit_tg(struct sk_buff *skb, const struct xt_action_param *par)
 {
@@ -160,10 +168,12 @@ audit_tg(struct sk_buff *skb, const struct xt_action_param *par)
 			case __constant_htons(ETH_P_IP):
 				audit_ip4(ab, skb);
 				break;
+#ifdef CONFIG_IPV6
 
 			case __constant_htons(ETH_P_IPV6):
 				audit_ip6(ab, skb);
 				break;
+#endif
 			}
 		}
 	}
@@ -172,10 +182,12 @@ audit_tg(struct sk_buff *skb, const struct xt_action_param *par)
 	case NFPROTO_IPV4:
 		audit_ip4(ab, skb);
 		break;
+#ifdef CONFIG_IPV6
 
 	case NFPROTO_IPV6:
 		audit_ip6(ab, skb);
 		break;
+#endif
 	}
 
 	audit_log_end(ab);
-- 
1.7.3.4



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

end of thread, other threads:[~2011-05-22 11:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-21 22:37 [PATCH] xt_AUDIT.c: remove ipv6 dependencies Mr Dash Four
2011-05-22  9:43 ` Eric Dumazet
2011-05-22 10:01   ` Thomas Graf
2011-05-22 11:44     ` Mr Dash Four
2011-05-22 11:58       ` Thomas Graf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).