NAME

  tst_inet6_rth_space_err - Routing header is not supported or the number of segments is invalid


PURPOSE

  To check that inet6_rth_space() will return 0 if the type of the Routing
  header is not supported by this implementation or the number of segments 
  is invalid.


SYNOPSIS

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


TEST PROCEDURE

  1. Test if the number of segments is invalid
  2. Check A: return value is 0
  3. Test if the type of the Routing header is not supported
  4. Check B: return value is 0


NOTE

  None


REFERENCE

  RFC 3542
  7.1.  inet6_rth_space
      socklen_t inet6_rth_space(int type, int segments);
    This function returns the number of bytes required to hold a Routing
    header of the specified type containing the specified number of
    segments (addresses).  For an IPv6 Type 0 Routing header, the number
    of segments must be between 0 and 127, inclusive.  The return value
    is just the space for the Routing header.  When the application uses
    ancillary data it must pass the returned length to CMSG_SPACE() to
    determine how much memory is needed for the ancillary data object
    (including the cmsghdr structure).
    If the return value is 0, then either the type of the Routing header
    is not supported by this implementation or the number of segments is
    invalid for this type of Routing header.
    (Note: This function returns the size but does not allocate the space
    required for the ancillary data.  This allows an application to
    allocate a larger buffer, if other ancillary data objects are
    desired, since all the ancillary data objects must be specified to
    sendmsg() as a single msg_control buffer.)