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

(usagi-users 03545) fix compile fail(IP6_INC_STATS macro in netfilter.c)



Dear all,

I try to compile linux-2.6.14 applied recent usagi(cvs).

kernel config is follow:
Networking  --->
  Networking options   --->
    <M>The IPv6 Protocol
    ...
    [*]     IPv6: per-interface statistics for SNMP

but, compile is failed.
It seems a usage of IP6_INC_STATS macro in netfilter.c is wrong.
Is this patch correct?

Thank you,
Masanao

--- linux26/net/ipv6/netfilter.c	2005-10-13 16:30:50.000000000 +0900
+++ linux26-fix/net/ipv6/netfilter.c	2005-11-07 15:47:05.000000000 +0900
@@ -15,6 +15,9 @@
 {
 	struct ipv6hdr *iph = skb->nh.ipv6h;
 	struct dst_entry *dst;
+#ifdef CONFIG_IPV6_STATISTICS
+	struct inet6_dev *idev;
+#endif
 	struct flowi fl = {
 		.oif = skb->sk ? skb->sk->sk_bound_dev_if : 0,
 		.nl_u =
@@ -27,7 +30,12 @@
 	dst = ip6_route_output(skb->sk, &fl);
 
 	if (dst->error) {
+#ifdef CONFIG_IPV6_STATISTICS
+		idev = ((struct rt6_info *)dst)->rt6i_idev;
+		IP6_INC_STATS(idev, IPSTATS_MIB_OUTNOROUTES);
+#else
 		IP6_INC_STATS(IPSTATS_MIB_OUTNOROUTES);
+#endif
 		LIMIT_NETDEBUG(KERN_DEBUG "ip6_route_me_harder: No more route.\n");
 		dst_release(dst);
 		return -EINVAL;

--