linux/net/sctp/ipv6.c
<<
>>
Prefs
   1/* SCTP kernel implementation
   2 * (C) Copyright IBM Corp. 2002, 2004
   3 * Copyright (c) 2001 Nokia, Inc.
   4 * Copyright (c) 2001 La Monte H.P. Yarroll
   5 * Copyright (c) 2002-2003 Intel Corp.
   6 *
   7 * This file is part of the SCTP kernel implementation
   8 *
   9 * SCTP over IPv6.
  10 *
  11 * This SCTP implementation is free software;
  12 * you can redistribute it and/or modify it under the terms of
  13 * the GNU General Public License as published by
  14 * the Free Software Foundation; either version 2, or (at your option)
  15 * any later version.
  16 *
  17 * This SCTP implementation is distributed in the hope that it
  18 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  19 *                 ************************
  20 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  21 * See the GNU General Public License for more details.
  22 *
  23 * You should have received a copy of the GNU General Public License
  24 * along with GNU CC; see the file COPYING.  If not, write to
  25 * the Free Software Foundation, 59 Temple Place - Suite 330,
  26 * Boston, MA 02111-1307, USA.
  27 *
  28 * Please send any bug reports or fixes you make to the
  29 * email address(es):
  30 *    lksctp developers <lksctp-developers@lists.sourceforge.net>
  31 *
  32 * Or submit a bug report through the following website:
  33 *    http://www.sf.net/projects/lksctp
  34 *
  35 * Written or modified by:
  36 *    Le Yanqun             <yanqun.le@nokia.com>
  37 *    Hui Huang             <hui.huang@nokia.com>
  38 *    La Monte H.P. Yarroll <piggy@acm.org>
  39 *    Sridhar Samudrala     <sri@us.ibm.com>
  40 *    Jon Grimm             <jgrimm@us.ibm.com>
  41 *    Ardelle Fan           <ardelle.fan@intel.com>
  42 *
  43 * Based on:
  44 *      linux/net/ipv6/tcp_ipv6.c
  45 *
  46 * Any bugs reported given to us we will try to fix... any fixes shared will
  47 * be incorporated into the next SCTP release.
  48 */
  49
  50#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
  51
  52#include <linux/module.h>
  53#include <linux/errno.h>
  54#include <linux/types.h>
  55#include <linux/socket.h>
  56#include <linux/sockios.h>
  57#include <linux/net.h>
  58#include <linux/in.h>
  59#include <linux/in6.h>
  60#include <linux/netdevice.h>
  61#include <linux/init.h>
  62#include <linux/ipsec.h>
  63#include <linux/slab.h>
  64
  65#include <linux/ipv6.h>
  66#include <linux/icmpv6.h>
  67#include <linux/random.h>
  68#include <linux/seq_file.h>
  69
  70#include <net/protocol.h>
  71#include <net/ndisc.h>
  72#include <net/ip.h>
  73#include <net/ipv6.h>
  74#include <net/transp_v6.h>
  75#include <net/addrconf.h>
  76#include <net/ip6_route.h>
  77#include <net/inet_common.h>
  78#include <net/inet_ecn.h>
  79#include <net/sctp/sctp.h>
  80
  81#include <asm/uaccess.h>
  82
  83static inline int sctp_v6_addr_match_len(union sctp_addr *s1,
  84                                         union sctp_addr *s2);
  85static void sctp_v6_to_addr(union sctp_addr *addr, struct in6_addr *saddr,
  86                              __be16 port);
  87static int sctp_v6_cmp_addr(const union sctp_addr *addr1,
  88                            const union sctp_addr *addr2);
  89
  90/* Event handler for inet6 address addition/deletion events.
  91 * The sctp_local_addr_list needs to be protocted by a spin lock since
  92 * multiple notifiers (say IPv4 and IPv6) may be running at the same
  93 * time and thus corrupt the list.
  94 * The reader side is protected with RCU.
  95 */
  96static int sctp_inet6addr_event(struct notifier_block *this, unsigned long ev,
  97                                void *ptr)
  98{
  99        struct inet6_ifaddr *ifa = (struct inet6_ifaddr *)ptr;
 100        struct sctp_sockaddr_entry *addr = NULL;
 101        struct sctp_sockaddr_entry *temp;
 102        struct net *net = dev_net(ifa->idev->dev);
 103        int found = 0;
 104
 105        switch (ev) {
 106        case NETDEV_UP:
 107                addr = kmalloc(sizeof(struct sctp_sockaddr_entry), GFP_ATOMIC);
 108                if (addr) {
 109                        addr->a.v6.sin6_family = AF_INET6;
 110                        addr->a.v6.sin6_port = 0;
 111                        addr->a.v6.sin6_addr = ifa->addr;
 112                        addr->a.v6.sin6_scope_id = ifa->idev->dev->ifindex;
 113                        addr->valid = 1;
 114                        spin_lock_bh(&net->sctp.local_addr_lock);
 115                        list_add_tail_rcu(&addr->list, &net->sctp.local_addr_list);
 116                        sctp_addr_wq_mgmt(net, addr, SCTP_ADDR_NEW);
 117                        spin_unlock_bh(&net->sctp.local_addr_lock);
 118                }
 119                break;
 120        case NETDEV_DOWN:
 121                spin_lock_bh(&net->sctp.local_addr_lock);
 122                list_for_each_entry_safe(addr, temp,
 123                                        &net->sctp.local_addr_list, list) {
 124                        if (addr->a.sa.sa_family == AF_INET6 &&
 125                                        ipv6_addr_equal(&addr->a.v6.sin6_addr,
 126                                                &ifa->addr)) {
 127                                sctp_addr_wq_mgmt(net, addr, SCTP_ADDR_DEL);
 128                                found = 1;
 129                                addr->valid = 0;
 130                                list_del_rcu(&addr->list);
 131                                break;
 132                        }
 133                }
 134                spin_unlock_bh(&net->sctp.local_addr_lock);
 135                if (found)
 136                        kfree_rcu(addr, rcu);
 137                break;
 138        }
 139
 140        return NOTIFY_DONE;
 141}
 142
 143static struct notifier_block sctp_inet6addr_notifier = {
 144        .notifier_call = sctp_inet6addr_event,
 145};
 146
 147/* ICMP error handler. */
 148SCTP_STATIC void sctp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
 149                             u8 type, u8 code, int offset, __be32 info)
 150{
 151        struct inet6_dev *idev;
 152        struct sock *sk;
 153        struct sctp_association *asoc;
 154        struct sctp_transport *transport;
 155        struct ipv6_pinfo *np;
 156        sk_buff_data_t saveip, savesctp;
 157        int err;
 158        struct net *net = dev_net(skb->dev);
 159
 160        idev = in6_dev_get(skb->dev);
 161
 162        /* Fix up skb to look at the embedded net header. */
 163        saveip   = skb->network_header;
 164        savesctp = skb->transport_header;
 165        skb_reset_network_header(skb);
 166        skb_set_transport_header(skb, offset);
 167        sk = sctp_err_lookup(net, AF_INET6, skb, sctp_hdr(skb), &asoc, &transport);
 168        /* Put back, the original pointers. */
 169        skb->network_header   = saveip;
 170        skb->transport_header = savesctp;
 171        if (!sk) {
 172                ICMP6_INC_STATS_BH(net, idev, ICMP6_MIB_INERRORS);
 173                goto out;
 174        }
 175
 176        /* Warning:  The sock lock is held.  Remember to call
 177         * sctp_err_finish!
 178         */
 179
 180        switch (type) {
 181        case ICMPV6_PKT_TOOBIG:
 182                sctp_icmp_frag_needed(sk, asoc, transport, ntohl(info));
 183                goto out_unlock;
 184        case ICMPV6_PARAMPROB:
 185                if (ICMPV6_UNK_NEXTHDR == code) {
 186                        sctp_icmp_proto_unreachable(sk, asoc, transport);
 187                        goto out_unlock;
 188                }
 189                break;
 190        case NDISC_REDIRECT:
 191                sctp_icmp_redirect(sk, transport, skb);
 192                break;
 193        default:
 194                break;
 195        }
 196
 197        np = inet6_sk(sk);
 198        icmpv6_err_convert(type, code, &err);
 199        if (!sock_owned_by_user(sk) && np->recverr) {
 200                sk->sk_err = err;
 201                sk->sk_error_report(sk);
 202        } else {  /* Only an error on timeout */
 203                sk->sk_err_soft = err;
 204        }
 205
 206out_unlock:
 207        sctp_err_finish(sk, asoc);
 208out:
 209        if (likely(idev != NULL))
 210                in6_dev_put(idev);
 211}
 212
 213/* Based on tcp_v6_xmit() in tcp_ipv6.c. */
 214static int sctp_v6_xmit(struct sk_buff *skb, struct sctp_transport *transport)
 215{
 216        struct sock *sk = skb->sk;
 217        struct ipv6_pinfo *np = inet6_sk(sk);
 218        struct flowi6 fl6;
 219
 220        memset(&fl6, 0, sizeof(fl6));
 221
 222        fl6.flowi6_proto = sk->sk_protocol;
 223
 224        /* Fill in the dest address from the route entry passed with the skb
 225         * and the source address from the transport.
 226         */
 227        fl6.daddr = transport->ipaddr.v6.sin6_addr;
 228        fl6.saddr = transport->saddr.v6.sin6_addr;
 229
 230        fl6.flowlabel = np->flow_label;
 231        IP6_ECN_flow_xmit(sk, fl6.flowlabel);
 232        if (ipv6_addr_type(&fl6.saddr) & IPV6_ADDR_LINKLOCAL)
 233                fl6.flowi6_oif = transport->saddr.v6.sin6_scope_id;
 234        else
 235                fl6.flowi6_oif = sk->sk_bound_dev_if;
 236
 237        if (np->opt && np->opt->srcrt) {
 238                struct rt0_hdr *rt0 = (struct rt0_hdr *) np->opt->srcrt;
 239                fl6.daddr = *rt0->addr;
 240        }
 241
 242        SCTP_DEBUG_PRINTK("%s: skb:%p, len:%d, src:%pI6 dst:%pI6\n",
 243                          __func__, skb, skb->len,
 244                          &fl6.saddr, &fl6.daddr);
 245
 246        SCTP_INC_STATS(sock_net(sk), SCTP_MIB_OUTSCTPPACKS);
 247
 248        if (!(transport->param_flags & SPP_PMTUD_ENABLE))
 249                skb->local_df = 1;
 250
 251        return ip6_xmit(sk, skb, &fl6, np->opt, np->tclass);
 252}
 253
 254/* Returns the dst cache entry for the given source and destination ip
 255 * addresses.
 256 */
 257static void sctp_v6_get_dst(struct sctp_transport *t, union sctp_addr *saddr,
 258                            struct flowi *fl, struct sock *sk)
 259{
 260        struct sctp_association *asoc = t->asoc;
 261        struct dst_entry *dst = NULL;
 262        struct flowi6 *fl6 = &fl->u.ip6;
 263        struct sctp_bind_addr *bp;
 264        struct sctp_sockaddr_entry *laddr;
 265        union sctp_addr *baddr = NULL;
 266        union sctp_addr *daddr = &t->ipaddr;
 267        union sctp_addr dst_saddr;
 268        __u8 matchlen = 0;
 269        __u8 bmatchlen;
 270        sctp_scope_t scope;
 271
 272        memset(fl6, 0, sizeof(struct flowi6));
 273        fl6->daddr = daddr->v6.sin6_addr;
 274        fl6->fl6_dport = daddr->v6.sin6_port;
 275        fl6->flowi6_proto = IPPROTO_SCTP;
 276        if (ipv6_addr_type(&daddr->v6.sin6_addr) & IPV6_ADDR_LINKLOCAL)
 277                fl6->flowi6_oif = daddr->v6.sin6_scope_id;
 278
 279        SCTP_DEBUG_PRINTK("%s: DST=%pI6 ", __func__, &fl6->daddr);
 280
 281        if (asoc)
 282                fl6->fl6_sport = htons(asoc->base.bind_addr.port);
 283
 284        if (saddr) {
 285                fl6->saddr = saddr->v6.sin6_addr;
 286                fl6->fl6_sport = saddr->v6.sin6_port;
 287                SCTP_DEBUG_PRINTK("SRC=%pI6 - ", &fl6->saddr);
 288        }
 289
 290        dst = ip6_dst_lookup_flow(sk, fl6, NULL, false);
 291        if (!asoc || saddr)
 292                goto out;
 293
 294        bp = &asoc->base.bind_addr;
 295        scope = sctp_scope(daddr);
 296        /* ip6_dst_lookup has filled in the fl6->saddr for us.  Check
 297         * to see if we can use it.
 298         */
 299        if (!IS_ERR(dst)) {
 300                /* Walk through the bind address list and look for a bind
 301                 * address that matches the source address of the returned dst.
 302                 */
 303                sctp_v6_to_addr(&dst_saddr, &fl6->saddr, htons(bp->port));
 304                rcu_read_lock();
 305                list_for_each_entry_rcu(laddr, &bp->address_list, list) {
 306                        if (!laddr->valid || (laddr->state != SCTP_ADDR_SRC))
 307                                continue;
 308
 309                        /* Do not compare against v4 addrs */
 310                        if ((laddr->a.sa.sa_family == AF_INET6) &&
 311                            (sctp_v6_cmp_addr(&dst_saddr, &laddr->a))) {
 312                                rcu_read_unlock();
 313                                goto out;
 314                        }
 315                }
 316                rcu_read_unlock();
 317                /* None of the bound addresses match the source address of the
 318                 * dst. So release it.
 319                 */
 320                dst_release(dst);
 321                dst = NULL;
 322        }
 323
 324        /* Walk through the bind address list and try to get the
 325         * best source address for a given destination.
 326         */
 327        rcu_read_lock();
 328        list_for_each_entry_rcu(laddr, &bp->address_list, list) {
 329                if (!laddr->valid && laddr->state != SCTP_ADDR_SRC)
 330                        continue;
 331                if ((laddr->a.sa.sa_family == AF_INET6) &&
 332                    (scope <= sctp_scope(&laddr->a))) {
 333                        bmatchlen = sctp_v6_addr_match_len(daddr, &laddr->a);
 334                        if (!baddr || (matchlen < bmatchlen)) {
 335                                baddr = &laddr->a;
 336                                matchlen = bmatchlen;
 337                        }
 338                }
 339        }
 340        rcu_read_unlock();
 341        if (baddr) {
 342                fl6->saddr = baddr->v6.sin6_addr;
 343                fl6->fl6_sport = baddr->v6.sin6_port;
 344                dst = ip6_dst_lookup_flow(sk, fl6, NULL, false);
 345        }
 346
 347out:
 348        if (!IS_ERR(dst)) {
 349                struct rt6_info *rt;
 350                rt = (struct rt6_info *)dst;
 351                t->dst = dst;
 352                SCTP_DEBUG_PRINTK("rt6_dst:%pI6 rt6_src:%pI6\n",
 353                        &rt->rt6i_dst.addr, &fl6->saddr);
 354        } else {
 355                t->dst = NULL;
 356                SCTP_DEBUG_PRINTK("NO ROUTE\n");
 357        }
 358}
 359
 360/* Returns the number of consecutive initial bits that match in the 2 ipv6
 361 * addresses.
 362 */
 363static inline int sctp_v6_addr_match_len(union sctp_addr *s1,
 364                                         union sctp_addr *s2)
 365{
 366        return ipv6_addr_diff(&s1->v6.sin6_addr, &s2->v6.sin6_addr);
 367}
 368
 369/* Fills in the source address(saddr) based on the destination address(daddr)
 370 * and asoc's bind address list.
 371 */
 372static void sctp_v6_get_saddr(struct sctp_sock *sk,
 373                              struct sctp_transport *t,
 374                              struct flowi *fl)
 375{
 376        struct flowi6 *fl6 = &fl->u.ip6;
 377        union sctp_addr *saddr = &t->saddr;
 378
 379        SCTP_DEBUG_PRINTK("%s: asoc:%p dst:%p\n", __func__, t->asoc, t->dst);
 380
 381        if (t->dst) {
 382                saddr->v6.sin6_family = AF_INET6;
 383                saddr->v6.sin6_addr = fl6->saddr;
 384        }
 385}
 386
 387/* Make a copy of all potential local addresses. */
 388static void sctp_v6_copy_addrlist(struct list_head *addrlist,
 389                                  struct net_device *dev)
 390{
 391        struct inet6_dev *in6_dev;
 392        struct inet6_ifaddr *ifp;
 393        struct sctp_sockaddr_entry *addr;
 394
 395        rcu_read_lock();
 396        if ((in6_dev = __in6_dev_get(dev)) == NULL) {
 397                rcu_read_unlock();
 398                return;
 399        }
 400
 401        read_lock_bh(&in6_dev->lock);
 402        list_for_each_entry(ifp, &in6_dev->addr_list, if_list) {
 403                /* Add the address to the local list.  */
 404                addr = t_new(struct sctp_sockaddr_entry, GFP_ATOMIC);
 405                if (addr) {
 406                        addr->a.v6.sin6_family = AF_INET6;
 407                        addr->a.v6.sin6_port = 0;
 408                        addr->a.v6.sin6_addr = ifp->addr;
 409                        addr->a.v6.sin6_scope_id = dev->ifindex;
 410                        addr->valid = 1;
 411                        INIT_LIST_HEAD(&addr->list);
 412                        list_add_tail(&addr->list, addrlist);
 413                }
 414        }
 415
 416        read_unlock_bh(&in6_dev->lock);
 417        rcu_read_unlock();
 418}
 419
 420/* Initialize a sockaddr_storage from in incoming skb. */
 421static void sctp_v6_from_skb(union sctp_addr *addr,struct sk_buff *skb,
 422                             int is_saddr)
 423{
 424        __be16 *port;
 425        struct sctphdr *sh;
 426
 427        port = &addr->v6.sin6_port;
 428        addr->v6.sin6_family = AF_INET6;
 429        addr->v6.sin6_flowinfo = 0; /* FIXME */
 430        addr->v6.sin6_scope_id = ((struct inet6_skb_parm *)skb->cb)->iif;
 431
 432        sh = sctp_hdr(skb);
 433        if (is_saddr) {
 434                *port  = sh->source;
 435                addr->v6.sin6_addr = ipv6_hdr(skb)->saddr;
 436        } else {
 437                *port = sh->dest;
 438                addr->v6.sin6_addr = ipv6_hdr(skb)->daddr;
 439        }
 440}
 441
 442/* Initialize an sctp_addr from a socket. */
 443static void sctp_v6_from_sk(union sctp_addr *addr, struct sock *sk)
 444{
 445        addr->v6.sin6_family = AF_INET6;
 446        addr->v6.sin6_port = 0;
 447        addr->v6.sin6_addr = inet6_sk(sk)->rcv_saddr;
 448}
 449
 450/* Initialize sk->sk_rcv_saddr from sctp_addr. */
 451static void sctp_v6_to_sk_saddr(union sctp_addr *addr, struct sock *sk)
 452{
 453        if (addr->sa.sa_family == AF_INET && sctp_sk(sk)->v4mapped) {
 454                inet6_sk(sk)->rcv_saddr.s6_addr32[0] = 0;
 455                inet6_sk(sk)->rcv_saddr.s6_addr32[1] = 0;
 456                inet6_sk(sk)->rcv_saddr.s6_addr32[2] = htonl(0x0000ffff);
 457                inet6_sk(sk)->rcv_saddr.s6_addr32[3] =
 458                        addr->v4.sin_addr.s_addr;
 459        } else {
 460                inet6_sk(sk)->rcv_saddr = addr->v6.sin6_addr;
 461        }
 462}
 463
 464/* Initialize sk->sk_daddr from sctp_addr. */
 465static void sctp_v6_to_sk_daddr(union sctp_addr *addr, struct sock *sk)
 466{
 467        if (addr->sa.sa_family == AF_INET && sctp_sk(sk)->v4mapped) {
 468                inet6_sk(sk)->daddr.s6_addr32[0] = 0;
 469                inet6_sk(sk)->daddr.s6_addr32[1] = 0;
 470                inet6_sk(sk)->daddr.s6_addr32[2] = htonl(0x0000ffff);
 471                inet6_sk(sk)->daddr.s6_addr32[3] = addr->v4.sin_addr.s_addr;
 472        } else {
 473                inet6_sk(sk)->daddr = addr->v6.sin6_addr;
 474        }
 475}
 476
 477/* Initialize a sctp_addr from an address parameter. */
 478static void sctp_v6_from_addr_param(union sctp_addr *addr,
 479                                    union sctp_addr_param *param,
 480                                    __be16 port, int iif)
 481{
 482        addr->v6.sin6_family = AF_INET6;
 483        addr->v6.sin6_port = port;
 484        addr->v6.sin6_flowinfo = 0; /* BUG */
 485        addr->v6.sin6_addr = param->v6.addr;
 486        addr->v6.sin6_scope_id = iif;
 487}
 488
 489/* Initialize an address parameter from a sctp_addr and return the length
 490 * of the address parameter.
 491 */
 492static int sctp_v6_to_addr_param(const union sctp_addr *addr,
 493                                 union sctp_addr_param *param)
 494{
 495        int length = sizeof(sctp_ipv6addr_param_t);
 496
 497        param->v6.param_hdr.type = SCTP_PARAM_IPV6_ADDRESS;
 498        param->v6.param_hdr.length = htons(length);
 499        param->v6.addr = addr->v6.sin6_addr;
 500
 501        return length;
 502}
 503
 504/* Initialize a sctp_addr from struct in6_addr. */
 505static void sctp_v6_to_addr(union sctp_addr *addr, struct in6_addr *saddr,
 506                              __be16 port)
 507{
 508        addr->sa.sa_family = AF_INET6;
 509        addr->v6.sin6_port = port;
 510        addr->v6.sin6_addr = *saddr;
 511}
 512
 513/* Compare addresses exactly.
 514 * v4-mapped-v6 is also in consideration.
 515 */
 516static int sctp_v6_cmp_addr(const union sctp_addr *addr1,
 517                            const union sctp_addr *addr2)
 518{
 519        if (addr1->sa.sa_family != addr2->sa.sa_family) {
 520                if (addr1->sa.sa_family == AF_INET &&
 521                    addr2->sa.sa_family == AF_INET6 &&
 522                    ipv6_addr_v4mapped(&addr2->v6.sin6_addr)) {
 523                        if (addr2->v6.sin6_port == addr1->v4.sin_port &&
 524                            addr2->v6.sin6_addr.s6_addr32[3] ==
 525                            addr1->v4.sin_addr.s_addr)
 526                                return 1;
 527                }
 528                if (addr2->sa.sa_family == AF_INET &&
 529                    addr1->sa.sa_family == AF_INET6 &&
 530                    ipv6_addr_v4mapped(&addr1->v6.sin6_addr)) {
 531                        if (addr1->v6.sin6_port == addr2->v4.sin_port &&
 532                            addr1->v6.sin6_addr.s6_addr32[3] ==
 533                            addr2->v4.sin_addr.s_addr)
 534                                return 1;
 535                }
 536                return 0;
 537        }
 538        if (!ipv6_addr_equal(&addr1->v6.sin6_addr, &addr2->v6.sin6_addr))
 539                return 0;
 540        /* If this is a linklocal address, compare the scope_id. */
 541        if (ipv6_addr_type(&addr1->v6.sin6_addr) & IPV6_ADDR_LINKLOCAL) {
 542                if (addr1->v6.sin6_scope_id && addr2->v6.sin6_scope_id &&
 543                    (addr1->v6.sin6_scope_id != addr2->v6.sin6_scope_id)) {
 544                        return 0;
 545                }
 546        }
 547
 548        return 1;
 549}
 550
 551/* Initialize addr struct to INADDR_ANY. */
 552static void sctp_v6_inaddr_any(union sctp_addr *addr, __be16 port)
 553{
 554        memset(addr, 0x00, sizeof(union sctp_addr));
 555        addr->v6.sin6_family = AF_INET6;
 556        addr->v6.sin6_port = port;
 557}
 558
 559/* Is this a wildcard address? */
 560static int sctp_v6_is_any(const union sctp_addr *addr)
 561{
 562        return ipv6_addr_any(&addr->v6.sin6_addr);
 563}
 564
 565/* Should this be available for binding?   */
 566static int sctp_v6_available(union sctp_addr *addr, struct sctp_sock *sp)
 567{
 568        int type;
 569        const struct in6_addr *in6 = (const struct in6_addr *)&addr->v6.sin6_addr;
 570
 571        type = ipv6_addr_type(in6);
 572        if (IPV6_ADDR_ANY == type)
 573                return 1;
 574        if (type == IPV6_ADDR_MAPPED) {
 575                if (sp && !sp->v4mapped)
 576                        return 0;
 577                if (sp && ipv6_only_sock(sctp_opt2sk(sp)))
 578                        return 0;
 579                sctp_v6_map_v4(addr);
 580                return sctp_get_af_specific(AF_INET)->available(addr, sp);
 581        }
 582        if (!(type & IPV6_ADDR_UNICAST))
 583                return 0;
 584
 585        return ipv6_chk_addr(sock_net(&sp->inet.sk), in6, NULL, 0);
 586}
 587
 588/* This function checks if the address is a valid address to be used for
 589 * SCTP.
 590 *
 591 * Output:
 592 * Return 0 - If the address is a non-unicast or an illegal address.
 593 * Return 1 - If the address is a unicast.
 594 */
 595static int sctp_v6_addr_valid(union sctp_addr *addr,
 596                              struct sctp_sock *sp,
 597                              const struct sk_buff *skb)
 598{
 599        int ret = ipv6_addr_type(&addr->v6.sin6_addr);
 600
 601        /* Support v4-mapped-v6 address. */
 596                       L598" iin6_add0p/ipv6.c#L473" id="L47 id="L601" class="line" Note:s="linrout   /a>nine, so601"> 601n class="comment">/* Support v4-mapp4a>       nicast.
 * Return 1 - If the ad6truct in66addr. */
/* Support v4-mapp6uct in66aref">addr,
 577      ||if (sp && !sp->port)
 583 507{
 577                if (sp && ipv6_only_sock(sctp_opt2sk(AF_INET6;
 583port;
 579                sctp_v6_map_v4(saddr;
 580                return sctp_get_af_specific( 595statichref="+code=sctavailable(sap_v4( 511}
(      "L512"> 512
 593/* Support v4-map in consi6eration.
type &  */
 536addr1,
addr2)
 518{
6a_family) {
AF_INE6 &&
<"comment"s="l'"> 5'?in*an class="comment">/* Support v4-map">AF_INET6 &&
 596     /a>. = sizeof(.sctp_v6_addr_valid(union sctpPV6_ADDR_UNICAST" class="sre6="sref">s6n6_addr)) {
sin_por6 &&
s6_6ddr32[3] ==
     /a>. = sizeof(. 538     " iv38.s_addr)
 6              }
 &&
/* Support v4-map">AF_INET6 &&
s6n6_addr)) {
. 579       v6 /a>.>        int .ef="+code=ipv6_addr_type" class="sref">ipv6_addr_type(&addr->v6.sin_por6 &&
. 579       v6 /a>." iin6_addr" class939L596"> 596sref">s6_6ddr32[3] ==
type &FA_HO="/ipv:in6_addr" class939L596"> 596s>sin_por6ef">s_addr)
 538     " iv38am_hdr. 538     ="+coSCOPE_LOOPBACK.type &FA_f="+/ipv:in6_addr" class939L596"> 596s        6      return 0;
 538     " iv38am_hdr.type ="+coSCOPE_L="+. 637        }
))
type &FA_SITE/ipv:in6_addr" class939L596"> 596         6      return 0;
 538     " iv38am_hdr.type ="+coSCOPE_PRIVATE.
) {
 596 ref">s6_6 &&
 538     " iv38am_hdr..sin_por6cope_id)) {
 646        }
 538     " iv38. 547
 549}
/* i"line" name=new sk<"commockethis fun80" cled bymeccept()/* Support v4-mapine" name6"L550"> 550
 597                          struct  473 c       create_eccepte="ef="+e="L597"> 597                          struct 
 596    */ipv6_aport)
 553{
 597                          struct .6ctp_addr));
 *>        int  473 e"sr6e="( 6">AF_INET6;
 596   6                        6   struct . 6sref">port;
 557}
>        int ipv6_chk_addrsinP_familyilable() &aGFP_KERNEis="silable(ipv6k_procss="s. 558
PV6_ADDR_UNICAST" class="sre6ldcard ad6ress? */
ipvouc.addr)
 561{
 (P.);
 563}
sp &alidilable(ipv6_a6"L564"> 564
addrreset_flage=addr1" class="addrreset_flagdr 6ng?   */
sp)
n6_ae" name="L596"> 596   6                        6   struct <)a href="+code=snewcf="+code=inet" cnewcf. 567{
 473 e"sre="(P         n6_code=ipv6_addr_type"newc   6cf="+code=inet" cnewc   6cfk_net(&.type;
sin6_addr;
P         sp-&>        int sp-&. 570
in6);
        int  473 e"sr6e="(P.type)
 562     memcp2(( *IPV6_AD6R_MAPPED) {
 6">v4mapped)
sin6">/* dsin6"/a>/* Support v4-map         6      return 0;
sp)))
/* Support v4-map         6      return 0;
sctp_v6_addr_validef="+code=ipv6_addr_type" ipv6_aaddr-> (P.addr);
sp);
P. 681        }
IPV6_AD6R_UNICAST))
         ipv6k_procss="k_net(&P" iin6_addr" class939L596"> 596         6      return 0;
        k_"L58on_releas.(P.IPV6_AD6"L584"> 584
>        int  6">NULL, 0);
 586}
 587
ipvouc:in6_addr" class939L596"> 596ess to be6used for
.
 *
 6 Output:
/* This ">sp        5*an class="comment">/* Support v4-mapn illegal6address.
ssctp_v6_addr_validsef="+e="L597"> 597      c                             struct ssctp_v6_is_any" class="sref">sctp_v6_is_any(const union sctp_addr * 596lass="com6ent"> */
         sp-&>          if (sa_familysctpy != addr2->sa.in6_addr" class939L596"> 596l545 6sref">addr,
sctp_v6_map_v4(sp,
skb)
 598{
/* Support v4-ma7ss="sref"7sin6_addr);
 597                              const struct sk_buff * 600
 473 e"sr6e="b_parmt struct ipvop99  h> * 473 e"sr6e="b_parmt stru)lable(y != .     7                 L598" i7n6_ad70p/ipv6.c#L47380" class="line" name=opclass="sref">ipvop99(&     7 nicast.
addr,
/* Is this a w7t" class=7sref">port)
               amec.( 597                              const struct sk_buff *skb)
AF_INET6;
__udrt stru)d="L541" class="line"h85"> 585        reha href="+code=ipv6_chk_e=sk_buff" class="sref">s). 538     hton8href=1"<< 2in6, port;
saddr;
 511}
     his "commeq file/* Support v4-ma7"/a>     7"L512"> 512
sctp_v6_is_any(con nameq_dumpf">scef="+e="L597"> 597      eq_filetp_v6_is_anyeq_filet struct ssctp_v6_is_any" class="sref">sctp_v6_is_any(const union sctp_addr * 597 in consi7eration.
eq_pr0"                  eq_pr0"  href="+code=ipv6_chk_eqtp_v6_is_anyeqef">ss6.c#L592" id=e="ing">"%pI6 "n class.sctpy != addr->v6. */
addr1,
addr2)
 566static int  597                          struct  518{
 597s="sref">7a_family) {
 473 e"sr6e="(AF_INE7 &&
AF_INET7 &&
s7n6_addr)) {
/* Support v4-ma7">sin_por7 &&
 566static inte"sr6emsga hr( 566statimsga hr( *s6_7ddr32[3] ==
 597sass="com7ef">s_addr)
 596ockctp__href="+code=sk" cl>ockctp__hreruct hreruct.hreructn6_ae" name="L596"> 596ockctp__href="+code=sk" cl>ockctp__hreruct <)a href="+code=smsga hr"> 566statimsga hr(hreructy != v6.sin6_family = AF_INET7 &&
hreructy !=  536s7n6_addr)) {
hreructy != v6./* Support v4-ma7">sin_por7 &&
( *ockctp__href="+code=sk" cl>ockctp__hreruct.s6_7ddr32[3] ==
s_addr)
/* Support v4-ma7 ass="com7              }
 566static inte"sr6eev5" emsga href="+e="L597"> 597      c   alpev5" "> 566static intalpev5" ruct  566statiev5" ructsctp_sock * 566statimsga hr( *))
 596ockctp__href="+code=sk" cl>ockctp__hreruct hreructilhrefrom =  566statimsga hr( 597PV6_ADDR_7INKLOCAL) {
sctp_v6_is_any(const union sctp = s6_7 &&
 596    */ipv6_asin_por7cope_id)) {
ipv6_a 566statiev5" ruct/a>(ipv6_a 566static inte"sr6emsga hr( 566statimsga hr(        }
hreructn6_ae" name="L596"> 596ockctp__href="+code=sk" cl>ockctp__hreruct <)a href="+code=smsga hr"> 566statimsga hr( 547
hreructy != v6.ipv6_aaddr->sin6__ = sctpn6_code=ipv6_addr_type" ipv6_aaddr-> 549}
 550
 format,line" >n class="comment">/* Support v4-ma7 to INADD7_ANY. */
port)
/* Support v4-ma7ne" name=7L553"> 553{
7ctp_addr));
/* Th0" o601"> 601        /* Support v4-ma7nass="com7">AF_INET6;
ipv6_asp-&>          ="comment">/* Support v4-ma7n        7sref">port;
sin6_familsctpn6a href="+code=sin6_poaddr" class="sref">sctpy != addr2->sa. iin6_addr" class939L596"> 597ne" name=7L557"> 557}
sctp_v6_addr_valid(union <)a href="+code=sfhref="+code=sk" cl>hreruct_ =  558
hreructy != v6>addr2->v6dr" class="sref">aef">v6dr[3] == 
sctpy != addr->v6>addr2->addr)
 561{
);
 563}
hrefromn6_code=ipv6_addr_type" ipv6_aaddr->addr-><+code=addr" class="sref = 7"L564"> 564
hreructy != v6>        int hrefromy != v6 = ret = hreructy != v6.) &a&  *sp)
hreructy != v6.hrefromy != v6. 567{
type;
sin6_addr;
 570
nboundeskb/* Support v4-ma76" class=7sref">in6);
 566static inte"sr6e="b_msga href="+e="L597"> 597                              const struct ,5ehar  566statimsga hr(/* Support v4-ma76" class=7sref">type)
 * 597">IPV6_AD7R_MAPPED) {
 * 585     s939h85t struct  585     shhref =  7">v4mapped)
 596ockctp__href="+code=sk" cl>ockctp__hreruct hreruct.sp)))
 566statimsga hr( 597         7      return 0;
 566static inte"sr6emsga hr( 566statimsga hr(addr);
hreructn6_ae" name="L596"> 596ockctp__href="+code=sk" cl>ockctp__hreruct <)a href="+code=smsga hr"> 566statimsga hr(sp);
 585     shhref>        int  585     s939eha href="+code=ipv6_chk_e=sk_buff" class="sref">s.        }
hreructy != v6. 585     shhrefy != ))
/* Th0" o601"> 601        /* Support v4-ma7=>IPV6_AD7"L584"> 584
y != sp-&>          ="comment">/* Support v4-ma7=545 7">NULL, 0);
 585     i9eha href="+code=ipv6_chk_e=sk_buff" class="sref">s          597ne" name=7L586"> 586}
sctp_v6_addr_valid(union <)a href="+code=sfhref="+code=sk" cl>hreruct_ =  587
hreructy != v6>addr2->v6dr" class="sref">aef">v6dr[3] =5" id="L571" claia h85"> 585     i9eha href="+code=ipv6_chk_e=sk_buff" class="sref">s         v6 = 

 *
 7 Output:
        /* Support v4-ma7n illegal7address.
hreructy != v6>        int  585        reha href="+code=ipv6_chk_e=sk_buff" class="sref">s         v6 = 
ret = hreructy != v6.) &a&  597lass="com7ent"> */
 597      c   alpev5" "> 566static intalpev5" ruct  566statievhref>        int  566static int"sr2ev5" href="+code=ipv6_chk_e=sk_buff" class="sref">s. 7sref">addr,
hreructy != v6. 566statievhrefk_net(&sp,
skb)
 598{
);
 600
v6line" AFa>/* Is this a w8ped-v6 ad8ress. */
v6ode=sp" class="sr"linee"sr6eaf_sup">v6odhref="+code=ipv6_chk_sref">sa = sizeofsref">sasa,5e="L597"> 597      c                             struct _addr *sa_ iin6_addr" class939L596"> 598truct in68addr. */
sin6_family:in6_addr" class939L596"> 598p6uct in68aref">addr,
port)
 601        e 5*an class="comment">/* Support v4-ma8i8 class=8ssref">skb)
sin6_famil:in6_addr" class939L596"> 598p9 class=8s598"> 598{
sp &a__et_)_addr *port;
saddr;
 598"ed-v6 ad8L511"> 511}
 536     8"L512"> 512
 */
/* Thmatching with wildcards allowed.  Tne" extra lev5ln class="comment">/* Support v4-ma8" class="8ref">addr1,
/* Support v4-ma8"8 class=8ref">addr2)
/* Te 5if we so choo"eIf the address is a non-unicast or 8aass="sre8L518"> 518{
/* Support v4-ma8s="sref">8a_family) {
sctp_v6_is_any(cone"sr6ecmpf">schref=e" namctp_v6_is_any" class="sref">sctp_v6_is_any(const union /* Support v4-ma8f">AF_INE8 &&
sctp_v6_is_any(const union ctp_r(/* Support v4-ma8fed-v6 ad8 &&
 597      c                             struct ipvop99 *s8n6_addr)) {
sin_por8 &&
 597      (cons                 lineast struct cf2(s6_8ddr32[3] ==
 *ipvop99s_addr)
        int  != addr2->sa..cf2(        int ctp_r( != addr2->sa..AF_INET8 &&
cf2( *s8n6_addr)) {
 536sin_por8 &&
s6_8ddr32[3] ==
/s will5nothmatch5*an class="comment">/* Support v4-ma8s>sin_por8ef">s_addr)
sp &a__et!a href="+code=sin6fr" class="sref">cf2( *s6_8      return 1;
 536/* Support v4-ma8 527 837        }
|| a href="+code=s>(cones_anytp_v6_is_any(cones_anyhref="+code=ipv6_chk_f="+code=inet" class=",6a href="+code=sctp_r" class="sref">ctp_r( *))
 != addr2->sa>!a href="+code=sin6tp_r" class="sref">ctp_r( != addr2->sa.6.c#L600" id="L600" class="8e>sin_por8INKLOCAL) {
 536s6_8 &&
 != sctp_v6_is_anyschref=a href="+code=sctp_1tp_v6_is_anyctp_r( 536s6_8      return 0;
ockctp_ looks bindL566.510CL58onmaerifscn cla,n class="comment">/* Support v4-ma8ine" name8"L547"> 547
/* Support v4-ma8ne" name=8L549"> 549}
(cone"sr6ebind_aerifyhref=e="L597"> 597      c                             struct ipvop99sctp_v6_is_any(const union sctp_addr * 550
port)
 553{
/* Thef">sa has already been aerifsed. *an class="comment">/* Support v4-ma8nref">s6_8ctp_addr));
sctpy != addr2->sa>!a href="+code=sinamily" class="sref">sin6_family_addr *AF_INET6;
        int sctpy != addr2->sa)s="line" name="L536"> 536port;
 598ne" name=8L557"> 557}
ra href=">        int ret = sctpy != addr->v6. 558
       ode_devic.t struct  566statidevhref
addr)
ra href=">a href="+code=sin6_ad&  598rto INADD8L561"> 561{
       odet struct );
sctpy != addr->v6. * 563}
 5368"L564"> 564
       odet str        int        s st_odeef="+code=ipv6_addr_type"opclass="sref">ipvop99(&       iodeef="sp-> 536
 536sp)
 566statidevhrefr        int  566statidev getebyne"dex_rcuhref="+code=ipv6_chkode 579       odet st,6a href="+code=sctp_addr" class="sref">sctpy != addr->v6. 536 567{
 566statidevhrefr||="line" name="L536"> 536type;
       odet st,6code=ipv6_addr_type"ddr"addr" class="sref">sctpy != addr->v6,6a href="+code=sdev"> 566statidevhref, 0)_ iin6_addr" class939L596"> 598ass="sref8>sin6_addr;
 536 570
 536in6);
type)
 536ra href=">6a href="+code=sin& ) &a&  598">IPV6_AD8R_MAPPED) {
ipvop99(&sp-&_addr * 8">v4mapped)
 536sp)))
ipvop99(&(&addr);
sp);
(& 566statiavailL566href="+code=ipv6_chkctp_addr" class="sref">sctp,6a href="+code=sopclass="sref">ipvop99        }
))
ockctp_ looks sendL566.510CL58onmaerifscn cla,n class="comment">/* Support v4-ma8=>IPV6_AD8"L584"> 584
 8">NULL, 0);
/* Support v4-ma8ne" name=8L586"> 586}
(cone"sr6e=end_aerifyhref=e="L597"> 597      c                             struct ipvop99sctp_v6_is_any(const union sctp_addr * 587
 596(cons                 lineast struct 
 *
/* Thef">sa has already been aerifsed. *an class="comment">/* Support v4-ma8omment"> 8 Output:
sctpy != addr2->sa>!a href="+code=sinamily" class="sref">sin6_family_addr *sctpy != addr2->sa)s="line" name="L53="+code=ad8n        8unicast.
 598lass="com8ent"> */
ra href=">        int ret = sctpy != addr->v6. 598l545 8sref">addr,
       ode_devic.t struct  566statidevhrefsp,
skb)
ra href=">a href="+code=sin6_ad&  598ne" name=8L598"> 598{
sctpy != addr->v6. *);
 536 600
 536
 566statidevhrefr        int  566statidev getebyne"dex_rcuhref="+code=ipv6_chks st_ode 579       s st_odeef="+code=ipv6_addr_type"opclass="sref">ipvop99(&       iodeef="sp->/* Support v4-ma9     9                 L598" i9n6_ad90p/ipv6.c#L543" id="L55555555555555555555" id="L5" id="L4" id="L571" claadr"addr" class="sref">sctpy != addr->v6. 536     9 nicast.
 536
 566statidevhref_addr *addr,
 536sp,
skb)
        int ipvop99(&(& 598{
port;
saddr;
!a href="+code=sinNULin6_addr) &aNULi( 511}
     9"L512"> 512
v6odsA">/* ThT hr5informatp_v6for INIT and INIT-ACKn class="comment">/* Support v4-ma9 in consi9eration.
ock op9ione(/* Support v4-ma9 6uct in69ent"> */
fwhetherme P_familymmockethreally wa" s to have &am4(/* Support v4-ma9 7uct in69ref">addr1,
/* Te If the address is a non-unicast or 9"8 class=9ref">addr2)
/* Te 5sup">v6odIf the address is a non-unicast or 9"9 class=9L518"> 518{
/* Support v4-ma9s="sref">9a_family) {
v6odf">v6e="+code=inet" c"linee"sr6esup">v6odf">v6eef="+s" name="L597"> 597      c                             struct ipvop99/* Support v4-ma9s class="9 &&
 * 599="sref">s9n6_addr)) {
sin_por9 &&
ipvop99|| f (sp &aetipvop99 599sref">s6_9ddr32[3] ==
s_addr)
AF_INET9 &&
s9n6_addr)) {
 597     proto ope="+code=inet" cproto ope/ipv6(&  iin6_addr" class939L596"> 599">sin_por9 &&
addr->saL596" id="L5=5" id="L571" claPmily" class="sref">sinP_familys="comment">/* Support v4-ma9sref">s6_9ddr32[3] ==
addr->s="comment">/* Support v4-ma9s>sin_por9ef">s_addr)
addr->       releas./ipv6.c#L596" i        int        lode6ereleas.s="comment">/* Support v4-ma9sref">s6_9      return 1;
addr->       bind/ipv6.c#L596" id="        int        lode6ebinds="comment">/* Support v4-ma9s6uct in69              }
addr->ipvs" necc/ipv6.c#L596" i        int ipvlode_dgram_s" neccs="comment">/* Support v4-ma9s7uct in69      return 0;
addr->/* Support v4-ma9s8 class=937        }
addr->ipvaccepcL596" id="L5=5" id="L571" clalode_accepclass="sref">ipvlode_accepcs="comment">/* Support v4-ma9sass="sre9sin6_addr))
addr->ipvgeta hr/ipv6.c#L596" i        int ipvlode6egeta hrs="comment">/* Support v4-ma9         9      return 0;
addr->s="comment">/* Support v4-ma9 "sref">s9e_id. */
addr->s="comment">/* Support v4-ma9 >sin_por9INKLOCAL) {
addr->L596" id="L5=5" id="L571" cla"linee"sr_listeasctp_v6_addr_va"linee"sr_listeas="comment">/* Support v4-ma9 ref">s6_9 &&
addr->L596" id="=5" id="L571" clalode_shutdownsctp_v6_addr_valode_shutdowns="comment">/* Support v4-ma9 >sin_por9cope_id)) {
addr->ipvsetaockopc/ipv6.c#L527        int ipvs st_cL58on_setaockopcs="comment">/* Support v4-ma9 ref">s6_9      return 0;
addr->ipvgetaockopc/ipv6.c#L527        int ipvs st_cL58on_getaockopcs="comment">/* Support v4-ma9 6uct in69              }
addr-><=endmsglass="sref">ipvsendmsg/ipv6.c#L596" i        int ipvlode_=endmsgs="comment">/* Support v4-ma9 7uct in6946        }
addr->ipvrecvmsg/ipv6.c#L596" i        int ipvs st_cL58on_recvmsgs="comment">/* Support v4-ma9 8 class=9"L547"> 547
addr->/* Support v4-ma9 ass="sre9      return 1;
sinCONFIG_COMPA /ipv6.c#L600" id="L600" class="9ne" name=9L549"> 549}
addr->ipvcL5pat_setaockopc(        int ipvcL5pat_s st_cL58on_setaockopcs="comment">/* Support v4-ma9ine" name9"L550"> 550
addr->ipvcL5pat_getaockopc(        int ipvcL5pat_s st_cL58on_getaockopcs="comment">/* Support v4-ma9 to INADD9_ANY. */
/* Support v4-ma9 ref">s6_9sref">port)
 553{
s6_9ctp_addr));
 597     lode_protoswlass="sref">ipvlode_protosw/ipv6(&ipv=sinv6e=eqpacket protosw(  iin6_addr" class939L596"> 599iass="com9">AF_INET6;
addr->ra href=">596" id="        int sinSOCK_SEQPACK" s="comment">/* Support v4-ma9 7uct in69sref">port;
addr->s="comment">/* Support v4-ma9 8 class=9L557"> 557}
addr->s="comment">/* Support v4-ma9 ass="sre9"L558"> 558
addr->>596" id="  code=ipv6_addr_type"eode6e=eqpacket ope="+code=inet" ceode6e=eqpacket ope(/* Support v4-ma9ldcard ad9ress? */
addr->sp &aoo_che="/ipv6.c#L5a 0s="comment">/* Support v4-ma9lne" name9sref">addr)
addr->>596" id=5" id="L571" claSCTP_PROTOSW_FLAG="+code=inet" cSCTP_PROTOSW_FLAG/ipv 561{
);
 597     lode_protoswlass="sref">ipvlode_protosw/ipv6(&ipv=sinv6e=tream protosw(  iin6_addr" class939L596"> 599ne" name=9L563"> 563}
addr->ra href=">596" id="        int sinSOCK_STREAM(/* Support v4-ma9lref">s6_9"L564"> 564
addr->s="comment">/* Support v4-ma9rass="com9ng?   */
addr->s="comment">/* Support v4-ma9r        9="sref">sp)
addr->>596" id="  code=ipv6_addr_type"eode6e=eqpacket ope="+code=inet" ceode6e=eqpacket ope(/* Support v4-ma9l8 class=9L567"> 567{
addr->sp &aoo_che="/ipv6.c#L5a 0s="comment">/* Support v4-ma9lass="sre9sref">type;
addr->>596" id=5" id="L571" claSCTP_PROTOSW_FLAG="+code=inet" cSCTP_PROTOSW_FLAG/ipvs="comment">/* Support v4-ma9ass="sref9>sin6_addr;
 570
in6);
 566stati"lin6_rcvhref=e="L597"> 597      k_buf                 k_buf (stype)
 566stati"lin_rcvhref=a href="+code=s_e=sk_buff" class="sref">s ? -1 :ass="line" name="L536"> 536IPV6_AD9R_MAPPED) {
 9">v4mapped)
 597     eode6eprotocol="+code=inet" ceode6eprotocol/ipv6(&  iin6_addr" class939L596"> 599p" class=9sref">sp)))
addr-> 566stati"lin6_rcvhrefs="comment">/* Support v4-ma9aass="sre9      return 0;
addr-> 566stati"lin_v6eerrhrefs="comment">/* Support v4-ma9" class="9ref">addr);
addr->>596" ia href="+code=sin&mily_PROTO_NOPOLICY="+code=inet" c&mily_PROTO_NOPOLICY(| a href="+code=s&mily_PROTO_FINsin6_addr) &a&mily_PROTO_FINsihrefs="comment">/* Support v4-ma9"ne" name9"sref">sp);
        }
))
 597     >(cons                 lineast str"> 597     >(cons ee"sr6                lineasee"sr6(  iin6_addr" class939L596"> 599         9      return 0;
addr->sa>>>596" ia href="+code=sinamily" class="sref">sin6_familys="comment">/* Support v4-ma9">IPV6_AD9"L584"> 584
addr->< linexmit="+code=inet" cfsinexmit>>>596" ia href="+code=sin"lin_v6exmit="+code=inet" cfsinev6exmits="comment">/* Support v4-ma9"545 9">NULL, 0);
addr-><=etaockopclass="sref">ipvsetaockopc/ipv6.c#L527        int ipvinv6e=etaockopcs="comment">/* Support v4-ma9"        9L586"> 586}
addr->ipvgetaockopc/ipv6.c#L527        int ipvinv6egetaockopcs="comment">/* Support v4-ma9"" class=9"L587"> 587
addr->ipvgetedsc/ipv6.c#L596" i        int ipvssinev6egetedscs="comment">/* Support v4-ma9"ass="sre9used for
addr->>>>596" ia href="+code=sin"lin_v6eget_sadr"addr" class="sr"lin_v6eget_sadr"s="comment">/* Support v4-ma9"comment"9 * SCTP.
addr->v6listlass="sref">ipvcLpyf">v6list/ipv6.c#La href="+code=sin"lin_v6ecLpyf">v6listlass="sref">ipv"lin_v6ecLpyf">v6lists="comment">/* Support v4-ma9"ne" name9ment"> *
addr->596" id="        int /* Support v4-ma9"" class=9 Output:
addr->s="comment">/* Support v4-ma9"" class=9address.
addr->s="comment">/* Support v4-ma9"        9unicast.
addr->s="comment">/* Support v4-ma9">IPV6_AD9ent"> */
addr-> =  =  =  = s="comment">/* Support v4-ma9"545 9sref">addr,
addr-> =  =  = /* Support v4-ma9"        9="sref">sp,
addr->sctp_v6_is_anyschref.c#L596" i        int sctp_v6_is_any(conv6ecmpf">schrefs="comment">/* Support v4-ma9"" class=9"sref">skb)
addr-><.tp_v6_is_any(ohref=">596" id="" i        int .tp_v6_is_any(inev6e.hrefs="comment">/* Support v4-ma9"ass="sre9L598"> 598{
addr-><> = /* Support v4-ma10ss="sref"10ss=""> 598{
10ss/ipv6.c#L479">addr-> =  = (inev6ein> = (inev6ein> = {
"comment">/* Support v4-ma10s1="sref"10sent"> *
10sp/ipv6.c#L531">addr->(conv6ees_anyhrefs="comment">/* Support v4-ma10s2="sref"10sOutput:
10sp/ipv6.c#L532">addr-> 566statiavailL566href" id="" i        int  566statissinev6eavailL566hrefs="comment">/* Support v4-ma10s3="sref"10sddress.
10s3/ipv6.c#L508">addr->/* Support v4-ma10s4="sref"10snicast.
10s4/ipv6.c#L510">addr->       es_c.ef=">596" id="" i        int        ssinev6ees_c.hrefs="comment">/* Support v4-ma10s5="sref"10snt"> */
10sp/ipv6.c#L535">addr->< eq_dumpf">sctp_v6_is_anyeq_dumpf">sc/ipv6.c#La href="+code=sin"lin_v6e eq_dumpf">sctp_v6_is_anylin_v6e eq_dumpf">schrefs="comment">/* Support v4-ma10s6="sref"10sref">addr,
10s6/ipv6.c#L535">addr-> 566statiecn_capL566/ipv6.c#L50        int  566statissinev6eecn_capL566hrefs="comment">/* Support v4-ma10s7="sref"10s"sref">sp,
10sp/ipv6.c#L527">addr-> 597     rt vh"+code=v6" class=et.s="comment">/* Support v4-ma10s8="sref"10ssref">skb)
10sp/ipv6.c#L508">addr->< 597     .s="comment">/* Support v4-ma10s9="sref"10s598"> 598{
10sp/ipv#ifdef       int sinCONFIG_COMPA /ipv6.c#L600" id="L600" class="101s="sref"10sref">port;
10sr/ipv6.c#L479">addr->ipvcL5pat_setaockopc(        int ipvcL5pat_inv6e=etaockopchrefs="comment">/* Support v4-ma1011="sref"10ref">saddr;
10sp/ipv6.c#L531">addr->ipvcL5pat_getaockopc(        int ipvcL5pat_inv6egetaockopchrefs="comment">/* Support v4-ma1012="sref"10L511"> 511}
10sp/ipv#endif="comment">/* Support v4-ma10s3="sref"10"L512"> 512
10sp/ipv}.
10sp/ipv
10sp/ipv6.c#L56e="L597"> 597     ssinepftp_v6_is_any 597     >(conp ee"sr6                linepsee"sr6(  iin6_addr" class939L596"> 5910s6="sref"10ent"> */
10s6/ipv6.c#L535">addr->ipvevent_msga hr(        int ipv lineeode6eevent_msga hrhrefs="comment">/* Support v4-ma1017="sref"10ref">addr1,
10sp/ipv6.c#L527">addr->ipv kb_msga hr/ipv6.c        int ipv sineeode6e=kb_msga hrhrefs="comment">/* Support v4-ma1018="sref"10ref">addr2)
10sp/ipv6.c#L508">addr->v6od"> 566statiafesup">v6od/ipv6.=5" id="L571" cla"lineeode6eafesup">v6od"> 566stati"lineeode6eafesup">v6odhrefs="comment">/* Support v4-ma1019="sref"10L518"> 518{
10sp/ipv6.c#L479">addr->sctp_v6_is_anyschref.c#L59=5" id="L571" cla"lineeode6ecmpf">sctp_v6_is_any(coneode6ecmpf">schrefs="comment">/* Support v4-ma102s="sref"10a_family) {
10a_/ipv6.c#L479">addr->(cone"sr6ebind_aerifyhrefs="comment">/* Support v4-ma1021="sref"10 &&
10ap/ipv6.c#L531">addr-><=end_aerifytp_v6_is_anyend_aerifyhrefL59=5" id="L571" cla"lineeode6e=end_aerifytp_v6_is_any(cone"sr6e=end_aerifyhrefs="comment">/* Support v4-ma1022="sref"10 &&
10ap/ipv6.c#L532">addr->v6odf">v6e="+code=inet" c"up">v6odf">v6eef="9=5" id="L571" cla"lineeode6e=up">v6odf">v6e="+code=inet" c"linee"sr6esup">v6odf">v6eef="s="comment">/* Support v4-ma1023="sref"10n6_addr)) {
10a3/ipv6.c#L508">addr->/* Support v4-ma1024="sref"10 &&
10a4/ipv6.c#L510">addr-><> = /* Support v4-ma1025="sref"10ddr32[3] ==
10ap/ipv6.c#L535">addr->>>>>>>>>>>>  code=ipv6_addr_type"fsinns ee"sr6                lineasee"sr6(/* Support v4-ma1026="sref"10ef">s_addr)
10a6/ipv}.10ap/ipv6.c#L587" id="L587" class="10a8="sref"10              }
10ap/ipv6.c#L588" id="L588" cl/* Initialize IPv65sup">v6 and register withmmockethlayer. 5*an class="comment">/* Support v4-ma10a9="sref"10 &&
10ap/ipvvoid       int (inev6epsee"it="+code=inet" cfsinev6epsee"it/ipv(voids &&
10 591031="sref"10n6_addr)) {
10

/* Support v4-ma10<2="sref"10 && 10

(ineregisterepftp_v6_is_anysinP_familyss="line" name="L536"> 536[3] == 10

s_addr) 10<4/ipv6.c#L571".c#L559" id="L559" classRegister "comSCTP spece=sc A_familymfunc9ione. *an class="comment">/* Support v4-ma10<5="sref"10 return 1; 10<5/ipv6.c#L532 int (ineregisteres lineregisteres /ipv(code=ipv6_addr_type"fsinns ee"sr6 lineasee"sr6( 53610<6/ipv}="line" name="L536"> 53610

} 10<8/ipvvoid int (inev6epseexit="+code=inet" cfsinev6epseexit/ipv(voids)) 10<9/ipviin6_addr" class939L596"> 59104s="sref"10 return 0; 10 /ipv6.c#L532 int addr-> 536 10 1/ipv}="line" name="L536"> 536) { 10 p/ipv6.c#L512" id="L512" class="10 3="sref"10 && 10 3/ipv6.c#L588" id="L588" cl/* Initialize IPv65sup">v6 and register withmmockethlayer. 5*an class="comment">/* Support v4-ma1044="sref"10cope_id)) { 10 4/ipv0" id="L560" class="linev6eprotoswee"it="+code=inet" cfsinev6eprotoswee"it/ipv(voids10 5/ipviin6_addr" class939L596"> 591046="sref"10 } 10 6/ipv6.c#L5350" id="L560" class=rc rchrefs="line" name="L536"> 536 } 10 p/ipv6.c#L587" id="L587" class="1048="sref"10"L547"> 547 10 8/ipv6.c#L532 int s 1ss="line" name="L536"> 53610 p/ipv6.c#L4790=lea href="+code=src rchrefs 549} 10L5ef=">596" id="" i 3480" class="line" name=rc rchrefs="line" name="L536"> 536 550 10Lp/ipv 10L2/ipv6.c#L571".c#L559" id="L559" classAddmSCTPv6(UDP and TCP style) to e"srsw6 panked list. *an class="comment">/* Support v4-ma1053="sref"10sref">port) 10L3/ipv6.c#L5086 href="+code=se"sr6eregistereprotoswlass="sref">ipvlode6eregistereprotosw/ipv(code=ipv6_addr_type"fsinv6e=eqpacket protoswlass="sref">ipv=sinv6e=eqpacket protosw( 536 553{ 10L4/ipv6.c#L5086 href="+code=se"sr6eregistereprotoswlass="sref">ipvlode6eregistereprotosw/ipv(code=ipv6_addr_type"fsinv6e=tream protoswlass="sref">ipv=sinv6e=tream protosw( 536)); 10L5/ipvAF_INET6; A>10L6/ipv6.c#L53580" class="line" name="L536"> 536port; 10L7/ipv}="line" name="L536"> 536 557} 10Lp/ipv6.c#L558" id="L558" class="10L9="sref"10"L558"> 558 10Lp/ipvvoid int (inev6eprotosweexit="+code=inet" cfsinev6eprotosweexit/ipv(voids 10re/ipviin6_addr" class939L596"> 591061="sref"10sref">addr) 10r1/ipv6.c#L5086 href="+code=se"sr6eunregistereprotoswlass="sref">ipvlode6eunregistereprotosw/ipv(code=ipv6_addr_type"fsinv6e=eqpacket protoswlass="sref">ipv=sinv6e=eqpacket protosw( 536 561{ 10rp/ipv6.c#L532 int ipvlode6eunregistereprotosw/ipv(code=ipv6_addr_type"fsinv6e=tream protoswlass="sref">ipv=sinv6e=tream protosw( 536); 10r3/ipv6.c#L5086 href="+code=sproto unregister proto unregister/ipv(code=ipv6_addr_type"fsinv6eprot="+code=inet" cfsinv6eprotss="line" name="L536"> 536 563} 10r4/ipv}="line" name="L536"> 536 564 10r5/ipv 10rp/ipv6.c#L496" id="L496" class="10r7="sref"10="sref">sp) 10rp/ipv6.c#L588" id="L588" classRegister withmlode6hlayer. *an class="comment">/* Support v4-ma1068="sref"10L567"> 567{ 10r8/ipv0" id="L560" class="linev6eaddeprotocol="+code=inet" c=sinev6eaddeprotocol/ipv(voidstype; 10r9/ipviin6_addr" class939L596"> 59107s="sref"10>sin6_addr; si>10>s/ipv6.c#L571".c#L559" id="L559" classRegister notifser6for lode6ht">/* Tht">i9ione/dele9ione. *an class="comment">/* Support v4-ma1071="sref"10"L570"> 570 10>1/ipv6.c#L5086 href="+code=sregisterelode6> = = = = ss="line" name="L536"> 536in6); 10>p/ipv6.c#L512" id="L512" class="1073="sref"10sref">type) 10>3/ipv6.c#L5080=lea href="+code=seode6eaddeprotocol="+code=inet" ceode6eaddeprotocol/ipv(code=ipv6_addr_type"fsinv6eprotocol="+code=inet" c=sinv6eprotocol() < 0s10>p/ipv6.c#L534" id="L580" cla-a href="+code=sEAGAIN="+code=inet" cEAGAINhrefs="line" name="L536"> 536) { 10>5/ipvv4mapped) v>10>6/ipv6.c#L53580" class="line" name="L536"> 53610>7/ipv}="line" name="L536"> 536sp))) 10>p/ipv6.c#L558" id="L558" class="1079="sref"10 return 0; 10>p/ipv6.c#L559" id="L559" classUnregister withmlode6hlayer. *an class="comment">/* Support v4-ma108s="sref"10ref">addr); 10re/ipvvoid int (inev6edeleprotocol="+code=inet" c=sinev6edeleprotocol/ipv(voidssp); 10r1/ipviin6_addr" class939L596"> 591082="sref"1081 } 10rp/ipv6.c#L532 int )s="line" name="L536"> 536)) 10r3/ipv6.c#L5086 href="+code=sunregisterelode6> = = = = ss="line" name="L536"> 53610r4/ipv}="line" name="L536"> 536 584 10rp/ipv6/pre>

584footer > The original LXR software by "com"line" nahttp://sourceforge.me="projects/lxr >LXR "L55unityhrefs "cis experi59" al versp_v6by "line" namailto:lxr@lxr@ 584subfooter > lxr.Redpill L/apro AShrefs providermofnL/aux6s" nulting and operatp_vs service 5since 1995.