Bug 214345

Summary: Periodic vlan ID display truncated in daily email
Product: Base System Reporter: Ryan <freebsd>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed DUPLICATE    
Severity: Affects Some People CC: rew
Priority: ---    
Version: 11.0-RELEASE   
Hardware: amd64   
OS: Any   

Description Ryan 2016-11-09 06:53:22 UTC
Daily Periodic run output is displaying a list of network interface statistics but for VLANs configured with IDs containing two digits, the second digit is not displayed.

Example output (removed packet stats). The actual VLAN IDs are 11, 12, 13, etc...

---Snip---
Network interface status:
Name    Mtu Network       Address
msk0   1500 <Link#1>      00:00:MASKED:00:00
msk0      - 192.168.1.16  backup.domain.
msk1   1500 <Link#2>      00:00:MASKED:00:00
msk2   1500 <Link#3>      00:00:MASKED:00:00
msk3   1500 <Link#4>      00:00:MASKED:00:00
lo0   16384 <Link#5>
lo0       - localhost     ::1
vlan1  1500 <Link#6>      00:00:MASKED:00:00
vlan1     - 192.168.1.20  192.168.1.22
vlan1  1500 <Link#7>      00:00:MASKED:00:00
vlan1     - 192.168.1.28  192.168.1.30
vlan1  1500 <Link#8>      00:00:MASKED:00:00
vlan1     - 192.168.1.32  192.168.1.34
vlan1  1500 <Link#9>      00:00:MASKED:00:00
vlan1     - 192.168.1.36  192.168.1.38
vlan1  1500 <Link#10>     00:00:MASKED:00:00
vlan1     - 192.168.1.42  192.168.1.46
vlan1  1500 <Link#11>     00:00:MASKED:00:00
---Snip---

Steps to reproduce:
1. Create vlan in rc.conf:
  cloned_interfaces="vlan12 vlan13 vlan14 vlan15 vlan16 vlan17 vlan18"
  ifconfig_msk2=up
  ifconfig_vlan12="vlan 12 vlandev msk2"
  ifconfig_vlan12="vlan 13 vlandev msk2"
  ifconfig_vlan12="vlan 14 vlandev msk2"
  ...
2. Reboot.
3. Run /etc/periodic/daily/420.status-network manually or wait until daily email is generated.

Expected results:
Full VLAN interface name is displayed.

Notes:
First noticed this on 10.1-RELEASE but just tested on 11.0-RELEASE and bug is still present.
Comment 1 Robert Wing freebsd_committer freebsd_triage 2020-08-12 20:36:18 UTC
Hey Ryan,

The periodic script that reports interface status information proxies to netstat(1). 

You can customize the output by setting the variable `daily_status_network_netstat_flags` in /etc/periodic.conf. This variable is documented in the man page for periodic.conf(5)

By default, netstat(1) truncates interface names, so you'd want to put the following in /etc/periodic.conf to prevent netstat from truncating the names:

daily_status_network_netstat_flags='-W'

Perhaps this should be the default behavior.

-Rob
Comment 2 Robert Wing freebsd_committer freebsd_triage 2020-08-12 20:39:04 UTC

*** This bug has been marked as a duplicate of bug 163572 ***