aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/net_namespace.h
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2012-04-23 08:13:02 -0400
committerDavid S. Miller <davem@davemloft.net>2012-04-23 19:24:28 -0400
commit48c74958571b609522c016136259a1369a3ddd24 (patch)
tree364e264d5b53d5fdad36dd424ad0e241e6934417 /include/net/net_namespace.h
parent42f11cf20cc5b76766fd1f0e591eda26283a38ec (diff)
net sysctl: Add place holder functions for when sysctl support is compiled out of the kernel.
Randy Dunlap <rdunlap@xenotime.net> reported: > On 04/23/2012 12:07 AM, Stephen Rothwell wrote: > >> Hi all, >> >> Changes since 20120420: > > > > ERROR: "unregister_net_sysctl_table" [net/phonet/phonet.ko] undefined! > ERROR: "register_net_sysctl" [net/phonet/phonet.ko] undefined! > > when CONFIG_SYSCTL is not enabled. Add static inline stub functions to gracefully handle the case when sysctl support is not present. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Acked-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/net_namespace.h')
-rw-r--r--include/net/net_namespace.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
index 3ee4a3da7168..ac9195e6a062 100644
--- a/include/net/net_namespace.h
+++ b/include/net/net_namespace.h
@@ -284,11 +284,20 @@ struct ctl_table_header;
284 284
285#ifdef CONFIG_SYSCTL 285#ifdef CONFIG_SYSCTL
286extern int net_sysctl_init(void); 286extern int net_sysctl_init(void);
287#else
288static inline int net_sysctl_init(void) { return 0; }
289#endif
290extern struct ctl_table_header *register_net_sysctl(struct net *net, 287extern struct ctl_table_header *register_net_sysctl(struct net *net,
291 const char *path, struct ctl_table *table); 288 const char *path, struct ctl_table *table);
292extern void unregister_net_sysctl_table(struct ctl_table_header *header); 289extern void unregister_net_sysctl_table(struct ctl_table_header *header);
290#else
291static inline int net_sysctl_init(void) { return 0; }
292static inline struct ctl_table_header *register_net_sysctl(struct net *net,
293 const char *path, struct ctl_table *table)
294{
295 return NULL;
296}
297static inline void unregister_net_sysctl_table(struct ctl_table_header *header)
298{
299}
300#endif
301
293 302
294#endif /* __NET_NET_NAMESPACE_H */ 303#endif /* __NET_NET_NAMESPACE_H */