Reputation: 23686
Can SIOCADDRT be used to add IPv6 routes? If not, what's the equivalent for ioctl()?
Upvotes: 3
Views: 891
Reputation: 31
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.
Upvotes: 3
Reputation: 215647
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.
Upvotes: -1
Reputation: 140886
I don't know, but
# strace ip route add <ipv6-route>
should tell you.
Upvotes: 2