NAME

  tst_send_ifindex_udp - Specifying the outgoing interface as ancillary data


PURPOSE

  To check that the outgoing interface can be specified as
  ancillary data. If the outgoing interface set to 0, the 
  kernel will choose the outgoing interface.


SYNOPSIS

  ./tst_send_ifindex_udp [-tooloption ...]
    -tooloption : v6api tool option


TEST PROCEDURE

  1. Create an IPv6/UDP socket
  2. Bind the socket to address
  3. Specifying the outgoing interface to non-exist interface
     as ancillary data and send the message
  4. Check A: Message can not be send, return ENODEV error
  5. Specifying the outgoing interface to loopback interface
     as ancillary data and send the message
  6. Check B: Message can be received
  7. Specifying the outgoing interface to the value of 0 as
     ancillary data and send the message
  8. Check B: Message can be received


NOTE

  None


REFERENCE

  RFC 3542
  6.1.  Specifying/Receiving the Interface
    Interfaces on an IPv6 node are identified by a small positive
    integer, as described in Section 4 of [RFC-3493].  That document also
    describes a function to map an interface name to its interface index,
    a function to map an interface index to its interface name, and a
    function to return all the interface names and indexes.  Notice from
    this document that no interface is ever assigned an index of 0.
    When specifying the outgoing interface, if the ipi6_ifindex value is
    0, the kernel will choose the outgoing interface.
    The ordering among various options that can specify the outgoing
    interface, including IPV6_PKTINFO, is defined in Section 6.7.
    When the IPV6_RECVPKTINFO socket option is enabled, the received
    interface index is always returned as the ipi6_ifindex member of the
    in6_pktinfo structure.