Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Jun 2019 14:40:29 +0000
From:      bugzilla-noreply@freebsd.org
To:        ports-bugs@FreeBSD.org
Subject:   [Bug 238850] sysutils/facter does not pick proper primary interface
Message-ID:  <bug-238850-7788@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D238850

            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@FreeBSD.org
          Reporter: pirzyk@FreeBSD.org
             Flags: maintainer-feedback?(puppet@FreeBSD.org)
          Assignee: puppet@FreeBSD.org

Created attachment 205379
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D205379&action=
=3Dedit
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=3D8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=3D600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
        inet6 ::1 prefixlen 128=20
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1=20
        inet 127.0.0.1 netmask 0xff000000=20
        nd6 options=3D21<PERFORMNUD,AUTO_LINKLOCAL>
        groups: lo=20
xn0: flags=3D8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=3D503<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=20
        inet6 $IPv6 prefixlen 64=20
        nd6 options=3D21<PERFORMNUD,AUTO_LINKLOCAL>
        media: Ethernet manual
        status: active
tun0: flags=3D8051<UP,POINTOPOINT,RUNNING,MULTICAST> metric 0 mtu 1500
        options=3D80000<LINKSTATE>
        inet6 fe80::216:3eff:fe64:481a%tun0 prefixlen 64 scopeid 0x3=20
        inet 192.168.3.1 --> 192.168.3.2 netmask 0xfffffff8=20
        nd6 options=3D21<PERFORMNUD,AUTO_LINKLOCAL>
        groups: tun=20
        Opened by PID 665


47>facter | grep primary
  primary =3D> "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.

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-238850-7788>