Project

General

Profile

Actions

Feature #7603

open

Change type of 'network' in 'networks' table to IP4R

Added by Rajmund Hruska 2 months ago. Updated about 2 months ago.

Status:
In Review
Priority:
Normal
Category:
Development - Database
Target version:
Start date:
09/23/2022
Due date:
% Done:

100%

Estimated time:
To be discussed:
No

Description

Currently, the network is of type varchar. It would be nice to use some other type, such as iprange.

Actions #1

Updated by Rajmund Hruska 2 months ago

  • Tracker changed from Bug to Feature
  • Status changed from New to In Progress
  • % Done changed from 0 to 70

It's actually quite simple to change the type to ip4r.

The only issue is that according to ipranges 195.113.144.130/28 is a valid record whereas according to ip4r it is not. So searching for such addresses results in internal server error.

Actions #2

Updated by Rajmund Hruska about 2 months ago

As Pavel Kácha noticed, timeline and events handle the aforementioned type of addresses, the phrase "Invalid address value xxx in search form." is written on the screen. I checked the code and the validation is not actually performed before the form is submitted, although it might seem like it is. In dispatch_request method, there is a try-catch block which handles the exception from the database. I don't like this approach and I would much rather check the value before posting request. I will probably go with high and low functions from ipranges and convert the value to range.

Actions #3

Updated by Rajmund Hruska about 2 months ago

  • Subject changed from Consider migration of 'network' in 'networks' table to Change type of 'network' in 'networks' table to IP4R
  • Status changed from In Progress to Resolved
  • % Done changed from 70 to 100

Rajmund Hruska wrote in #note-2:

As Pavel Kácha noticed, timeline and events handle the aforementioned type of addresses, the phrase "Invalid address value xxx in search form." is written on the screen. I checked the code and the validation is not actually performed before the form is submitted, although it might seem like it is. In dispatch_request method, there is a try-catch block which handles the exception from the database. I don't like this approach and I would much rather check the value before posting request. I will probably go with high and low functions from ipranges and convert the value to range.

Fixed in dd0502fd.

So I think this is done.

Actions #4

Updated by Rajmund Hruska about 2 months ago

  • Status changed from Resolved to In Review

Merged into devel.

Actions

Also available in: Atom PDF