Bug 12263 - network-functions check ip_address_in_network not correct
Summary: network-functions check ip_address_in_network not correct
Status: CLOSED FIXED
Alias: None
Product: IPFire
Classification: Unclassified
Component: --- (show other bugs)
Version: 2
Hardware: all All
: Will affect an average number of users Major Usability
Assignee: Tim
QA Contact:
URL:
Keywords:
: 11278 (view as bug list)
Depends on:
Blocks: FWBUGS
  Show dependency treegraph
 
Reported: 2019-12-23 18:44 UTC by Tim
Modified: 2020-09-04 17:13 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tim 2019-12-23 18:44:13 UTC
In network-functions.pl the function ip_address_in_network() performs an incorrect check.

It converts the address, network start and network end addresses into binary, but then performs a textual comparison of these values.

This seems to usually work, but fails for some addresses, for example for the network 0.0.0.0/8.  Probably this is due to this value having a special meaning in unicode.

Patch to follow.
Comment 1 Michael Tremer 2019-12-24 09:59:53 UTC
(In reply to Tim from comment #0)
> Patch to follow.

Could you please extend the testsuite in that file to check for this?
Comment 2 Tim 2019-12-24 10:19:33 UTC
I've just submitted V2, which corrects the original patch, corrects another bug in  network2bin() and extends the testsuite as requested.  Note that the testsuite already failed on the network membership test.

https://patchwork.ipfire.org/patch/2658/
Comment 3 Michael Tremer 2019-12-24 10:21:53 UTC
What is the other bug? Can we split that into a separate ticket?
Comment 4 Peter Müller 2020-04-10 10:53:56 UTC
I am pretty sure this solves #11235. We definitely need this patch.
Comment 5 Peter Müller 2020-07-25 19:00:58 UTC
Next attempt to _finally_ getting this resolved: https://patchwork.ipfire.org/project/ipfire/list/?series=1426
Comment 8 Peter Müller 2020-08-01 15:12:29 UTC
*** Bug 11235 has been marked as a duplicate of this bug. ***
Comment 9 Peter Müller 2020-08-01 15:13:44 UTC
*** Bug 11278 has been marked as a duplicate of this bug. ***