zer0stimulus
zer0stimulus

Reputation: 23686

What is the IPv6 equivalent for SIOCADDRT?

Can SIOCADDRT be used to add IPv6 routes? If not, what's the equivalent for ioctl()?

Upvotes: 3

Views: 891

Answers (3)

user2186154
user2186154

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

R.. GitHub STOP HELPING ICE
R.. GitHub STOP HELPING ICE

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

zwol
zwol

Reputation: 140886

I don't know, but

# strace ip route add <ipv6-route>

should tell you.

Upvotes: 2

Related Questions