Project

General

Profile

Actions

Feature #7603

closed

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

Added by Rajmund Hruška about 2 years ago. Updated almost 2 years ago.

Status:
Closed
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 Hruška about 2 years 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 Hruška about 2 years 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 Hruška about 2 years 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 Hruška about 2 years ago

  • Status changed from Resolved to In Review

Merged into devel.

Actions #5

Updated by Rajmund Hruška almost 2 years ago

  • Status changed from In Review to Closed
Actions

Also available in: Atom PDF