diff options
Diffstat (limited to 'net/sctp/protocol.c')
-rw-r--r-- | net/sctp/protocol.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c index 22a16571499c..ad0a4069b95b 100644 --- a/net/sctp/protocol.c +++ b/net/sctp/protocol.c | |||
@@ -628,6 +628,7 @@ static int sctp_inetaddr_event(struct notifier_block *this, unsigned long ev, | |||
628 | struct in_ifaddr *ifa = (struct in_ifaddr *)ptr; | 628 | struct in_ifaddr *ifa = (struct in_ifaddr *)ptr; |
629 | struct sctp_sockaddr_entry *addr = NULL; | 629 | struct sctp_sockaddr_entry *addr = NULL; |
630 | struct sctp_sockaddr_entry *temp; | 630 | struct sctp_sockaddr_entry *temp; |
631 | int found = 0; | ||
631 | 632 | ||
632 | switch (ev) { | 633 | switch (ev) { |
633 | case NETDEV_UP: | 634 | case NETDEV_UP: |
@@ -647,13 +648,14 @@ static int sctp_inetaddr_event(struct notifier_block *this, unsigned long ev, | |||
647 | list_for_each_entry_safe(addr, temp, | 648 | list_for_each_entry_safe(addr, temp, |
648 | &sctp_local_addr_list, list) { | 649 | &sctp_local_addr_list, list) { |
649 | if (addr->a.v4.sin_addr.s_addr == ifa->ifa_local) { | 650 | if (addr->a.v4.sin_addr.s_addr == ifa->ifa_local) { |
651 | found = 1; | ||
650 | addr->valid = 0; | 652 | addr->valid = 0; |
651 | list_del_rcu(&addr->list); | 653 | list_del_rcu(&addr->list); |
652 | break; | 654 | break; |
653 | } | 655 | } |
654 | } | 656 | } |
655 | spin_unlock_bh(&sctp_local_addr_lock); | 657 | spin_unlock_bh(&sctp_local_addr_lock); |
656 | if (addr && !addr->valid) | 658 | if (found) |
657 | call_rcu(&addr->rcu, sctp_local_addr_free); | 659 | call_rcu(&addr->rcu, sctp_local_addr_free); |
658 | break; | 660 | break; |
659 | } | 661 | } |
@@ -832,7 +834,7 @@ static inline int sctp_v4_xmit(struct sk_buff *skb, | |||
832 | return ip_queue_xmit(skb, ipfragok); | 834 | return ip_queue_xmit(skb, ipfragok); |
833 | } | 835 | } |
834 | 836 | ||
835 | static struct sctp_af sctp_ipv4_specific; | 837 | static struct sctp_af sctp_af_inet; |
836 | 838 | ||
837 | static struct sctp_pf sctp_pf_inet = { | 839 | static struct sctp_pf sctp_pf_inet = { |
838 | .event_msgname = sctp_inet_event_msgname, | 840 | .event_msgname = sctp_inet_event_msgname, |
@@ -844,7 +846,7 @@ static struct sctp_pf sctp_pf_inet = { | |||
844 | .supported_addrs = sctp_inet_supported_addrs, | 846 | .supported_addrs = sctp_inet_supported_addrs, |
845 | .create_accept_sk = sctp_v4_create_accept_sk, | 847 | .create_accept_sk = sctp_v4_create_accept_sk, |
846 | .addr_v4map = sctp_v4_addr_v4map, | 848 | .addr_v4map = sctp_v4_addr_v4map, |
847 | .af = &sctp_ipv4_specific, | 849 | .af = &sctp_af_inet |
848 | }; | 850 | }; |
849 | 851 | ||
850 | /* Notifier for inetaddr addition/deletion events. */ | 852 | /* Notifier for inetaddr addition/deletion events. */ |
@@ -906,7 +908,7 @@ static struct net_protocol sctp_protocol = { | |||
906 | }; | 908 | }; |
907 | 909 | ||
908 | /* IPv4 address related functions. */ | 910 | /* IPv4 address related functions. */ |
909 | static struct sctp_af sctp_ipv4_specific = { | 911 | static struct sctp_af sctp_af_inet = { |
910 | .sa_family = AF_INET, | 912 | .sa_family = AF_INET, |
911 | .sctp_xmit = sctp_v4_xmit, | 913 | .sctp_xmit = sctp_v4_xmit, |
912 | .setsockopt = ip_setsockopt, | 914 | .setsockopt = ip_setsockopt, |
@@ -1192,7 +1194,7 @@ SCTP_STATIC __init int sctp_init(void) | |||
1192 | sctp_sysctl_register(); | 1194 | sctp_sysctl_register(); |
1193 | 1195 | ||
1194 | INIT_LIST_HEAD(&sctp_address_families); | 1196 | INIT_LIST_HEAD(&sctp_address_families); |
1195 | sctp_register_af(&sctp_ipv4_specific); | 1197 | sctp_register_af(&sctp_af_inet); |
1196 | 1198 | ||
1197 | status = proto_register(&sctp_prot, 1); | 1199 | status = proto_register(&sctp_prot, 1); |
1198 | if (status) | 1200 | if (status) |
@@ -1249,7 +1251,7 @@ err_v6_init: | |||
1249 | proto_unregister(&sctp_prot); | 1251 | proto_unregister(&sctp_prot); |
1250 | err_proto_register: | 1252 | err_proto_register: |
1251 | sctp_sysctl_unregister(); | 1253 | sctp_sysctl_unregister(); |
1252 | list_del(&sctp_ipv4_specific.list); | 1254 | list_del(&sctp_af_inet.list); |
1253 | free_pages((unsigned long)sctp_port_hashtable, | 1255 | free_pages((unsigned long)sctp_port_hashtable, |
1254 | get_order(sctp_port_hashsize * | 1256 | get_order(sctp_port_hashsize * |
1255 | sizeof(struct sctp_bind_hashbucket))); | 1257 | sizeof(struct sctp_bind_hashbucket))); |
@@ -1299,7 +1301,7 @@ SCTP_STATIC __exit void sctp_exit(void) | |||
1299 | inet_unregister_protosw(&sctp_seqpacket_protosw); | 1301 | inet_unregister_protosw(&sctp_seqpacket_protosw); |
1300 | 1302 | ||
1301 | sctp_sysctl_unregister(); | 1303 | sctp_sysctl_unregister(); |
1302 | list_del(&sctp_ipv4_specific.list); | 1304 | list_del(&sctp_af_inet.list); |
1303 | 1305 | ||
1304 | free_pages((unsigned long)sctp_assoc_hashtable, | 1306 | free_pages((unsigned long)sctp_assoc_hashtable, |
1305 | get_order(sctp_assoc_hashsize * | 1307 | get_order(sctp_assoc_hashsize * |