diff options
Diffstat (limited to 'net/sctp/bind_addr.c')
-rw-r--r-- | net/sctp/bind_addr.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/net/sctp/bind_addr.c b/net/sctp/bind_addr.c index 6d5944a745d4..13a6fba41077 100644 --- a/net/sctp/bind_addr.c +++ b/net/sctp/bind_addr.c | |||
@@ -510,9 +510,28 @@ int sctp_in_scope(const union sctp_addr *addr, sctp_scope_t scope) | |||
510 | * of requested destination address, sender and receiver | 510 | * of requested destination address, sender and receiver |
511 | * SHOULD include all of its addresses with level greater | 511 | * SHOULD include all of its addresses with level greater |
512 | * than or equal to L. | 512 | * than or equal to L. |
513 | * | ||
514 | * Address scoping can be selectively controlled via sysctl | ||
515 | * option | ||
513 | */ | 516 | */ |
514 | if (addr_scope <= scope) | 517 | switch (sctp_scope_policy) { |
518 | case SCTP_SCOPE_POLICY_DISABLE: | ||
515 | return 1; | 519 | return 1; |
520 | case SCTP_SCOPE_POLICY_ENABLE: | ||
521 | if (addr_scope <= scope) | ||
522 | return 1; | ||
523 | break; | ||
524 | case SCTP_SCOPE_POLICY_PRIVATE: | ||
525 | if (addr_scope <= scope || SCTP_SCOPE_PRIVATE == addr_scope) | ||
526 | return 1; | ||
527 | break; | ||
528 | case SCTP_SCOPE_POLICY_LINK: | ||
529 | if (addr_scope <= scope || SCTP_SCOPE_LINK == addr_scope) | ||
530 | return 1; | ||
531 | break; | ||
532 | default: | ||
533 | break; | ||
534 | } | ||
516 | 535 | ||
517 | return 0; | 536 | return 0; |
518 | } | 537 | } |