Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

xfrm6: Fix xfrm6_policy.c build when SYSCTL disabled.

Same as how Randy Dunlap fixed the ipv4 side of things.

Signed-off-by: David S. Miller <davem@davemloft.net>

+6 -1
+6 -1
net/ipv6/xfrm6_policy.c
··· 306 306 xfrm_policy_unregister_afinfo(&xfrm6_policy_afinfo); 307 307 } 308 308 309 + #ifdef CONFIG_SYSCTL 309 310 static struct ctl_table xfrm6_policy_table[] = { 310 311 { 311 312 .ctl_name = CTL_UNNUMBERED, ··· 320 319 }; 321 320 322 321 static struct ctl_table_header *sysctl_hdr; 322 + #endif 323 323 324 324 int __init xfrm6_init(void) 325 325 { ··· 347 345 */ 348 346 gc_thresh = FIB6_TABLE_HASHSZ * 8; 349 347 xfrm6_dst_ops.gc_thresh = (gc_thresh < 1024) ? 1024 : gc_thresh; 350 - 348 + #ifdef CONFIG_SYSCTL 351 349 sysctl_hdr = register_net_sysctl_table(&init_net, net_ipv6_ctl_path, 352 350 xfrm6_policy_table); 351 + #endif 353 352 out: 354 353 return ret; 355 354 out_policy: ··· 360 357 361 358 void xfrm6_fini(void) 362 359 { 360 + #ifdef CONFIG_SYSCTL 363 361 if (sysctl_hdr) 364 362 unregister_net_sysctl_table(sysctl_hdr); 363 + #endif 365 364 //xfrm6_input_fini(); 366 365 xfrm6_policy_fini(); 367 366 xfrm6_state_fini();