Skip to content

Fix netmask handling (bsc#1210104)#530

Merged
teclator merged 2 commits intomasterfrom
fix_netmask_handling
Apr 12, 2023
Merged

Fix netmask handling (bsc#1210104)#530
teclator merged 2 commits intomasterfrom
fix_netmask_handling

Conversation

@teclator
Copy link
Copy Markdown
Contributor

@teclator teclator commented Apr 11, 2023

Problem

Agama does not handle correctly the IP address netmask but works fine when a prefix length is used.

Solution

When a connection is updated it always expect a prefix length but in the IP Input form it is allowed to use a netmask or a prefix length.

Screenshot from 2023-04-11 14-51-38

Therefore, the code has been adapted converting the netmask to a prefix length when needed.

netmask

Testing

  • Added a new unit test
  • Tested manually

@teclator teclator changed the title Fix netmask handling Fix netmask handling (bsc#1210104) Apr 11, 2023
@coveralls
Copy link
Copy Markdown

coveralls commented Apr 11, 2023

Pull Request Test Coverage Report for Build 4668408668

  • 4 of 4 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.02%) to 73.487%

Totals Coverage Status
Change from base Build 4656652785: 0.02%
Covered Lines: 4672
Relevant Lines: 6124

💛 - Coveralls

@teclator teclator requested review from dgdavid and imobachgs April 11, 2023 14:03
Copy link
Copy Markdown
Contributor

@dgdavid dgdavid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks.

@teclator teclator merged commit 0370f78 into master Apr 12, 2023
@teclator teclator deleted the fix_netmask_handling branch April 12, 2023 08:14
ancorgs added a commit that referenced this pull request Dec 20, 2024
## Problem

Backend expects a prefix length instead of netmask, but unfortunately
current code base is not ensuring of making the conversion before
sending a request, making the connection form fail silently.


## Solution

Adapt the `formatIp` util method for relying in `ipPrefixFor` to make
such a conversion.

## Testing

- Updated unit test
- Tested manually

---

Fixes #1846

Related to #530
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants