New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce on unsorted ips generate warrning #18

Closed
PetrP opened this Issue Sep 16, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@PetrP

PetrP commented Sep 16, 2017

When I use reduce with unsorted ip list, I get strange errors. (Data for example.list are bellow.)

iprange --reduce-factor 20 example.list
iprange: WARNING: invalid range reversed start=x.x.x.80 end=0.0.x.x
iprange: WARNING: invalid range reversed start=x.x.x.96 end=0.0.x.x
iprange: WARNING: invalid range reversed start=255.255.255.255 end=0.0.0.0
iprange: WARNING: invalid range reversed start=x.x.x.160 end=0.0.127.x

x seems random.

But when I provide same data into stdin, it works without error:

cat example.list | iprange --reduce-factor 20

It also works if I optimize data first:

iprange -J example.list > example2.list
iprange --reduce-factor 20 example2.list

I'm using version 1.0.3+ds-1 from debian stretch, but i'm on debian jessie, so it's possible it is somehow related.

cat > example.list <<EOF
216.144.250.150
69.162.124.226
69.162.124.227
69.162.124.228
69.162.124.229
69.162.124.230
69.162.124.231
69.162.124.232
69.162.124.233
69.162.124.234
69.162.124.235
69.162.124.236
69.162.124.237
63.143.42.242
63.143.42.243
63.143.42.244
63.143.42.245
63.143.42.246
63.143.42.247
63.143.42.248
63.143.42.249
63.143.42.250
63.143.42.251
63.143.42.252
63.143.42.253
46.137.190.132
122.248.234.23
188.226.183.141
178.62.52.237
54.79.28.129
54.94.142.218
104.131.107.63
54.67.10.127
54.64.67.106
159.203.30.41
46.101.250.135
18.221.56.27
EOF

ktsaou added a commit to ktsaou/iprange that referenced this issue Sep 16, 2017

@ktsaou

This comment has been minimized.

Show comment
Hide comment
@ktsaou

ktsaou Sep 16, 2017

Member

thank you for reporting this!

A stupid bug. A line should be moved 2 positions below.

Fixed it. If you don't want to install from source, just optimize the ipset before reducing it, with a pipe, like you did.

Member

ktsaou commented Sep 16, 2017

thank you for reporting this!

A stupid bug. A line should be moved 2 positions below.

Fixed it. If you don't want to install from source, just optimize the ipset before reducing it, with a pipe, like you did.

@ktsaou ktsaou added the bug label Sep 16, 2017

@ktsaou ktsaou closed this in #19 Sep 16, 2017

@ktsaou

This comment has been minimized.

Show comment
Hide comment
@ktsaou

ktsaou Sep 16, 2017

Member

merged it.

Member

ktsaou commented Sep 16, 2017

merged it.

@PetrP

This comment has been minimized.

Show comment
Hide comment
@PetrP

PetrP commented Sep 16, 2017

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment