# Confd\_connect with IPV6 addressing failed

**URL:** <https://dmap-community.ductus.global/t/confd-connect-with-ipv6-addressing-failed/4497>\
**Category:** CDB and CDB API\
**Created:** [July 12, 2023, 4:49am UTC](https://dmap-community.ductus.global/t/confd-connect-with-ipv6-addressing-failed/4497 "2023-07-12T04:49:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Madhu](https://avatars.discourse-cdn.com/v4/letter/m/a8b319/32.png) [@Madhu](https://dmap-community.ductus.global/u/Madhu)\
**Post date:** [July 12, 2023, 4:49am UTC](https://dmap-community.ductus.global/t/confd-connect-with-ipv6-addressing-failed/4497/1 "2023-07-12T04:49:48Z")

</div>

I’ve faced the below issue in my project. Can you help me ?

## Code snip:

```
memset(&m_addr_ipv6, 0, sizeof(m_addr_ipv6));
inet_pton(AF_INET6, "::1", &m_addr_ipv6.sin6_addr);
m_addr_ipv6.sin6_family = AF_INET6;
m_addr_ipv6.sin6_port = htons(CONFD_PORT);
 ---
int errval = confd_connect(dctx, ctlsock, CONTROL_SOCKET, (struct sockaddr*)&m_addr_ipv6,
              sizeof(m_addr_ipv6));

```

## ERROR :

ERRNOSTR=“system call failed” LASTERR=“Failed to connect to ConfD: Address family not supported by protocol” ERRNO=24.

---

<div class="post-metadata">

**Author:** ![cohult](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/cohult/32/221_2.png) [@cohult](https://dmap-community.ductus.global/u/cohult)\
**Post date:** [July 12, 2023, 7:47am UTC](https://dmap-community.ductus.global/t/confd-connect-with-ipv6-addressing-failed/4497/2 "2023-07-12T07:47:10Z")

</div>

You omitted the socket() call, but you likely use the wrong family when you create the socket. Example:

```c

    //if ((ctlsock = socket(PF_INET, SOCK_STREAM, 0)) < 0 )
    if ((ctlsock = socket(PF_INET6, SOCK_STREAM, 0)) < 0 )
        confd_fatal("Failed to open ctlsocket\n");

```
