Ignore all loopback addresses for ip detection#13415
Closed
hilkeheremans wants to merge 1 commit intofacebook:masterfrom
Closed
Ignore all loopback addresses for ip detection#13415hilkeheremans wants to merge 1 commit intofacebook:masterfrom
hilkeheremans wants to merge 1 commit intofacebook:masterfrom
Conversation
Contributor
|
@javache has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
facebook-github-bot
pushed a commit
that referenced
this pull request
Apr 10, 2017
Summary: There is a bug with IP detection on Macs that have (1) multiple ethernet interfaces, (2) are using the second or third interface as their primary connection and (3) have extra loopback IPs configured (for example when running OpenVPN, running some Docker configurations or other more exotic applications). In those cases, automatic IP detection will falsely detect the IP as something like `127.94.0.1`, which will make it impossible to run debug builds from a physical device. The underlying network configurations looks something similar to this (irrelevant parts omitted): ``` lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384 options=1203<RXCSUM,TXCSUM,TXSTATUS,SW_TIMESTAMP> inet 127.0.0.1 netmask 0xff000000 inet 127.94.0.1 netmask 0xff000000 nd6 options=201<PERFORMNUD,DAD> en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500 options=10b<RXCSUM,TXCSUM,VLAN_HWTAGGING,AV> ether xx:xx:xx:xx:xx:xx nd6 options=201<PERFORMNUD,DAD> media: autoselect Closes #13415 Differential Revision: D4859654 Pulled By: javache fbshipit-source-id: 3c5d06201c48a2dfe1c274ff433423e5d7f2cded
thotegowda
pushed a commit
to thotegowda/react-native
that referenced
this pull request
May 7, 2017
Summary: There is a bug with IP detection on Macs that have (1) multiple ethernet interfaces, (2) are using the second or third interface as their primary connection and (3) have extra loopback IPs configured (for example when running OpenVPN, running some Docker configurations or other more exotic applications). In those cases, automatic IP detection will falsely detect the IP as something like `127.94.0.1`, which will make it impossible to run debug builds from a physical device. The underlying network configurations looks something similar to this (irrelevant parts omitted): ``` lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384 options=1203<RXCSUM,TXCSUM,TXSTATUS,SW_TIMESTAMP> inet 127.0.0.1 netmask 0xff000000 inet 127.94.0.1 netmask 0xff000000 nd6 options=201<PERFORMNUD,DAD> en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500 options=10b<RXCSUM,TXCSUM,VLAN_HWTAGGING,AV> ether xx:xx:xx:xx:xx:xx nd6 options=201<PERFORMNUD,DAD> media: autoselect Closes facebook#13415 Differential Revision: D4859654 Pulled By: javache fbshipit-source-id: 3c5d06201c48a2dfe1c274ff433423e5d7f2cded
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
There is a bug with IP detection on Macs that have (1) multiple ethernet interfaces, (2) are using the second or third interface as their primary connection and (3) have extra loopback IPs configured (for example when running OpenVPN, running some Docker configurations or other more exotic applications). In those cases, automatic IP detection will falsely detect the IP as something like
127.94.0.1, which will make it impossible to run debug builds from a physical device.Cause
The underlying network configurations looks something similar to this (irrelevant parts omitted):
In this configuration the packager will currently figure out
127.94.0.1instead of192.168.0.226.Proposed Fix
In addition to the existing filter on
127.0.0.1, also filter out all loopback addresses by changing the grep filter on127.[with a space in front of127to make sure we only filter out leading127addresses]. This PR does exactly that.Tested and found working on the culprit systems as well as various MacBooks.
Note: this PR replaces #12875 as it seems something went wrong with a rebase I did. Decided it was less of a risk to submit a new PR with this simple fix rather than retry the rebase.