NAME

  tst_recv_no_hhopt - Can not receive Hop-by-Hop Options when the IPV6_RECVHOPOPTS socket option is disabled


PURPOSE

  To check that if disabled the IPV6_RECVHOPOPTS socket option, the
  application can not receive Hop-by-Hop options header.


SYNOPSIS

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


TEST PROCEDURE

  1. Create an IPv6 socket
  2. Disabled socket to receive Hop-by-Hop options
  3. Set Hop-by-Hop options header of socket
  4. Bind socket to address
  5. Send message to itself
  6. Receive message on socket
  7. Check A: Hop-by-Hop option can not be received


NOTE

  None


REFERENCE

  RFC 3542
  8.1.  Receiving Hop-by-Hop Options
    To receive a Hop-by-Hop options header the application must enable
    the IPV6_RECVHOPOPTS socket option:
      int  on = 1;
      setsockopt(fd, IPPROTO_IPV6, IPV6_RECVHOPOPTS, &on, sizeof(on));
    When using ancillary data a Hop-by-hop options header is passed
    between the application and the kernel as follows: The cmsg_level
    member will be IPPROTO_IPV6 and the cmsg_type member will be
    IPV6_HOPOPTS.  These options are then processed by calling the
    inet6_opt_next(), inet6_opt_find(), and inet6_opt_get_val()
    functions, described in Section 10.