File tree Expand file tree Collapse file tree 3 files changed +59
-8
lines changed Expand file tree Collapse file tree 3 files changed +59
-8
lines changed Original file line number Diff line number Diff line change @@ -144,10 +144,37 @@ static inline int ip_mroute_opt(int opt)
144144}
145145#endif
146146
147+ #ifdef CONFIG_IP_MROUTE
147148extern int ip_mroute_setsockopt (struct sock * , int , char __user * , int );
148149extern int ip_mroute_getsockopt (struct sock * , int , char __user * , int __user * );
149150extern int ipmr_ioctl (struct sock * sk , int cmd , void __user * arg );
150151extern int ip_mr_init (void );
152+ #else
153+ static inline
154+ int ip_mroute_setsockopt (struct sock * sock ,
155+ int optname , char __user * optval , int optlen )
156+ {
157+ return - ENOPROTOOPT ;
158+ }
159+
160+ static inline
161+ int ip_mroute_getsockopt (struct sock * sock ,
162+ int optname , char __user * optval , int __user * optlen )
163+ {
164+ return - ENOPROTOOPT ;
165+ }
166+
167+ static inline
168+ int ipmr_ioctl (struct sock * sk , int cmd , void __user * arg )
169+ {
170+ return - ENOIOCTLCMD ;
171+ }
172+
173+ static inline int ip_mr_init (void )
174+ {
175+ return 0 ;
176+ }
177+ #endif
151178
152179struct vif_device
153180{
Original file line number Diff line number Diff line change @@ -131,12 +131,44 @@ static inline int ip6_mroute_opt(int opt)
131131
132132struct sock ;
133133
134+ #ifdef CONFIG_IPV6_MROUTE
134135extern int ip6_mroute_setsockopt (struct sock * , int , char __user * , int );
135136extern int ip6_mroute_getsockopt (struct sock * , int , char __user * , int __user * );
136137extern int ip6_mr_input (struct sk_buff * skb );
137138extern int ip6mr_ioctl (struct sock * sk , int cmd , void __user * arg );
138139extern int ip6_mr_init (void );
139140extern void ip6_mr_cleanup (void );
141+ #else
142+ static inline
143+ int ip6_mroute_setsockopt (struct sock * sock ,
144+ int optname , char __user * optval , int optlen )
145+ {
146+ return - ENOPROTOOPT ;
147+ }
148+
149+ static inline
150+ int ip6_mroute_getsockopt (struct sock * sock ,
151+ int optname , char __user * optval , int __user * optlen )
152+ {
153+ return - ENOPROTOOPT ;
154+ }
155+
156+ static inline
157+ int ip6mr_ioctl (struct sock * sk , int cmd , void __user * arg )
158+ {
159+ return - ENOIOCTLCMD ;
160+ }
161+
162+ static inline int ip6_mr_init (void )
163+ {
164+ return 0 ;
165+ }
166+
167+ static inline void ip6_mr_cleanup (void )
168+ {
169+ return ;
170+ }
171+ #endif
140172
141173struct mif_device
142174{
Original file line number Diff line number Diff line change 5959
6060#include <asm/uaccess.h>
6161#include <asm/system.h>
62- #ifdef CONFIG_IPV6_MROUTE
6362#include <linux/mroute6.h>
64- #endif
6563
6664MODULE_AUTHOR ("Cast of dozens" );
6765MODULE_DESCRIPTION ("IPv6 protocol stack for Linux" );
@@ -952,11 +950,9 @@ static int __init inet6_init(void)
952950 err = icmpv6_init ();
953951 if (err )
954952 goto icmp_fail ;
955- #ifdef CONFIG_IPV6_MROUTE
956953 err = ip6_mr_init ();
957954 if (err )
958955 goto ipmr_fail ;
959- #endif
960956 err = ndisc_init ();
961957 if (err )
962958 goto ndisc_fail ;
@@ -1059,10 +1055,8 @@ static int __init inet6_init(void)
10591055igmp_fail :
10601056 ndisc_cleanup ();
10611057ndisc_fail :
1062- #ifdef CONFIG_IPV6_MROUTE
10631058 ip6_mr_cleanup ();
10641059ipmr_fail :
1065- #endif
10661060 icmpv6_cleanup ();
10671061icmp_fail :
10681062 unregister_pernet_subsys (& inet6_net_ops );
@@ -1117,9 +1111,7 @@ static void __exit inet6_exit(void)
11171111 ipv6_netfilter_fini ();
11181112 igmp6_cleanup ();
11191113 ndisc_cleanup ();
1120- #ifdef CONFIG_IPV6_MROUTE
11211114 ip6_mr_cleanup ();
1122- #endif
11231115 icmpv6_cleanup ();
11241116 rawv6_exit ();
11251117
You can’t perform that action at this time.
0 commit comments