diff options
author | David S. Miller <davem@davemloft.net> | 2012-12-04 14:46:34 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-12-04 14:46:34 -0500 |
commit | b1afce9538eef6239798ec54cead3c39d69724ca (patch) | |
tree | 14f839aa34fb1a63d6c559961120124a266b15ad /net/ipv6 | |
parent | 193c1e478cc496844fcbef402a10976c95a634ff (diff) |
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.c | 5 |
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) | |||
469 | /* type -1 is used for ALL */ | 469 | /* type -1 is used for ALL */ |
470 | if (type == -1 || type == NETCONFA_FORWARDING) | 470 | if (type == -1 || type == NETCONFA_FORWARDING) |
471 | size += nla_total_size(4); | 471 | size += nla_total_size(4); |
472 | #ifdef CONFIG_IPV6_MROUTE | ||
472 | if (type == -1 || type == NETCONFA_MC_FORWARDING) | 473 | if (type == -1 || type == NETCONFA_MC_FORWARDING) |
473 | size += nla_total_size(4); | 474 | size += nla_total_size(4); |
475 | #endif | ||
474 | 476 | ||
475 | return size; | 477 | return size; |
476 | } | 478 | } |
@@ -498,11 +500,12 @@ static int inet6_netconf_fill_devconf(struct sk_buff *skb, int ifindex, | |||
498 | if ((type == -1 || type == NETCONFA_FORWARDING) && | 500 | if ((type == -1 || type == NETCONFA_FORWARDING) && |
499 | nla_put_s32(skb, NETCONFA_FORWARDING, devconf->forwarding) < 0) | 501 | nla_put_s32(skb, NETCONFA_FORWARDING, devconf->forwarding) < 0) |
500 | goto nla_put_failure; | 502 | goto nla_put_failure; |
503 | #ifdef CONFIG_IPV6_MROUTE | ||
501 | if ((type == -1 || type == NETCONFA_MC_FORWARDING) && | 504 | if ((type == -1 || type == NETCONFA_MC_FORWARDING) && |
502 | nla_put_s32(skb, NETCONFA_MC_FORWARDING, | 505 | nla_put_s32(skb, NETCONFA_MC_FORWARDING, |
503 | devconf->mc_forwarding) < 0) | 506 | devconf->mc_forwarding) < 0) |
504 | goto nla_put_failure; | 507 | goto nla_put_failure; |
505 | 508 | #endif | |
506 | return nlmsg_end(skb, nlh); | 509 | return nlmsg_end(skb, nlh); |
507 | 510 | ||
508 | nla_put_failure: | 511 | nla_put_failure: |