aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/bind_addr.c
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2012-10-28 14:28:52 -0400
committerJiri Kosina <jkosina@suse.cz>2012-10-28 14:29:19 -0400
commit3bd7bf1f0fe14f591c089ae61bbfa9bd356f178a (patch)
tree0058693cc9e70b7461dae551f8a19aff2efd13ca /net/sctp/bind_addr.c
parentf16f84937d769c893492160b1a8c3672e3992beb (diff)
parente657e078d3dfa9f96976db7a2b5fd7d7c9f1f1a6 (diff)
Merge branch 'master' into for-next
Sync up with Linus' tree to be able to apply Cesar's patch against newer version of the code. Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'net/sctp/bind_addr.c')
-rw-r--r--net/sctp/bind_addr.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/net/sctp/bind_addr.c b/net/sctp/bind_addr.c
index 4ece451c8d27..d886b3bf84f5 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,8 +456,8 @@ 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(net, 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
463 * well as the remote peer. 463 * well as the remote peer.
@@ -494,7 +494,7 @@ int sctp_is_any(struct sock *sk, const union sctp_addr *addr)
494} 494}
495 495
496/* Is 'addr' valid for 'scope'? */ 496/* Is 'addr' valid for 'scope'? */
497int sctp_in_scope(const union sctp_addr *addr, sctp_scope_t scope) 497int sctp_in_scope(struct net *net, const union sctp_addr *addr, sctp_scope_t scope)
498{ 498{
499 sctp_scope_t addr_scope = sctp_scope(addr); 499 sctp_scope_t addr_scope = sctp_scope(addr);
500 500
@@ -512,7 +512,7 @@ int sctp_in_scope(const union sctp_addr *addr, sctp_scope_t scope)
512 * Address scoping can be selectively controlled via sysctl 512 * Address scoping can be selectively controlled via sysctl
513 * option 513 * option
514 */ 514 */
515 switch (sctp_scope_policy) { 515 switch (net->sctp.scope_policy) {
516 case SCTP_SCOPE_POLICY_DISABLE: 516 case SCTP_SCOPE_POLICY_DISABLE:
517 return 1; 517 return 1;
518 case SCTP_SCOPE_POLICY_ENABLE: 518 case SCTP_SCOPE_POLICY_ENABLE: