Skip to content
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

IPOPS detailed_ip_type: wrong for PRIVATE IP #1906

Closed
homer5000 opened this issue Mar 26, 2019 · 3 comments

Comments

Projects
None yet
4 participants
@homer5000
Copy link

commented Mar 26, 2019

Description

I use the detailed_ipv4_type func from the ipops module for determine the source IP of the request:

# check src ip
if (detailed_ip_type("$si", "$var(src_t)")) {
    xlog("L_INFO","Sourece IP address ($si) is of detailed type: $var(src_t)\n");
    ...

When $si = 172.22.32.140 detailed_ip_type return PUBLIC, but it is PRIVATE.

Log Messages

INFO: <script>: Sourece IP address (172.22.32.140) is of detailed type: PUBLIC

Additional Information

Maybe the reason is here:
modules / ipops / detailed_ip_type.c

(Lucian Balaceanu         2016-09-01 18:39:55 +0300 48)
     { 0xac100000,  "PRIVATE",    0xfffe0000 },  // 172.16/12

Maybe fffe should be fff0 - it's /15 now.. so 172.16 and 172.17 only match.

@miconda

This comment has been minimized.

Copy link
Member

commented Mar 26, 2019

Can you make a pull request with the proposed changes? Then it can be reviewed and merged if all ok.

@sergey-safarov

This comment has been minimized.

Copy link
Contributor

commented Mar 27, 2019

According RFC1918 need use 172.16/12
I will create PR

@henningw

This comment has been minimized.

Copy link
Contributor

commented Mar 27, 2019

Thank you, fixed in git master, 5.2 and 5.1 branch.

@henningw henningw closed this Mar 27, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.