Skip to content

Conversation

@uddhavdave
Copy link
Contributor

@uddhavdave uddhavdave commented Dec 1, 2025

This brings changes to the MMDB parser logic. Need to test via VRL functions.

@github-actions github-actions bot added the ☢️ Bug Something isn't working label Dec 1, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Dec 1, 2025

Failed to generate code suggestions for PR

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Dec 1, 2025

Greptile Overview

Greptile Summary

Replaced get_if_addrs crate with local-ip-address crate and upgraded maxminddb from 0.26 to 0.27.

  • Simplified get_local_node_ip() implementation to use single API call instead of iterating through network adapters
  • Added error handling with fallback to 127.0.0.1
  • Critical issue: Old code explicitly filtered for IPv4 addresses only, but new implementation may return IPv6 in some environments, which could break HTTP/gRPC address formation

Confidence Score: 2/5

  • This PR has a critical logic issue that needs to be fixed before merging
  • The new implementation may return IPv6 addresses but the old code explicitly filtered for IPv4 only. This behavioral change could cause HTTP/gRPC address formation issues in IPv6 environments, particularly affecting cluster node communication.
  • src/config/src/cluster.rs requires attention to ensure IPv4-only behavior is preserved

Important Files Changed

File Analysis

Filename Score Overview
Cargo.toml 5/5 Updated maxminddb from 0.26 to 0.27 and replaced get_if_addrs with local-ip-address 0.6
src/config/Cargo.toml 5/5 Updated dependency from get_if_addrs to local-ip-address
src/config/src/cluster.rs 4/5 Simplified get_local_node_ip() to use local_ip_address::local_ip() with error handling fallback to 127.0.0.1

Sequence Diagram

sequenceDiagram
    participant App as Application
    participant LN as load_local_node()
    participant GIP as get_local_node_ip()
    participant LIB as local-ip-address crate
    
    App->>LN: Initialize LOCAL_NODE
    LN->>GIP: Get local IP for http/grpc addresses
    GIP->>LIB: Call local_ip()
    alt Success (IPv4 or IPv6)
        LIB-->>GIP: Return IP address
        GIP-->>LN: Return IP as string
    else Error
        LIB-->>GIP: Return error
        GIP->>GIP: Log warning
        GIP-->>LN: Fallback to "127.0.0.1"
    end
    LN-->>App: Return Node with addresses
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@uddhavdave uddhavdave added the Needs-Testing Needs-Testing label Dec 1, 2025
@uddhavdave uddhavdave added this to the v0.30.0 milestone Dec 3, 2025
@uddhavdave
Copy link
Contributor Author

checked with sample enterprise version of mmdb, download seems to work fine as well as vrl functions

@uddhavdave uddhavdave merged commit 99c3391 into main Dec 3, 2025
53 of 55 checks passed
@uddhavdave uddhavdave deleted the ud/fix-audit branch December 3, 2025 10:03
@priyabrata-stack priyabrata-stack added Testing-Completed Testing-Completed and removed Needs-Testing Needs-Testing labels Dec 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

☢️ Bug Something isn't working Testing-Completed Testing-Completed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants