Repository navigation
os syscalls: add getifaddrs to singleton - #18821
Conversation
)" This reverts commit b777701. Signed-off-by: Jose Nino <[email protected]>
Signed-off-by: Jose Nino <[email protected]>
Signed-off-by: Jose Nino <[email protected]>
Signed-off-by: Jose Nino <[email protected]>
Signed-off-by: Jose Nino <[email protected]>
Signed-off-by: Jose Nino <[email protected]>
Signed-off-by: Jose Nino <[email protected]>
|
|
||
| // Small struct to avoid exposing ifaddrs -- which is not defined in all platforms -- to the | ||
| // codebase. | ||
| struct InterfaceAddress { |
There was a problem hiding this comment.
happy to move this to address.h if we think it makes more sense there. I couldn't decide.
Signed-off-by: Jose Nino <[email protected]>
Signed-off-by: Jose Nino <[email protected]>
Signed-off-by: Jose Nino <[email protected]>
Signed-off-by: Jose Nino <[email protected]>
Signed-off-by: Jose Nino <[email protected]>
Signed-off-by: Jose Nino <[email protected]>
Signed-off-by: Jose Nino <[email protected]>
|
@mattklein123 still not done updating. I will ping you when this is ready for review. |
Signed-off-by: Jose Nino <[email protected]>
Signed-off-by: Jose Nino <[email protected]>
Signed-off-by: Jose Nino <[email protected]>
Signed-off-by: Jose Nino <[email protected]>
Signed-off-by: Jose Nino <[email protected]>
Signed-off-by: Jose Nino <[email protected]>
Signed-off-by: Jose Nino <[email protected]>
Signed-off-by: Jose Nino <[email protected]>
Signed-off-by: Jose Nino <[email protected]>
Signed-off-by: Jose Nino <[email protected]>
mattklein123
left a comment
There was a problem hiding this comment.
LGTM with small comments, thanks.
/wait
| // Small struct to avoid exposing ifaddrs -- which is not defined in all platforms -- to the | ||
| // codebase. | ||
| struct InterfaceAddress { | ||
| InterfaceAddress(absl::string_view ifa_name, unsigned int ifa_flags, |
There was a problem hiding this comment.
nit: can you just s/ifa/interface. It's easier to read.
| // TODO: eliminate this branching by upstreaming an alternative Android implementation | ||
| // e.g.: https://github.com/envoyproxy/envoy-mobile/blob/main/third_party/android/ifaddrs-android.h | ||
| #if defined(__ANDROID_API__) && __ANDROID_API__ < 24 | ||
| if (alternate_getifaddrs_.has_value()) { |
There was a problem hiding this comment.
Shouldn't you be doing this in all cases otherwise the interface docs are misleading?
There was a problem hiding this comment.
@mattklein123 I think I might be misunderstanding your point. Where else should I be checking this that is not checked?
There was a problem hiding this comment.
You should check this outside of the #ifdef ?
There was a problem hiding this comment.
I see what you mean now @mattklein123. My thought was that in posix the class would default to true for supporting getifaddrs regardless of if an alternate implementation is given. Only for Android<24 do we need to check for existence of an alternate implementation.
There was a problem hiding this comment.
OK I see. Makes sense. Can you just add a small comment?
/wait
Signed-off-by: Jose Nino <[email protected]>
Signed-off-by: Jose Nino <[email protected]>
Signed-off-by: Jose Nino <[email protected]>
Commit Message: os syscalls - add getifaddrs to singleton
Additional Description: this PR reverts #18566 and adjusts code in order to be able to compile against android in Envoy Mobile
Risk Level: low, new API. Also tested against existing code.
Testing: existing UT.
Signed-off-by: Jose Nino [email protected]