Hi! I've noticed that the IP_RECVIF
socket option, i.e.:
int y = 1;
setsockopt(fd, IPPROTO_IP, IP_RECVIF, &y, sizeof(y));
does not seem to work if the socket is proxied by a NETransparentProxyProvider
type network extension: there's no ancillary data in messages received with recvmsg
. As soon as I disable the network extension, recvmsg
starts returning ancillary data containing the interface name.
This seems to break some applications which rely on IP_RECVIF
in the presence of a transparent proxy, making it, in fact, not transparent. One such example is Apple's own libresolv
, which relies on IP_RECVIF
and breaks if there's no ancillary data in the recvmsg
result.
I don't think that this is the intended behaviour, since IPV6_PKTINFO
seems to work fine. I've filed a bug report (FB17586550) about this, however, I would greatly appreciate if someone could point me in the direction of a workaround.