[PATCH] xt_AUDIT.c: remove ipv6 dependencies

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
---
 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@xxxxxxxxxx>");
 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


--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux