Welcome, Guest. Please login or register.

Author Topic: Filter on 0.0.0.0 IP  (Read 1472 times)

nti

  • Newbie
  • *
  • Posts: 13
    • View Profile
Filter on 0.0.0.0 IP
« on: May 19, 2015, 01:23:14 PM »
How can i set a filter on 0.0.0.0 IP Numbers?

I use the pgsql installation and nothing works :(

IP = 0.0.0.0, IP like 0%, IP = NULL

Any solution?

Also I can't figure out how the IPs are stored in the db, numbers are like "3232276611" - how can I translate this to a normal IP?

rickli

  • Administrator
  • Hero Member
  • *****
  • Posts: 2494
    • View Profile
    • NeDi
Re: Filter on 0.0.0.0 IP
« Reply #1 on: May 19, 2015, 04:45:40 PM »
Either use cidr with '=' operator or a regexp with '~' operator. IPv4 is stored as an integer...
Please consider Other-Invoices on your NeDi installation for an annual contribution, tx!
-Remo

nti

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Filter on 0.0.0.0 IP
« Reply #2 on: May 19, 2015, 11:37:44 PM »
? Did I miss something ?
I'm on the nodes list. If I try to filter all 0.0.0.0 IPs it is not possible. Not with "~" or "=" or with "like". With "> 0" I become all regular IPs. But it is not possible to make a query on the 0.0.0.0






rickli

  • Administrator
  • Hero Member
  • *****
  • Posts: 2494
    • View Profile
    • NeDi
Re: Filter on 0.0.0.0 IP
« Reply #3 on: May 20, 2015, 02:35:40 PM »
Sorry my bad, try "IP = NULL". This is an exception as nodes is joined with nodarp, thus IP is NULL not 0 (if no IP was found)
Please consider Other-Invoices on your NeDi installation for an annual contribution, tx!
-Remo

nti

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Filter on 0.0.0.0 IP
« Reply #4 on: May 20, 2015, 09:34:21 PM »
I use the pgsql installation and nothing works :(
IP = 0.0.0.0, IP like 0%, IP = NULL

I tried NULL also ... - Maybe no query works because of the inet_ntoa funnction ?

Code: [Select]
select '0.0.0.0'::inet+$1;$BODY$
Gre
Nicola

rickli

  • Administrator
  • Hero Member
  • *****
  • Posts: 2494
    • View Profile
    • NeDi
Re: Filter on 0.0.0.0 IP
« Reply #5 on: May 21, 2015, 10:37:40 AM »
Hm, I wonder what I tested as I can't reproduce it now  :-[

Will try to come up with something...
Please consider Other-Invoices on your NeDi installation for an annual contribution, tx!
-Remo