diff options
author | Sridhar Samudrala <sri@us.ibm.com> | 2006-12-13 19:26:26 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-12-13 19:48:27 -0500 |
commit | 29c7cf96186ac14ce7380633f690fc39732ff03a (patch) | |
tree | ccc95adc0e1185469e77a1adcae1d300d0b534d1 /include/net | |
parent | 6931ba7cef3991fbb970997d33e24139ccdc3c2c (diff) |
[SCTP]: Handle address add/delete events in a more efficient way.
Currently in SCTP, we maintain a local address list by rebuilding the whole
list from the device list whenever we get a address add/delete event.
This patch fixes it by only adding/deleting the address for which we
receive the event.
Also removed the sctp_local_addr_lock() which is no longer needed as we
now use list_for_each_safe() to traverse this list. This fixes the bugs
in sctp_copy_laddrs_xxx() routines where we do copy_to_user() while
holding this lock.
Signed-off-by: Sridhar Samudrala <sri@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/sctp/structs.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index c089f93ba59..b00d85e14fe 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
@@ -201,13 +201,12 @@ extern struct sctp_globals { | |||
201 | struct sctp_bind_hashbucket *port_hashtable; | 201 | struct sctp_bind_hashbucket *port_hashtable; |
202 | 202 | ||
203 | /* This is the global local address list. | 203 | /* This is the global local address list. |
204 | * We actively maintain this complete list of interfaces on | 204 | * We actively maintain this complete list of addresses on |
205 | * the system by catching routing events. | 205 | * the system by catching address add/delete events. |
206 | * | 206 | * |
207 | * It is a list of sctp_sockaddr_entry. | 207 | * It is a list of sctp_sockaddr_entry. |
208 | */ | 208 | */ |
209 | struct list_head local_addr_list; | 209 | struct list_head local_addr_list; |
210 | spinlock_t local_addr_lock; | ||
211 | 210 | ||
212 | /* Flag to indicate if addip is enabled. */ | 211 | /* Flag to indicate if addip is enabled. */ |
213 | int addip_enable; | 212 | int addip_enable; |
@@ -243,7 +242,6 @@ extern struct sctp_globals { | |||
243 | #define sctp_port_alloc_lock (sctp_globals.port_alloc_lock) | 242 | #define sctp_port_alloc_lock (sctp_globals.port_alloc_lock) |
244 | #define sctp_port_hashtable (sctp_globals.port_hashtable) | 243 | #define sctp_port_hashtable (sctp_globals.port_hashtable) |
245 | #define sctp_local_addr_list (sctp_globals.local_addr_list) | 244 | #define sctp_local_addr_list (sctp_globals.local_addr_list) |
246 | #define sctp_local_addr_lock (sctp_globals.local_addr_lock) | ||
247 | #define sctp_addip_enable (sctp_globals.addip_enable) | 245 | #define sctp_addip_enable (sctp_globals.addip_enable) |
248 | #define sctp_prsctp_enable (sctp_globals.prsctp_enable) | 246 | #define sctp_prsctp_enable (sctp_globals.prsctp_enable) |
249 | 247 | ||