Skip to content

Commit

Permalink
[IPV6]: Track device renames in snmp6.
Browse files Browse the repository at this point in the history
When network device's are renamed, the IPV6 snmp6 code
gets confused. It doesn't track name changes so it will OOPS
when network device's are removed.

The fix is trivial, just unregister/re-register in notify handler.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Stephen Hemminger authored and davem330 committed Apr 29, 2007
1 parent aad97f3 commit 5632c51
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions net/ipv6/addrconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -2359,17 +2359,19 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event,
break;

case NETDEV_CHANGENAME:
#ifdef CONFIG_SYSCTL
if (idev) {
snmp6_unregister_dev(idev);
#ifdef CONFIG_SYSCTL
addrconf_sysctl_unregister(&idev->cnf);
neigh_sysctl_unregister(idev->nd_parms);
neigh_sysctl_register(dev, idev->nd_parms,
NET_IPV6, NET_IPV6_NEIGH, "ipv6",
&ndisc_ifinfo_sysctl_change,
NULL);
addrconf_sysctl_register(idev, &idev->cnf);
}
#endif
snmp6_register_dev(idev);
}
break;
}

Expand Down
1 change: 1 addition & 0 deletions net/ipv6/proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ int snmp6_unregister_dev(struct inet6_dev *idev)
return -EINVAL;
remove_proc_entry(idev->stats.proc_dir_entry->name,
proc_net_devsnmp6);
idev->stats.proc_dir_entry = NULL;
return 0;
}

Expand Down

0 comments on commit 5632c51

Please sign in to comment.