aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/bind_addr.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2012-08-06 04:42:04 -0400
committerDavid S. Miller <davem@davemloft.net>2012-08-15 02:12:17 -0400
commit4db67e808640e3934d82ce61ee8e2e89fd877ba8 (patch)
treeff02e330187c41970c75f6d8a6275e1cc25165f0 /net/sctp/bind_addr.c
parent4110cc255ddec59c79fba4d71cdd948d0a382140 (diff)
sctp: Make the address lists per network namespace
- Move the address lists into struct net - Add per network namespace initialization and cleanup - Pass around struct net so it is everywhere I need it. - Rename all of the global variable references into references to the variables moved into struct net Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> Acked-by: Vlad Yasevich <vyasevich@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/bind_addr.c')
-rw-r--r--net/sctp/bind_addr.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/net/sctp/bind_addr.c b/net/sctp/bind_addr.c
index 4ece451c8d27..a85ce4b3e574 100644
--- a/net/sctp/bind_addr.c
+++ b/net/sctp/bind_addr.c
@@ -52,8 +52,8 @@
52#include <net/sctp/sm.h> 52#include <net/sctp/sm.h>
53 53
54/* Forward declarations for internal helpers. */ 54/* Forward declarations for internal helpers. */
55static int sctp_copy_one_addr(struct sctp_bind_addr *, union sctp_addr *, 55static int sctp_copy_one_addr(struct net *, struct sctp_bind_addr *,
56 sctp_scope_t scope, gfp_t gfp, 56 union sctp_addr *, sctp_scope_t scope, gfp_t gfp,
57 int flags); 57 int flags);
58static void sctp_bind_addr_clean(struct sctp_bind_addr *); 58static void sctp_bind_addr_clean(struct sctp_bind_addr *);
59 59
@@ -62,7 +62,7 @@ static void sctp_bind_addr_clean(struct sctp_bind_addr *);
62/* Copy 'src' to 'dest' taking 'scope' into account. Omit addresses 62/* Copy 'src' to 'dest' taking 'scope' into account. Omit addresses
63 * in 'src' which have a broader scope than 'scope'. 63 * in 'src' which have a broader scope than 'scope'.
64 */ 64 */
65int sctp_bind_addr_copy(struct sctp_bind_addr *dest, 65int sctp_bind_addr_copy(struct net *net, struct sctp_bind_addr *dest,
66 const struct sctp_bind_addr *src, 66 const struct sctp_bind_addr *src,
67 sctp_scope_t scope, gfp_t gfp, 67 sctp_scope_t scope, gfp_t gfp,
68 int flags) 68 int flags)
@@ -75,7 +75,7 @@ int sctp_bind_addr_copy(struct sctp_bind_addr *dest,
75 75
76 /* Extract the addresses which are relevant for this scope. */ 76 /* Extract the addresses which are relevant for this scope. */
77 list_for_each_entry(addr, &src->address_list, list) { 77 list_for_each_entry(addr, &src->address_list, list) {
78 error = sctp_copy_one_addr(dest, &addr->a, scope, 78 error = sctp_copy_one_addr(net, dest, &addr->a, scope,
79 gfp, flags); 79 gfp, flags);
80 if (error < 0) 80 if (error < 0)
81 goto out; 81 goto out;
@@ -87,7 +87,7 @@ int sctp_bind_addr_copy(struct sctp_bind_addr *dest,
87 */ 87 */
88 if (list_empty(&dest->address_list) && (SCTP_SCOPE_GLOBAL == scope)) { 88 if (list_empty(&dest->address_list) && (SCTP_SCOPE_GLOBAL == scope)) {
89 list_for_each_entry(addr, &src->address_list, list) { 89 list_for_each_entry(addr, &src->address_list, list) {
90 error = sctp_copy_one_addr(dest, &addr->a, 90 error = sctp_copy_one_addr(net, dest, &addr->a,
91 SCTP_SCOPE_LINK, gfp, 91 SCTP_SCOPE_LINK, gfp,
92 flags); 92 flags);
93 if (error < 0) 93 if (error < 0)
@@ -448,7 +448,7 @@ union sctp_addr *sctp_find_unmatch_addr(struct sctp_bind_addr *bp,
448} 448}
449 449
450/* Copy out addresses from the global local address list. */ 450/* Copy out addresses from the global local address list. */
451static int sctp_copy_one_addr(struct sctp_bind_addr *dest, 451static int sctp_copy_one_addr(struct net *net, struct sctp_bind_addr *dest,
452 union sctp_addr *addr, 452 union sctp_addr *addr,
453 sctp_scope_t scope, gfp_t gfp, 453 sctp_scope_t scope, gfp_t gfp,
454 int flags) 454 int flags)
@@ -456,7 +456,7 @@ static int sctp_copy_one_addr(struct sctp_bind_addr *dest,
456 int error = 0; 456 int error = 0;
457 457
458 if (sctp_is_any(NULL, addr)) { 458 if (sctp_is_any(NULL, addr)) {
459 error = sctp_copy_local_addr_list(dest, scope, gfp, flags); 459 error = sctp_copy_local_addr_list(net, dest, scope, gfp, flags);
460 } else if (sctp_in_scope(addr, scope)) { 460 } else if (sctp_in_scope(addr, scope)) {
461 /* Now that the address is in scope, check to see if 461 /* Now that the address is in scope, check to see if
462 * the address type is supported by local sock as 462 * the address type is supported by local sock as