开发者

What is the IPv6 equivalent for SIOCADDRT?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜