Writing an OS X kernel extension to implement Linu

2020-08-15 00:18发布

I want to be able to force a socket through a specific network interface. In Linux the kernel allows a programmer to achieve this by setting said socket option - but in OS X I'm in the dark.

And hence my title question - is it possible? Has it been done? I'm not looking into re-implementing the IP stack, just enabling the usage of the bind-to-interface option.

1条回答
冷血范
2楼-- · 2020-08-15 00:52

Use the RFC 3542 interface for selecting outgoing interfaces (IPV6_PKTINFO). http://tools.ietf.org/html/rfc3542#section-6

查看更多
登录 后发表回答