Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    [utils.inc] [is_linklocal()] Invalid LL recognition code

    Scheduled Pinned Locked Moved 2.2 Snapshot Feedback and Problems - RETIRED
    1 Posts 1 Posters 643 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • E
      eshield
      last edited by

      Hi,

      While working on correct dynamic gateway creation algo I've noticed the subject function which is implemented as:

      return (strtolower(substr($ipaddr, 0, 5)) == "fe80:");
      

      I believe this code will fail to recognise LL address in some cases because LL scope has a /10 prefix … so even "fe81:" is a correct LL address will be counted as invalid.

      After some research I've noticed that this code affects the following functions in case of [FE81..FEBF] LL addresses:
      [interfaces.inc] interface_configure() - Will remove all valid LL addresses on all interfaces;
      [interfaces.inc] find_interface_ipv6_ll() - Will never find first LL address on the interface;
      [services.inc] services_dnsmasq_configure() - dnsmasq will be unable to bind on valid LL address;
      [system.inc] system_routing_configure() - Routing will not be properly configured because scope won't be added if LL address is not FE80;
      [gwlb.inc] setup_gateways_monitor() - Gateway monitors will not be properly configured if LL address is not FE80;

      I will post a pull request soon with fix for the subject along with some fixes for dynamic gateways, but I think this fix should be merged to 2.1 branch too. Yeah, this bug is not that sensitive but you never know what can\could\will happen  :)

      1 Reply Last reply Reply Quote 0
      • First post
        Last post
      Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.