]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/sctp/ipv6.c
net: replace remaining __FUNCTION__ occurrences
[linux-2.6-omap-h63xx.git] / net / sctp / ipv6.c
index 9de3ddaa27685daf19d9795727c8d81d67fdc00c..2622215cd3576e1a3d3a1b57ffa450a40ab0e36b 100644 (file)
@@ -1,20 +1,20 @@
-/* SCTP kernel reference Implementation
+/* SCTP kernel implementation
  * (C) Copyright IBM Corp. 2002, 2004
  * Copyright (c) 2001 Nokia, Inc.
  * Copyright (c) 2001 La Monte H.P. Yarroll
  * Copyright (c) 2002-2003 Intel Corp.
  *
- * This file is part of the SCTP kernel reference Implementation
+ * This file is part of the SCTP kernel implementation
  *
  * SCTP over IPv6.
  *
- * The SCTP reference implementation is free software;
+ * This SCTP implementation is free software;
  * you can redistribute it and/or modify it under the terms of
  * the GNU General Public License as published by
  * the Free Software Foundation; either version 2, or (at your option)
  * any later version.
  *
- * The SCTP reference implementation is distributed in the hope that it
+ * This SCTP implementation is distributed in the hope that it
  * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  *                ************************
  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
@@ -223,7 +223,7 @@ static int sctp_v6_xmit(struct sk_buff *skb, struct sctp_transport *transport,
 
        SCTP_DEBUG_PRINTK("%s: skb:%p, len:%d, "
                          "src:" NIP6_FMT " dst:" NIP6_FMT "\n",
-                         __FUNCTION__, skb, skb->len,
+                         __func__, skb, skb->len,
                          NIP6(fl.fl6_src), NIP6(fl.fl6_dst));
 
        SCTP_INC_STATS(SCTP_MIB_OUTSCTPPACKS);
@@ -248,7 +248,7 @@ static struct dst_entry *sctp_v6_get_dst(struct sctp_association *asoc,
 
 
        SCTP_DEBUG_PRINTK("%s: DST=" NIP6_FMT " ",
-                         __FUNCTION__, NIP6(fl.fl6_dst));
+                         __func__, NIP6(fl.fl6_dst));
 
        if (saddr) {
                ipv6_addr_copy(&fl.fl6_src, &saddr->v6.sin6_addr);
@@ -257,7 +257,7 @@ static struct dst_entry *sctp_v6_get_dst(struct sctp_association *asoc,
                        NIP6(fl.fl6_src));
        }
 
-       dst = ip6_route_output(NULL, &fl);
+       dst = ip6_route_output(&init_net, NULL, &fl);
        if (!dst->error) {
                struct rt6_info *rt;
                rt = (struct rt6_info *)dst;
@@ -310,10 +310,11 @@ static void sctp_v6_get_saddr(struct sctp_association *asoc,
 
        SCTP_DEBUG_PRINTK("%s: asoc:%p dst:%p "
                          "daddr:" NIP6_FMT " ",
-                         __FUNCTION__, asoc, dst, NIP6(daddr->v6.sin6_addr));
+                         __func__, asoc, dst, NIP6(daddr->v6.sin6_addr));
 
        if (!asoc) {
-               ipv6_get_saddr(dst, &daddr->v6.sin6_addr,&saddr->v6.sin6_addr);
+               ipv6_dev_get_saddr(dst ? ip6_dst_idev(dst)->dev : NULL,
+                                  &daddr->v6.sin6_addr, &saddr->v6.sin6_addr);
                SCTP_DEBUG_PRINTK("saddr from ipv6_get_saddr: " NIP6_FMT "\n",
                                  NIP6(saddr->v6.sin6_addr));
                return;
@@ -330,7 +331,7 @@ static void sctp_v6_get_saddr(struct sctp_association *asoc,
        list_for_each_entry_rcu(laddr, &bp->address_list, list) {
                if (!laddr->valid)
                        continue;
-               if ((laddr->use_as_src) &&
+               if ((laddr->state == SCTP_ADDR_SRC) &&
                    (laddr->a.sa.sa_family == AF_INET6) &&
                    (scope <= sctp_scope(&laddr->a))) {
                        bmatchlen = sctp_v6_addr_match_len(daddr, &laddr->a);
@@ -348,7 +349,7 @@ static void sctp_v6_get_saddr(struct sctp_association *asoc,
        } else {
                printk(KERN_ERR "%s: asoc:%p Could not find a valid source "
                       "address for the dest:" NIP6_FMT "\n",
-                      __FUNCTION__, asoc, NIP6(daddr->v6.sin6_addr));
+                      __func__, asoc, NIP6(daddr->v6.sin6_addr));
        }
 
        rcu_read_unlock();
@@ -556,7 +557,7 @@ static int sctp_v6_available(union sctp_addr *addr, struct sctp_sock *sp)
        if (!(type & IPV6_ADDR_UNICAST))
                return 0;
 
-       return ipv6_chk_addr(in6, NULL, 0);
+       return ipv6_chk_addr(&init_net, in6, NULL, 0);
 }
 
 /* This function checks if the address is a valid address to be used for
@@ -631,7 +632,7 @@ static struct sock *sctp_v6_create_accept_sk(struct sock *sk,
        struct ipv6_pinfo *newnp, *np = inet6_sk(sk);
        struct sctp6_sock *newsctp6sk;
 
-       newsk = sk_alloc(sk->sk_net, PF_INET6, GFP_KERNEL, sk->sk_prot, 1);
+       newsk = sk_alloc(sk->sk_net, PF_INET6, GFP_KERNEL, sk->sk_prot);
        if (!newsk)
                goto out;
 
@@ -858,7 +859,8 @@ static int sctp_inet6_bind_verify(struct sctp_sock *opt, union sctp_addr *addr)
                        dev = dev_get_by_index(&init_net, addr->v6.sin6_scope_id);
                        if (!dev)
                                return 0;
-                       if (!ipv6_chk_addr(&addr->v6.sin6_addr, dev, 0)) {
+                       if (!ipv6_chk_addr(&init_net, &addr->v6.sin6_addr,
+                                          dev, 0)) {
                                dev_put(dev);
                                return 0;
                        }
@@ -954,9 +956,9 @@ static struct inet_protosw sctpv6_stream_protosw = {
        .flags         = SCTP_PROTOSW_FLAG,
 };
 
-static int sctp6_rcv(struct sk_buff **pskb)
+static int sctp6_rcv(struct sk_buff *skb)
 {
-       return sctp_rcv(*pskb) ? -1 : 0;
+       return sctp_rcv(skb) ? -1 : 0;
 }
 
 static struct inet6_protocol sctpv6_protocol = {
@@ -965,7 +967,7 @@ static struct inet6_protocol sctpv6_protocol = {
        .flags        = INET6_PROTO_NOPOLICY | INET6_PROTO_FINAL,
 };
 
-static struct sctp_af sctp_ipv6_specific = {
+static struct sctp_af sctp_af_inet6 = {
        .sa_family         = AF_INET6,
        .sctp_xmit         = sctp_v6_xmit,
        .setsockopt        = ipv6_setsockopt,
@@ -997,7 +999,7 @@ static struct sctp_af sctp_ipv6_specific = {
 #endif
 };
 
-static struct sctp_pf sctp_pf_inet6_specific = {
+static struct sctp_pf sctp_pf_inet6 = {
        .event_msgname = sctp_inet6_event_msgname,
        .skb_msgname   = sctp_inet6_skb_msgname,
        .af_supported  = sctp_inet6_af_supported,
@@ -1007,7 +1009,7 @@ static struct sctp_pf sctp_pf_inet6_specific = {
        .supported_addrs = sctp_inet6_supported_addrs,
        .create_accept_sk = sctp_v6_create_accept_sk,
        .addr_v4map    = sctp_v6_addr_v4map,
-       .af            = &sctp_ipv6_specific,
+       .af            = &sctp_af_inet6,
 };
 
 /* Initialize IPv6 support and register with socket layer.  */
@@ -1016,10 +1018,10 @@ int sctp_v6_init(void)
        int rc;
 
        /* Register the SCTP specific PF_INET6 functions. */
-       sctp_register_pf(&sctp_pf_inet6_specific, PF_INET6);
+       sctp_register_pf(&sctp_pf_inet6, PF_INET6);
 
        /* Register the SCTP specific AF_INET6 functions. */
-       sctp_register_af(&sctp_ipv6_specific);
+       sctp_register_af(&sctp_af_inet6);
 
        rc = proto_register(&sctpv6_prot, 1);
        if (rc)
@@ -1050,7 +1052,7 @@ void sctp_v6_exit(void)
        inet6_unregister_protosw(&sctpv6_seqpacket_protosw);
        inet6_unregister_protosw(&sctpv6_stream_protosw);
        proto_unregister(&sctpv6_prot);
-       list_del(&sctp_ipv6_specific.list);
+       list_del(&sctp_af_inet6.list);
 }
 
 /* Unregister with inet6 layer. */