How to set a specified IPv6 address to ff_bind() without error?
markman76 opened this issue · 1 comments
markman76 commented
Hello.
I want to assign IPv6 address to ff_bind(), but I see the error as "ff_bind failed, errno:99, Cannot assign requested address".
Please answer to solve this issue.
- Source (UDP Server)
struct sockaddr_in6 local_addr6;
bzero(&local_addr6, sizeof(local_addr6));
local_addr6.sin6_family = AF_INET6;
local_addr6.sin6_port = htons(8888);
int ret = inet_pton(AF_INET6, "fe80::fd98:f6de:1d5f:6c33", (void *)&local_addr6.sin6_addr);
ret = ff_bind(sockfd6, (struct linux_sockaddr *)&local_addr6, sizeof(local_addr6));
if (ret < 0) {
printf("ERROR: sockfd6=%d, ff_bind failed, errno:%d, %s \n", sockfd6, errno, strerror(errno));
exit(1);
}
- Config file (config.ini)
[port0]
addr=172.16.1.1
netmask=255.255.0.0
broadcast=172.16.255.255
gateway=172.16.0.1
addr6=fe80::fd98:f6de:1d5f:6c33
prefix_len=64
gateway6=fe80::78fb:808e:c4d4:f61c