{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/corefx/issues/3941","labels_url":"https://api.github.com/repos/dotnet/corefx/issues/3941/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/corefx/issues/3941/comments","events_url":"https://api.github.com/repos/dotnet/corefx/issues/3941/events","html_url":"https://github.com/dotnet/corefx/pull/3941","id":112010639,"number":3941,"title":"native: Check if in_pktinfo exists","user":{"login":"jasonwilliams200OK","id":2031765,"avatar_url":"https://avatars.githubusercontent.com/u/2031765?v=3","gravatar_id":"","url":"https://api.github.com/users/jasonwilliams200OK","html_url":"https://github.com/jasonwilliams200OK","followers_url":"https://api.github.com/users/jasonwilliams200OK/followers","following_url":"https://api.github.com/users/jasonwilliams200OK/following{/other_user}","gists_url":"https://api.github.com/users/jasonwilliams200OK/gists{/gist_id}","starred_url":"https://api.github.com/users/jasonwilliams200OK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasonwilliams200OK/subscriptions","organizations_url":"https://api.github.com/users/jasonwilliams200OK/orgs","repos_url":"https://api.github.com/users/jasonwilliams200OK/repos","events_url":"https://api.github.com/users/jasonwilliams200OK/events{/privacy}","received_events_url":"https://api.github.com/users/jasonwilliams200OK/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dotnet/corefx/labels/cla-already-signed","name":"cla-already-signed","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-18T09:50:36Z","updated_at":"2015-10-19T17:38:46Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/dotnet/corefx/pulls/3941","html_url":"https://github.com/dotnet/corefx/pull/3941","diff_url":"https://github.com/dotnet/corefx/pull/3941.diff","patch_url":"https://github.com/dotnet/corefx/pull/3941.patch"},"body":"If it does not exist, `typedef in_addr in_pktinfo`.\r\n\r\nSame question as I asked [under the outdated commit](https://github.com/jasonwilliams200OK/corefx/commit/f49a9069e9db9447095fb39fb86bb948b48a12e2#commitcomment-13833233):\r\n\r\n> @nguerrera, @pgavlin, @sokket,\r\n>\r\nWith this change (`typedef`'ing `int_add` as `in_pktinfo`), native builds on FreeBSD.\r\nThis makes me wonder, given `int_add` is more POSIX-y than `in_pktinfo` (which encapsulates an `int_add` typed member), should we just use `int_addr` and dump `in_pkginfo`, if we only *really* need `in_pktinfo` at one instance to get the interface index? We can then probably get interface index by making some(?) syscall.\r\n\r\nNote that even BSDs aren't same. I configured NetBSD 7.0 amd64 VM today and found that `in_pktinfo` is defined in `netinet/in.h` header (but not on FreeBSD). On Ubuntu 14 (LTS), `in_pkinfo` is forward declared in `netinet/in.h`, but the actual definition lives in `linux/in.h` and so forth..\r\nNevertheless, this feature detection approach is working out quite well (much better than OS detection).\r\n\r\n---\r\n\r\nDisclaimer / Credits:\r\nI have taken some inspirations from OpenVPN for this work: https://github.com/OpenVPN/openvpn/search?utf8=✓&q=HAVE_IN_PKTINFO. They are using autoconfig; I translated ac constructs to corresponding cmake ones."},"comment":{"url":"https://api.github.com/repos/dotnet/corefx/issues/comments/149292502","html_url":"https://github.com/dotnet/corefx/pull/3941#issuecomment-149292502","issue_url":"https://api.github.com/repos/dotnet/corefx/issues/3941","id":149292502,"user":{"login":"stephentoub","id":2642209,"avatar_url":"https://avatars.githubusercontent.com/u/2642209?v=3","gravatar_id":"","url":"https://api.github.com/users/stephentoub","html_url":"https://github.com/stephentoub","followers_url":"https://api.github.com/users/stephentoub/followers","following_url":"https://api.github.com/users/stephentoub/following{/other_user}","gists_url":"https://api.github.com/users/stephentoub/gists{/gist_id}","starred_url":"https://api.github.com/users/stephentoub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephentoub/subscriptions","organizations_url":"https://api.github.com/users/stephentoub/orgs","repos_url":"https://api.github.com/users/stephentoub/repos","events_url":"https://api.github.com/users/stephentoub/events{/privacy}","received_events_url":"https://api.github.com/users/stephentoub/received_events","type":"User","site_admin":false},"created_at":"2015-10-19T17:38:46Z","updated_at":"2015-10-19T17:38:46Z","body":"LGTM"}}