aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/af_inet6.c
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2008-02-29 11:06:47 -0500
committerYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2008-03-04 01:18:22 -0500
commite898d4db2749c6052072e9bc4448e396cbdeb06a (patch)
tree2b8673d85210a23e67d0817b18f401411e8936f3 /net/ipv6/af_inet6.c
parentc6aefafb7ec620911d46174eed514f9df639e5a4 (diff)
[UDP]: Allow users to configure UDP-Lite.
Let's give users an option for disabling UDP-Lite (~4K). old: | text data bss dec hex filename | 286498 12432 6072 305002 4a76a net/ipv4/built-in.o | 193830 8192 3204 205226 321aa net/ipv6/ipv6.o new (without UDP-Lite): | text data bss dec hex filename | 284086 12136 5432 301654 49a56 net/ipv4/built-in.o | 191835 7832 3076 202743 317f7 net/ipv6/ipv6.o Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Diffstat (limited to 'net/ipv6/af_inet6.c')
-rw-r--r--net/ipv6/af_inet6.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index 9869f87243cf..243c42a6b80d 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -691,12 +691,16 @@ static int __init init_ipv6_mibs(void)
691 goto err_icmpmsg_mib; 691 goto err_icmpmsg_mib;
692 if (snmp_mib_init((void **)udp_stats_in6, sizeof (struct udp_mib)) < 0) 692 if (snmp_mib_init((void **)udp_stats_in6, sizeof (struct udp_mib)) < 0)
693 goto err_udp_mib; 693 goto err_udp_mib;
694#ifdef CONFIG_IP_UDPLITE
694 if (snmp_mib_init((void **)udplite_stats_in6, 695 if (snmp_mib_init((void **)udplite_stats_in6,
695 sizeof (struct udp_mib)) < 0) 696 sizeof (struct udp_mib)) < 0)
696 goto err_udplite_mib; 697 goto err_udplite_mib;
698#endif
697 return 0; 699 return 0;
698 700
701#ifdef CONFIG_IP_UDPLITE
699err_udplite_mib: 702err_udplite_mib:
703#endif
700 snmp_mib_free((void **)udp_stats_in6); 704 snmp_mib_free((void **)udp_stats_in6);
701err_udp_mib: 705err_udp_mib:
702 snmp_mib_free((void **)icmpv6msg_statistics); 706 snmp_mib_free((void **)icmpv6msg_statistics);
@@ -715,7 +719,9 @@ static void cleanup_ipv6_mibs(void)
715 snmp_mib_free((void **)icmpv6_statistics); 719 snmp_mib_free((void **)icmpv6_statistics);
716 snmp_mib_free((void **)icmpv6msg_statistics); 720 snmp_mib_free((void **)icmpv6msg_statistics);
717 snmp_mib_free((void **)udp_stats_in6); 721 snmp_mib_free((void **)udp_stats_in6);
722#ifdef CONFIG_IP_UDPLITE
718 snmp_mib_free((void **)udplite_stats_in6); 723 snmp_mib_free((void **)udplite_stats_in6);
724#endif
719} 725}
720 726
721static int inet6_net_init(struct net *net) 727static int inet6_net_init(struct net *net)
@@ -760,9 +766,11 @@ static int __init inet6_init(void)
760 if (err) 766 if (err)
761 goto out_unregister_tcp_proto; 767 goto out_unregister_tcp_proto;
762 768
769#ifdef CONFIG_IP_UDPLITE
763 err = proto_register(&udplitev6_prot, 1); 770 err = proto_register(&udplitev6_prot, 1);
764 if (err) 771 if (err)
765 goto out_unregister_udp_proto; 772 goto out_unregister_udp_proto;
773#endif
766 774
767 err = proto_register(&rawv6_prot, 1); 775 err = proto_register(&rawv6_prot, 1);
768 if (err) 776 if (err)
@@ -933,8 +941,10 @@ out_sock_register_fail:
933out_unregister_raw_proto: 941out_unregister_raw_proto:
934 proto_unregister(&rawv6_prot); 942 proto_unregister(&rawv6_prot);
935out_unregister_udplite_proto: 943out_unregister_udplite_proto:
944#ifdef CONFIG_IP_UDPLITE
936 proto_unregister(&udplitev6_prot); 945 proto_unregister(&udplitev6_prot);
937out_unregister_udp_proto: 946out_unregister_udp_proto:
947#endif
938 proto_unregister(&udpv6_prot); 948 proto_unregister(&udpv6_prot);
939out_unregister_tcp_proto: 949out_unregister_tcp_proto:
940 proto_unregister(&tcpv6_prot); 950 proto_unregister(&tcpv6_prot);
@@ -950,7 +960,9 @@ static void __exit inet6_exit(void)
950 rtnl_unregister_all(PF_INET6); 960 rtnl_unregister_all(PF_INET6);
951 961
952 udpv6_exit(); 962 udpv6_exit();
963#ifdef CONFIG_IP_UDPLITE
953 udplitev6_exit(); 964 udplitev6_exit();
965#endif
954 tcpv6_exit(); 966 tcpv6_exit();
955 967
956 /* Cleanup code parts. */ 968 /* Cleanup code parts. */
@@ -982,7 +994,9 @@ static void __exit inet6_exit(void)
982 unregister_pernet_subsys(&inet6_net_ops); 994 unregister_pernet_subsys(&inet6_net_ops);
983 cleanup_ipv6_mibs(); 995 cleanup_ipv6_mibs();
984 proto_unregister(&rawv6_prot); 996 proto_unregister(&rawv6_prot);
997#ifdef CONFIG_IP_UDPLITE
985 proto_unregister(&udplitev6_prot); 998 proto_unregister(&udplitev6_prot);
999#endif
986 proto_unregister(&udpv6_prot); 1000 proto_unregister(&udpv6_prot);
987 proto_unregister(&tcpv6_prot); 1001 proto_unregister(&tcpv6_prot);
988} 1002}