[Bug 238850] sysutils/facter does not pick proper primary interface

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Thu Jun 27 14:40:33 UTC 2019


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=238850

            Bug ID: 238850
           Summary: sysutils/facter does not pick proper primary interface
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: Individual Port(s)
          Assignee: puppet at FreeBSD.org
          Reporter: pirzyk at FreeBSD.org
             Flags: maintainer-feedback?(puppet at FreeBSD.org)
          Assignee: puppet at FreeBSD.org

Created attachment 205379
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=205379&action=edit
Proposed patch

Facter will pick the primary interface as the first interface alphabetically
that does not have a localhost address on it.  This works fine if you have
multiple physical nics line xe0, xe1, etc but it is getting tripped up by
having a tun0 interface as well.

46>ifconfig -a
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
        inet6 ::1 prefixlen 128 
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 
        inet 127.0.0.1 netmask 0xff000000 
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
        groups: lo 
xn0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=503<RXCSUM,TXCSUM,TSO4,LRO>
        ether $MAC
        hwaddr $MAC
        inet $IP netmask 0xffffff00 broadcast $BROADCAST
        inet6 fe80::216:3eff:fe64:481a%xn0 prefixlen 64 scopeid 0x2 
        inet6 $IPv6 prefixlen 64 
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
        media: Ethernet manual
        status: active
tun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> metric 0 mtu 1500
        options=80000<LINKSTATE>
        inet6 fe80::216:3eff:fe64:481a%tun0 prefixlen 64 scopeid 0x3 
        inet 192.168.3.1 --> 192.168.3.2 netmask 0xfffffff8 
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
        groups: tun 
        Opened by PID 665


47>facter | grep primary
  primary => "tun0"

Attached patch will use the same method facter uses on Solaris to determine the
primary interace.   Also https://tickets.puppetlabs.com/browse/FACT-1932 has
been filed upstream to get this fixed properly for mutilple BSD OSes.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-ports-bugs mailing list