Skip to content

Commit

Permalink
ipv6: Protect ->mc_forwarding access with CONFIG_IPV6_MROUTE
Browse files Browse the repository at this point in the history
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Dec 4, 2012
1 parent 193c1e4 commit b1afce9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion net/ipv6/addrconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit b1afce9

Please sign in to comment.