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

Changing the IP changes the mask - no cidr in address? #23558

Open
3 of 4 tasks
mkz212 opened this issue Jan 2, 2025 · 3 comments · May be fixed by #23613
Open
3 of 4 tasks

Changing the IP changes the mask - no cidr in address? #23558

mkz212 opened this issue Jan 2, 2025 · 3 comments · May be fixed by #23613
Assignees

Comments

@mkz212
Copy link

mkz212 commented Jan 2, 2025

Checklist

  • I have updated to the latest available Home Assistant version.
  • I have cleared the cache of my browser.
  • I have tried a different browser to see if it is related to my browser.
  • I have tried reproducing the issue in safe mode to rule out problems with unsupported custom resources.

Describe the issue you are experiencing

Settings / System / Network - changing IPv4 - from 192.168.1.8 also change mask from 255.255.255.0 to 255.255.255.255.

This is wrong because for this IP should be 255.255.255.0:

IMG_8003

Describe the behavior you expected

Fix mask.

Steps to reproduce the issue

  1. Go to Settings / System / Network.
  2. Change only field IPv4 address.
  3. This also change mask from 255.255.255.0 to 255.255.255.255

What version of Home Assistant Core has the issue?

core-2025.12.5

What was the last working version of Home Assistant Core?

No response

In which browser are you experiencing the issue with?

No response

Which operating system are you using to run this browser?

No response

State of relevant entities

No response

Problem-relevant frontend configuration

No response

Javascript errors shown in your browser console/inspector

No response

Additional information

No response

@mkz212
Copy link
Author

mkz212 commented Jan 2, 2025

export const parseAddress = (address: string) => {
const [ip, cidr] = address.split("/");
const isIPv6 = ip.includes(":");
const mask = cidr ? cidrToNetmask(cidr, isIPv6) : null;
return { ip, mask };
};

Bug 1

If we split address http://192.168.1.8 or http://192.168.1.8/24 by / ip will be http:/.

Bug 2

I also think that problem is that address is taken from field and field is without cidr - no /24 at the end. For cidr = 24 , mask is 255.255.255.0 and if cidr is null mask is 255.255.255.255.

Conclusion

Proper mask (255.255.255.0) is calculated only for address: 192.168.1.8/24 - not for 192.168.1.8 and not for http://192.168.1.8/24. But it is impossible to add address like this to address field cause system show message to not add /24.

@mkz212 mkz212 changed the title Changing the IP changes the mask Changing the IP changes the mask - no cidr in address? Jan 2, 2025
@silamon
Copy link
Contributor

silamon commented Jan 3, 2025

Bug 2 has been fixed last week, but is not yet on stable yet (will come out today with 2025.1)
EDIT: ccbb270

@mkz212
Copy link
Author

mkz212 commented Jan 3, 2025

Bug 2 has been fixed last week, but is not yet on stable yet (will come out today with 2025.1)

Great news! Thank you. What with bug 1? Can you fix this also?

@MindFreeze MindFreeze linked a pull request Jan 7, 2025 that will close this issue
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants