]> Pileus Git - ~andy/linux/blobdiff - net/sctp/protocol.c
Revert "net: sctp: convert sctp_checksum_disable module param into sctp sysctl"
[~andy/linux] / net / sctp / protocol.c
index eaee00c61139b974572e8c4aed425176f3ae2894..5e17092f4adacbf0335dc33bcbde5a1f830b43df 100644 (file)
  *
  * Please send any bug reports or fixes you make to the
  * email address(es):
- *    lksctp developers <lksctp-developers@lists.sourceforge.net>
- *
- * Or submit a bug report through the following website:
- *    http://www.sf.net/projects/lksctp
+ *    lksctp developers <linux-sctp@vger.kernel.org>
  *
  * Written or modified by:
  *    La Monte H.P. Yarroll <piggy@acm.org>
@@ -41,9 +38,6 @@
  *    Sridhar Samudrala <sri@us.ibm.com>
  *    Daisy Chang <daisyc@us.ibm.com>
  *    Ardelle Fan <ardelle.fan@intel.com>
- *
- * Any bugs reported given to us we will try to fix... any fixes shared will
- * be incorporated into the next SCTP release.
  */
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
@@ -153,7 +147,7 @@ static void sctp_v4_copy_addrlist(struct list_head *addrlist,
 
        for (ifa = in_dev->ifa_list; ifa; ifa = ifa->ifa_next) {
                /* Add the address to the local list.  */
-               addr = t_new(struct sctp_sockaddr_entry, GFP_ATOMIC);
+               addr = kzalloc(sizeof(*addr), GFP_ATOMIC);
                if (addr) {
                        addr->a.v4.sin_family = AF_INET;
                        addr->a.v4.sin_port = 0;
@@ -178,7 +172,7 @@ static void sctp_get_local_addr_list(struct net *net)
 
        rcu_read_lock();
        for_each_netdev_rcu(net, dev) {
-               __list_for_each(pos, &sctp_address_families) {
+               list_for_each(pos, &sctp_address_families) {
                        af = list_entry(pos, struct sctp_af, list);
                        af->copy_addrlist(&net->sctp.local_addr_list, dev);
                }
@@ -451,8 +445,8 @@ static void sctp_v4_get_dst(struct sctp_transport *t, union sctp_addr *saddr,
                fl4->fl4_sport = saddr->v4.sin_port;
        }
 
-       SCTP_DEBUG_PRINTK("%s: DST:%pI4, SRC:%pI4 - ",
-                         __func__, &fl4->daddr, &fl4->saddr);
+       pr_debug("%s: dst:%pI4, src:%pI4 - ", __func__, &fl4->daddr,
+                &fl4->saddr);
 
        rt = ip_route_output_key(sock_net(sk), fl4);
        if (!IS_ERR(rt))
@@ -513,10 +507,10 @@ out_unlock:
 out:
        t->dst = dst;
        if (dst)
-               SCTP_DEBUG_PRINTK("rt_dst:%pI4, rt_src:%pI4\n",
-                                 &fl4->daddr, &fl4->saddr);
+               pr_debug("rt_dst:%pI4, rt_src:%pI4\n",
+                        &fl4->daddr, &fl4->saddr);
        else
-               SCTP_DEBUG_PRINTK("NO ROUTE\n");
+               pr_debug("no route\n");
 }
 
 /* For v4, the source address is cached in the route entry(dst). So no need
@@ -604,9 +598,9 @@ static void sctp_addr_wq_timeout_handler(unsigned long arg)
        spin_lock_bh(&net->sctp.addr_wq_lock);
 
        list_for_each_entry_safe(addrw, temp, &net->sctp.addr_waitq, list) {
-               SCTP_DEBUG_PRINTK_IPADDR("sctp_addrwq_timo_handler: the first ent in wq %p is ",
-                   " for cmd %d at entry %p\n", &net->sctp.addr_waitq, &addrw->a, addrw->state,
-                   addrw);
+               pr_debug("%s: the first ent in wq:%p is addr:%pISc for cmd:%d at "
+                        "entry:%p\n", __func__, &net->sctp.addr_waitq, &addrw->a.sa,
+                        addrw->state, addrw);
 
 #if IS_ENABLED(CONFIG_IPV6)
                /* Now we send an ASCONF for each association */
@@ -623,8 +617,10 @@ static void sctp_addr_wq_timeout_handler(unsigned long arg)
                            addrw->state == SCTP_ADDR_NEW) {
                                unsigned long timeo_val;
 
-                               SCTP_DEBUG_PRINTK("sctp_timo_handler: this is on DAD, trying %d sec later\n",
-                                   SCTP_ADDRESS_TICK_DELAY);
+                               pr_debug("%s: this is on DAD, trying %d sec "
+                                        "later\n", __func__,
+                                        SCTP_ADDRESS_TICK_DELAY);
+
                                timeo_val = jiffies;
                                timeo_val += msecs_to_jiffies(SCTP_ADDRESS_TICK_DELAY);
                                mod_timer(&net->sctp.addr_wq_timer, timeo_val);
@@ -641,7 +637,7 @@ static void sctp_addr_wq_timeout_handler(unsigned long arg)
                                continue;
                        sctp_bh_lock_sock(sk);
                        if (sctp_asconf_mgmt(sp, addrw) < 0)
-                               SCTP_DEBUG_PRINTK("sctp_addrwq_timo_handler: sctp_asconf_mgmt failed\n");
+                               pr_debug("%s: sctp_asconf_mgmt failed\n", __func__);
                        sctp_bh_unlock_sock(sk);
                }
 #if IS_ENABLED(CONFIG_IPV6)
@@ -707,9 +703,10 @@ void sctp_addr_wq_mgmt(struct net *net, struct sctp_sockaddr_entry *addr, int cm
        addrw = sctp_addr_wq_lookup(net, addr);
        if (addrw) {
                if (addrw->state != cmd) {
-                       SCTP_DEBUG_PRINTK_IPADDR("sctp_addr_wq_mgmt offsets existing entry for %d ",
-                           " in wq %p\n", addrw->state, &addrw->a,
-                           &net->sctp.addr_waitq);
+                       pr_debug("%s: offsets existing entry for %d, addr:%pISc "
+                                "in wq:%p\n", __func__, addrw->state, &addrw->a.sa,
+                                &net->sctp.addr_waitq);
+
                        list_del(&addrw->list);
                        kfree(addrw);
                }
@@ -725,8 +722,9 @@ void sctp_addr_wq_mgmt(struct net *net, struct sctp_sockaddr_entry *addr, int cm
        }
        addrw->state = cmd;
        list_add_tail(&addrw->list, &net->sctp.addr_waitq);
-       SCTP_DEBUG_PRINTK_IPADDR("sctp_addr_wq_mgmt add new entry for cmd:%d ",
-           " in wq %p\n", addrw->state, &addrw->a, &net->sctp.addr_waitq);
+
+       pr_debug("%s: add new entry for cmd:%d, addr:%pISc in wq:%p\n",
+                __func__, addrw->state, &addrw->a.sa, &net->sctp.addr_waitq);
 
        if (!timer_pending(&net->sctp.addr_wq_timer)) {
                timeo_val = jiffies;
@@ -952,15 +950,14 @@ static inline int sctp_v4_xmit(struct sk_buff *skb,
 {
        struct inet_sock *inet = inet_sk(skb->sk);
 
-       SCTP_DEBUG_PRINTK("%s: skb:%p, len:%d, src:%pI4, dst:%pI4\n",
-                         __func__, skb, skb->len,
-                         &transport->fl.u.ip4.saddr,
-                         &transport->fl.u.ip4.daddr);
+       pr_debug("%s: skb:%p, len:%d, src:%pI4, dst:%pI4\n", __func__, skb,
+                skb->len, &transport->fl.u.ip4.saddr, &transport->fl.u.ip4.daddr);
 
        inet->pmtudisc = transport->param_flags & SPP_PMTUD_ENABLE ?
                         IP_PMTUDISC_DO : IP_PMTUDISC_DONT;
 
        SCTP_INC_STATS(sock_net(&inet->sk), SCTP_MIB_OUTSCTPPACKS);
+
        return ip_queue_xmit(skb, &transport->fl);
 }
 
@@ -1312,7 +1309,7 @@ static struct pernet_operations sctp_net_ops = {
 };
 
 /* Initialize the universe into something sensible.  */
-SCTP_STATIC __init int sctp_init(void)
+static __init int sctp_init(void)
 {
        int i;
        int status = -EINVAL;
@@ -1321,9 +1318,8 @@ SCTP_STATIC __init int sctp_init(void)
        int max_share;
        int order;
 
-       /* SCTP_DEBUG sanity check. */
-       if (!sctp_sanity_check())
-               goto out;
+       BUILD_BUG_ON(sizeof(struct sctp_ulpevent) >
+                    sizeof(((struct sk_buff *) 0)->cb));
 
        /* Allocate bind_bucket and chunk caches. */
        status = -ENOBUFS;
@@ -1499,7 +1495,7 @@ err_chunk_cachep:
 }
 
 /* Exit handler for the SCTP protocol.  */
-SCTP_STATIC __exit void sctp_exit(void)
+static __exit void sctp_exit(void)
 {
        /* BUG.  This should probably do something useful like clean
         * up all the remaining associations and all that memory.
@@ -1545,7 +1541,7 @@ module_exit(sctp_exit);
  */
 MODULE_ALIAS("net-pf-" __stringify(PF_INET) "-proto-132");
 MODULE_ALIAS("net-pf-" __stringify(PF_INET6) "-proto-132");
-MODULE_AUTHOR("Linux Kernel SCTP developers <lksctp-developers@lists.sourceforge.net>");
+MODULE_AUTHOR("Linux Kernel SCTP developers <linux-sctp@vger.kernel.org>");
 MODULE_DESCRIPTION("Support for the SCTP protocol (RFC2960)");
 module_param_named(no_checksums, sctp_checksum_disable, bool, 0644);
 MODULE_PARM_DESC(no_checksums, "Disable checksums computing and verification");