mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
[IPV6]: make flowlabel to return an error
This patch makes the flowlab subsystem to return an error code and makes some cleanup with procfs ifdefs. The af_inet6 will use the flowlabel init return code to check the initialization was correct. Signed-off-by: Daniel Lezcano <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
51602b2a5e
commit
0a3e78ac2c
3 changed files with 28 additions and 9 deletions
|
|
@ -851,7 +851,9 @@ static int __init inet6_init(void)
|
|||
err = ip6_route_init();
|
||||
if (err)
|
||||
goto ip6_route_fail;
|
||||
ip6_flowlabel_init();
|
||||
err = ip6_flowlabel_init();
|
||||
if (err)
|
||||
goto ip6_flowlabel_fail;
|
||||
err = addrconf_init();
|
||||
if (err)
|
||||
goto addrconf_fail;
|
||||
|
|
@ -874,6 +876,7 @@ out:
|
|||
|
||||
addrconf_fail:
|
||||
ip6_flowlabel_cleanup();
|
||||
ip6_flowlabel_fail:
|
||||
ip6_route_cleanup();
|
||||
ip6_route_fail:
|
||||
#ifdef CONFIG_PROC_FS
|
||||
|
|
|
|||
|
|
@ -692,20 +692,36 @@ static const struct file_operations ip6fl_seq_fops = {
|
|||
.llseek = seq_lseek,
|
||||
.release = seq_release_private,
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
void ip6_flowlabel_init(void)
|
||||
static int ip6_flowlabel_proc_init(struct net *net)
|
||||
{
|
||||
#ifdef CONFIG_PROC_FS
|
||||
proc_net_fops_create(&init_net, "ip6_flowlabel", S_IRUGO, &ip6fl_seq_fops);
|
||||
if (!proc_net_fops_create(net, "ip6_flowlabel", S_IRUGO, &ip6fl_seq_fops))
|
||||
return -ENOMEM;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void ip6_flowlabel_proc_fini(struct net *net)
|
||||
{
|
||||
proc_net_remove(net, "ip6_flowlabel");
|
||||
}
|
||||
#else
|
||||
static inline int ip6_flowlabel_proc_init(struct net *net)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline void ip6_flowlabel_proc_fini(struct net *net)
|
||||
{
|
||||
return ;
|
||||
}
|
||||
#endif
|
||||
|
||||
int ip6_flowlabel_init(void)
|
||||
{
|
||||
return ip6_flowlabel_proc_init(&init_net);
|
||||
}
|
||||
|
||||
void ip6_flowlabel_cleanup(void)
|
||||
{
|
||||
del_timer(&ip6_fl_gc_timer);
|
||||
#ifdef CONFIG_PROC_FS
|
||||
proc_net_remove(&init_net, "ip6_flowlabel");
|
||||
#endif
|
||||
ip6_flowlabel_proc_fini(&init_net);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue