Skip to content

Commit

Permalink
[IPV6]: route6 remove ifdef for fib_rules
Browse files Browse the repository at this point in the history
The patch defines the usual static inline functions when the code is
disabled for fib6_rules. That's allow to remove some ifdef in route.c
file and make the code a little more clear.

Signed-off-by: Daniel Lezcano <[email protected]>
Acked-by: YOSHIFUJI Hideaki <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Daniel Lezcano authored and davem330 committed Jan 28, 2008
1 parent c35b7e7 commit 7e5449c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
12 changes: 11 additions & 1 deletion include/net/ip6_fib.h
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,18 @@ extern void fib6_gc_cleanup(void);

extern int fib6_init(void);

#ifdef CONFIG_IPV6_MULTIPLE_TABLES
extern int fib6_rules_init(void);
extern void fib6_rules_cleanup(void);

#else
static inline int fib6_rules_init(void)
{
return 0;
}
static inline void fib6_rules_cleanup(void)
{
return ;
}
#endif
#endif
#endif
7 changes: 1 addition & 6 deletions net/ipv6/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -2526,11 +2526,10 @@ int __init ip6_route_init(void)
if (ret)
goto out_proc_init;

#ifdef CONFIG_IPV6_MULTIPLE_TABLES
ret = fib6_rules_init();
if (ret)
goto xfrm6_init;
#endif

ret = -ENOBUFS;
if (__rtnl_register(PF_INET6, RTM_NEWROUTE, inet6_rtm_newroute, NULL) ||
__rtnl_register(PF_INET6, RTM_DELROUTE, inet6_rtm_delroute, NULL) ||
Expand All @@ -2542,10 +2541,8 @@ int __init ip6_route_init(void)
return ret;

fib6_rules_init:
#ifdef CONFIG_IPV6_MULTIPLE_TABLES
fib6_rules_cleanup();
xfrm6_init:
#endif
xfrm6_fini();
out_proc_init:
ipv6_route_proc_fini(&init_net);
Expand All @@ -2559,9 +2556,7 @@ int __init ip6_route_init(void)

void ip6_route_cleanup(void)
{
#ifdef CONFIG_IPV6_MULTIPLE_TABLES
fib6_rules_cleanup();
#endif
ipv6_route_proc_fini(&init_net);
xfrm6_fini();
rt6_ifdown(NULL);
Expand Down

0 comments on commit 7e5449c

Please sign in to comment.