Bug 12263

Summary: network-functions check ip_address_in_network not correct
Product: IPFire Reporter: Tim <ipfb>
Component: ---Assignee: Tim <ipfb>
Status: CLOSED FIXED QA Contact:
Severity: Major Usability    
Priority: Will affect an average number of users CC: michael.tremer, peter.mueller, tomvend
Version: 2   
Hardware: all   
OS: All   
See Also: https://bugzilla.ipfire.org/show_bug.cgi?id=11235
https://bugzilla.ipfire.org/show_bug.cgi?id=11278
Bug Depends on:    
Bug Blocks: 12278    

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. ***