NAME

  tst_inet6_rth_init_err - Upon an error the return value is NULL


PURPOSE

  To check that inet6_rth_init() should return NULL upon an error.


SYNOPSIS

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


TEST PROCEDURE

  1. The buffer is not large enough
  2. Check A: return value is NULL
  3. The type of the Routing header is not supported
  4. Check B: return value is NULL


NOTE

  None


REFERENCE

  RFC 3542
  7.2.  inet6_rth_init
      void *inet6_rth_init(void *bp, socklen_t bp_len, int type,
                           int segments);
    This function initializes the buffer pointed to by bp to contain a
    Routing header of the specified type and sets ip6r_len based on the
    segments parameter.  bp_len is only used to verify that the buffer is
    large enough.  The ip6r_segleft field is set to zero; inet6_rth_add()
    will increment it.
    When the application uses ancillary data the application must
    initialize any cmsghdr fields.
    The caller must allocate the buffer and its size can be determined by
    calling inet6_rth_space().
    Upon success the return value is the pointer to the buffer (bp), and
    this is then used as the first argument to the inet6_rth_add()
    function.  Upon an error the return value is NULL.