Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    • Register
    • Login
    Introducing Netgate Nexus: Multi-Instance Management at Your Fingertips.

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

    Scheduled Pinned Locked Moved 2.2 Snapshot Feedback and Problems - RETIRED
    1 Posts 1 Posters 715 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

      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

      With your input, this post could be even better 💗

      Register Login
      • First post
        Last post
      Copyright 2026 Rubicon Communications LLC (Netgate). All rights reserved.
      Privacy Policy · Cookie Policy