I would probably do it like this instead (pseudo code):

    rsP = ngsi9only? restServiceNgsi9V ; restServiceV;
    restInit(localIp, port, rs);
    if (ipv6)
      restInit(ip6host, ip6port, rs);
  
This removes some complications from restInit. And also, it allows us to have two different default hosts for ip4 and ip6.