]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - net/sctp/protocol.c
net: constify struct net_protocol
[net-next-2.6.git] / net / sctp / protocol.c
index a76da657244a8e38fdb692426857130034da5fd0..c557f1fb1c66ac79647ff91cf80f72c59e0baf05 100644 (file)
@@ -431,16 +431,14 @@ static int sctp_v4_available(union sctp_addr *addr, struct sctp_sock *sp)
  * of requested destination address, sender and receiver
  * SHOULD include all of its addresses with level greater
  * than or equal to L.
+ *
+ * IPv4 scoping can be controlled through sysctl option
+ * net.sctp.addr_scope_policy
  */
 static sctp_scope_t sctp_v4_scope(union sctp_addr *addr)
 {
        sctp_scope_t retval;
 
-       /* Should IPv4 scoping be a sysctl configurable option
-        * so users can turn it off (default on) for certain
-        * unconventional networking environments?
-        */
-
        /* Check for unusable SCTP addresses. */
        if (IS_IPV4_UNUSABLE_ADDRESS(addr->v4.sin_addr.s_addr)) {
                retval =  SCTP_SCOPE_UNUSABLE;
@@ -926,7 +924,7 @@ static struct inet_protosw sctp_stream_protosw = {
 };
 
 /* Register with IP layer.  */
-static struct net_protocol sctp_protocol = {
+static const struct net_protocol sctp_protocol = {
        .handler     = sctp_rcv,
        .err_handler = sctp_v4_err,
        .no_policy   = 1,
@@ -1259,6 +1257,9 @@ SCTP_STATIC __init int sctp_init(void)
        /* Disable AUTH by default. */
        sctp_auth_enable = 0;
 
+       /* Set SCOPE policy to enabled */
+       sctp_scope_policy = SCTP_SCOPE_POLICY_ENABLE;
+
        sctp_sysctl_register();
 
        INIT_LIST_HEAD(&sctp_address_families);