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

[BUG] Broadcast Address not setting correctly #744

Closed
adur1990 opened this issue Jan 24, 2023 · 2 comments
Closed

[BUG] Broadcast Address not setting correctly #744

adur1990 opened this issue Jan 24, 2023 · 2 comments
Assignees
Labels

Comments

@adur1990
Copy link

Describe the bug
The IPv4 broadcast addresses are not set correctly (always 0.0.0.0), regardless of node type and link type.

To Reproduce
Steps to reproduce the behavior:

  1. Place two PC nodes
  2. Connect the using the link tool
  3. Start the emulation
  4. Open a terminal on either of the nodes
  5. ifconfig eth0 is showing broadcast 0.0.0.0

Expected behavior
5. ifconfig eth0 should show inet 10.0.0.20 netmask 255.255.255.0 broadcast 10.0.0.255

Desktop (please complete the following information):

  • OS: Ubuntu 22.04
  • CORE Version 9.0.1

Additional context
Core is running within docker.

@adur1990 adur1990 added the bug label Jan 24, 2023
@adur1990
Copy link
Author

adur1990 commented Jan 24, 2023

After some investigation and debugging the issue is likely due to the following line:

if netaddr.valid_ipv4(ip):

This check is only valid, if ip is a string. But in this case, it is an netaddr.IPNetwork, thus always false...

if netaddr.valid_ipv4(str(ip.ip)): 

fixes the issue...

@bharnden
Copy link
Contributor

Thanks for catching this, fixed on develop for next update release.

@bharnden bharnden self-assigned this Jan 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants