Skip to content

Commit

Permalink
net sysctl: Add place holder functions for when sysctl support is com…
Browse files Browse the repository at this point in the history
…piled 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>
  • Loading branch information
Eric W. Biederman authored and David S. Miller committed Apr 23, 2012
1 parent 42f11cf commit 48c7495
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions include/net/net_namespace.h
Original file line number Diff line number Diff line change
Expand Up @@ -284,11 +284,20 @@ struct ctl_table_header;

#ifdef CONFIG_SYSCTL
extern int net_sysctl_init(void);
#else
static inline int net_sysctl_init(void) { return 0; }
#endif
extern struct ctl_table_header *register_net_sysctl(struct net *net,
const char *path, struct ctl_table *table);
extern void unregister_net_sysctl_table(struct ctl_table_header *header);
#else
static inline int net_sysctl_init(void) { return 0; }
static inline struct ctl_table_header *register_net_sysctl(struct net *net,
const char *path, struct ctl_table *table)
{
return NULL;
}
static inline void unregister_net_sysctl_table(struct ctl_table_header *header)
{
}
#endif


#endif /* __NET_NET_NAMESPACE_H */

0 comments on commit 48c7495

Please sign in to comment.