开发者

What is the IPv6 equivalent for SIOCADDRT?

开发者 https://www.devze.com 2023-03-06 10:59 出处:网络
Can SIOCADDRT be used to add IPv6 routes? If not, what\'s the equivalent for开发者_运维技巧 ioctl()?Yes, you can use SIOCADDRT. Just create AF_INET6 socket for it.For example, take a look at Busybox i

Can SIOCADDRT be used to add IPv6 routes? If not, what's the equivalent for开发者_运维技巧 ioctl()?


Yes, you can use SIOCADDRT. Just create AF_INET6 socket for it. For example, take a look at Busybox implementation of "route" command. Also consider using Netlink instead, perhaps via libnl.

Sorry for late answer, I was looking for this myself and found the accepted answer a bit lacking.


I don't know, but

# strace ip route add <ipv6-route>

should tell you.


Not writing low-level network configuration code in your program, but instead delegating the task to the existing system utilities, would be one very good solution.

0

精彩评论

暂无评论...
验证码 换一张
取 消