aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/ipv6.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sctp/ipv6.c')
-rw-r--r--net/sctp/ipv6.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
index 4d7ec961ae1d..9aa0733aee87 100644
--- a/net/sctp/ipv6.c
+++ b/net/sctp/ipv6.c
@@ -89,6 +89,7 @@ static int sctp_inet6addr_event(struct notifier_block *this, unsigned long ev,
89 struct inet6_ifaddr *ifa = (struct inet6_ifaddr *)ptr; 89 struct inet6_ifaddr *ifa = (struct inet6_ifaddr *)ptr;
90 struct sctp_sockaddr_entry *addr = NULL; 90 struct sctp_sockaddr_entry *addr = NULL;
91 struct sctp_sockaddr_entry *temp; 91 struct sctp_sockaddr_entry *temp;
92 int found = 0;
92 93
93 switch (ev) { 94 switch (ev) {
94 case NETDEV_UP: 95 case NETDEV_UP:
@@ -111,13 +112,14 @@ static int sctp_inet6addr_event(struct notifier_block *this, unsigned long ev,
111 &sctp_local_addr_list, list) { 112 &sctp_local_addr_list, list) {
112 if (ipv6_addr_equal(&addr->a.v6.sin6_addr, 113 if (ipv6_addr_equal(&addr->a.v6.sin6_addr,
113 &ifa->addr)) { 114 &ifa->addr)) {
115 found = 1;
114 addr->valid = 0; 116 addr->valid = 0;
115 list_del_rcu(&addr->list); 117 list_del_rcu(&addr->list);
116 break; 118 break;
117 } 119 }
118 } 120 }
119 spin_unlock_bh(&sctp_local_addr_lock); 121 spin_unlock_bh(&sctp_local_addr_lock);
120 if (addr && !addr->valid) 122 if (found)
121 call_rcu(&addr->rcu, sctp_local_addr_free); 123 call_rcu(&addr->rcu, sctp_local_addr_free);
122 break; 124 break;
123 } 125 }
@@ -966,7 +968,7 @@ static struct inet6_protocol sctpv6_protocol = {
966 .flags = INET6_PROTO_NOPOLICY | INET6_PROTO_FINAL, 968 .flags = INET6_PROTO_NOPOLICY | INET6_PROTO_FINAL,
967}; 969};
968 970
969static struct sctp_af sctp_ipv6_specific = { 971static struct sctp_af sctp_af_inet6 = {
970 .sa_family = AF_INET6, 972 .sa_family = AF_INET6,
971 .sctp_xmit = sctp_v6_xmit, 973 .sctp_xmit = sctp_v6_xmit,
972 .setsockopt = ipv6_setsockopt, 974 .setsockopt = ipv6_setsockopt,
@@ -998,7 +1000,7 @@ static struct sctp_af sctp_ipv6_specific = {
998#endif 1000#endif
999}; 1001};
1000 1002
1001static struct sctp_pf sctp_pf_inet6_specific = { 1003static struct sctp_pf sctp_pf_inet6 = {
1002 .event_msgname = sctp_inet6_event_msgname, 1004 .event_msgname = sctp_inet6_event_msgname,
1003 .skb_msgname = sctp_inet6_skb_msgname, 1005 .skb_msgname = sctp_inet6_skb_msgname,
1004 .af_supported = sctp_inet6_af_supported, 1006 .af_supported = sctp_inet6_af_supported,
@@ -1008,7 +1010,7 @@ static struct sctp_pf sctp_pf_inet6_specific = {
1008 .supported_addrs = sctp_inet6_supported_addrs, 1010 .supported_addrs = sctp_inet6_supported_addrs,
1009 .create_accept_sk = sctp_v6_create_accept_sk, 1011 .create_accept_sk = sctp_v6_create_accept_sk,
1010 .addr_v4map = sctp_v6_addr_v4map, 1012 .addr_v4map = sctp_v6_addr_v4map,
1011 .af = &sctp_ipv6_specific, 1013 .af = &sctp_af_inet6,
1012}; 1014};
1013 1015
1014/* Initialize IPv6 support and register with socket layer. */ 1016/* Initialize IPv6 support and register with socket layer. */
@@ -1017,10 +1019,10 @@ int sctp_v6_init(void)
1017 int rc; 1019 int rc;
1018 1020
1019 /* Register the SCTP specific PF_INET6 functions. */ 1021 /* Register the SCTP specific PF_INET6 functions. */
1020 sctp_register_pf(&sctp_pf_inet6_specific, PF_INET6); 1022 sctp_register_pf(&sctp_pf_inet6, PF_INET6);
1021 1023
1022 /* Register the SCTP specific AF_INET6 functions. */ 1024 /* Register the SCTP specific AF_INET6 functions. */
1023 sctp_register_af(&sctp_ipv6_specific); 1025 sctp_register_af(&sctp_af_inet6);
1024 1026
1025 rc = proto_register(&sctpv6_prot, 1); 1027 rc = proto_register(&sctpv6_prot, 1);
1026 if (rc) 1028 if (rc)
@@ -1051,7 +1053,7 @@ void sctp_v6_exit(void)
1051 inet6_unregister_protosw(&sctpv6_seqpacket_protosw); 1053 inet6_unregister_protosw(&sctpv6_seqpacket_protosw);
1052 inet6_unregister_protosw(&sctpv6_stream_protosw); 1054 inet6_unregister_protosw(&sctpv6_stream_protosw);
1053 proto_unregister(&sctpv6_prot); 1055 proto_unregister(&sctpv6_prot);
1054 list_del(&sctp_ipv6_specific.list); 1056 list_del(&sctp_af_inet6.list);
1055} 1057}
1056 1058
1057/* Unregister with inet6 layer. */ 1059/* Unregister with inet6 layer. */