Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

react-native-xcode.sh doesn't filter out link local addresses correctly #44752

Open
msbit opened this issue Jun 3, 2024 · 6 comments
Open

react-native-xcode.sh doesn't filter out link local addresses correctly #44752

msbit opened this issue Jun 3, 2024 · 6 comments
Labels
Needs: Attention Issues where the author has responded to feedback. Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Needs: Version Info

Comments

@msbit
Copy link

msbit commented Jun 3, 2024

Description

At

for num in 0 1 2 3 4 5 6 7 8; do
IP=$(ipconfig getifaddr en${num} || echo "")
if [ ! -z "$IP" ]; then
break
fi
done
the script goes through a list of interfaces looking for an IP, using ipconfig getifaddr.

At

if [ -z "$IP" ]; then
IP=$(ifconfig | grep 'inet ' | grep -v ' 127.' | grep -v ' 169.254.' |cut -d\ -f2 | awk 'NR==1{print $1}')
fi
if the previous search hasn't found anything (IP is empty) it uses a looser search, grepping for inet and discarding link local addresses (127.x and 169.254.x).

The scenario I have is where my en0 has a link local address (169.254.36.33) and so as the first search doesn't filter out these addresses, this is what is written to ip.txt at

and so my iOS device cannot connect to the metro instance.

Steps to reproduce

React Native Version

0.74.1

Affected Platforms

Runtime - iOS

Output of npx react-native info

-

Stacktrace or Logs

-

Reproducer

Screenshots and Videos

No response

@github-actions github-actions bot added Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. labels Jun 3, 2024
Copy link

github-actions bot commented Jun 3, 2024

⚠️ Missing Reproducible Example
ℹ️ We could not detect a reproducible example in your issue report. Please provide either:
  • If your bug is UI related: a Snack
  • If your bug is build/update related: use our Reproducer Template. A reproducer needs to be in a GitHub repository under your username.

Copy link

github-actions bot commented Jun 3, 2024

⚠️ Add or Reformat Version Info
ℹ️ We could not find or parse the version number of React Native in your issue report. Please use the template, and report your version including major, minor, and patch numbers - e.g. 0.70.2

@cortinico
Copy link
Contributor

cc @cipolleschi @robhogan et al. if we need to fix this in a different way for iOS

@cipolleschi
Copy link
Contributor

@msbit you have issues with your physical device only, right? It works properly on the simulator, correct?

@msbit
Copy link
Author

msbit commented Jun 9, 2024

@cipolleschi I haven't checked explicitly, but I'm guessing the check of platform at:

if [[ ! "$SKIP_BUNDLING_METRO_IP" && "$CONFIGURATION" = *Debug* && ! "$PLATFORM_NAME" == *simulator ]]; then
would exclude this behaviour under simulators.

@github-actions github-actions bot added Needs: Attention Issues where the author has responded to feedback. and removed Needs: Author Feedback labels Jun 9, 2024
@cipolleschi
Copy link
Contributor

yes, it is possible. @robhogan could you take this? I'm going to be on PTO next week. Otherwise I can look into it when I'm back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Attention Issues where the author has responded to feedback. Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Needs: Version Info
Projects
None yet
Development

No branches or pull requests

3 participants