summaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-12-04 20:46:34 +0100
committerDavid S. Miller <davem@davemloft.net>2012-12-04 20:46:34 +0100
commitb1afce9538eef6239798ec54cead3c39d69724ca (patch)
tree14f839aa34fb1a63d6c559961120124a266b15ad /net/ipv6
parentip6mr: fix rtm_family of rtnl msg (diff)
downloadlinux-b1afce9538eef6239798ec54cead3c39d69724ca.tar.xz
linux-b1afce9538eef6239798ec54cead3c39d69724ca.zip
ipv6: Protect ->mc_forwarding access with CONFIG_IPV6_MROUTE
Reported-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/addrconf.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 28e0e627229c..6fca01f136ad 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -469,8 +469,10 @@ static int inet6_netconf_msgsize_devconf(int type)
/* type -1 is used for ALL */
if (type == -1 || type == NETCONFA_FORWARDING)
size += nla_total_size(4);
+#ifdef CONFIG_IPV6_MROUTE
if (type == -1 || type == NETCONFA_MC_FORWARDING)
size += nla_total_size(4);
+#endif
return size;
}
@@ -498,11 +500,12 @@ static int inet6_netconf_fill_devconf(struct sk_buff *skb, int ifindex,
if ((type == -1 || type == NETCONFA_FORWARDING) &&
nla_put_s32(skb, NETCONFA_FORWARDING, devconf->forwarding) < 0)
goto nla_put_failure;
+#ifdef CONFIG_IPV6_MROUTE
if ((type == -1 || type == NETCONFA_MC_FORWARDING) &&
nla_put_s32(skb, NETCONFA_MC_FORWARDING,
devconf->mc_forwarding) < 0)
goto nla_put_failure;
-
+#endif
return nlmsg_end(skb, nlh);
nla_put_failure: