Open init-js opened 9 years ago
In fact, it also looks like it is not picking up the proper priority from the json config files when periods are involved:
teamd.conf:
{
"device": "team255",
"runner": {
"name": "activebackup"
},
"link_watch": {
"name": "ethtool"
},
"ports": {
"eth3.255": {
"prio": -10,
"sticky": true
},
"eth2.255": {
"prio": 100
}
}
}
Priorities are not picked up:
root@foo:~# teamd -o -t team255 -g -f /etc/teamd.conf
...
<port_list>
</port_list>
eth3.255: Adding port (found ifindex "22").
eth2.255: Adding port (found ifindex "21").
1.17 successfully started.
<ifinfo_list>
24: team255: aa:26:89:68:23:55: 0
</ifinfo_list>
<port_list>
*22: eth3.255: up 1000Mbit FD
</port_list>
eth3.255: Got link watch from global config.
eth3.255: Using sticky "0".
Added loop callback: lw_ethtool_delay, 0x688ff0
eth3.255: ethtool-link went up.
eth3.255: Can't get port priority. Using default.
Found best port: "eth3.255" (ifindex "22", prio "0").
Changed active port to "eth3.255".
<ifinfo_list>
24: team255: aa:26:89:68:23:55: 0
22: eth3.255: 00:50:56:90:78:79: 24
</ifinfo_list>
Current active port: "eth3.255" (ifindex "22", prio "0").
<port_list>
*21: eth2.255: up 1000Mbit FD
22: eth3.255: up 1000Mbit FD
</port_list>
eth2.255: Got link watch from global config.
eth2.255: Using sticky "0".
Added loop callback: lw_ethtool_delay, 0x689450
eth2.255: ethtool-link went up.
Current active port: "eth3.255" (ifindex "22", prio "0").
eth2.255: Can't get port priority. Using default.
<ifinfo_list>
*24: team255: *00:50:56:90:78:79: 0
22: eth3.255: 00:50:56:90:78:79: 24
21: eth2.255: 00:50:56:90:78:78: 24
</ifinfo_list>
Current active port: "eth3.255" (ifindex "22", prio "0").
<ifinfo_list>
24: team255: 00:50:56:90:78:79: 0
22: eth3.255: 00:50:56:90:78:79: 24
*21: eth2.255: *00:50:56:90:78:79: 24
</ifinfo_list>
Current active port: "eth3.255" (ifindex "22", prio "0").
Current active port: "eth3.255" (ifindex "22", prio "0").
Port settings are picked up when I remove the period characters from the names.
when one adds an interface with a period in its name to a team device (e.g. a vlan interface). "teamdctl state dump" adds an extra level of json objects under the list of ports.
Environment:
Example:
The resulting port configuration (as per output of teamd -g) appears correct:
But the state dump is incorrect (key "255" is nested under "eth2"):
}
I'm not sure if this affects anything the json dump, and item get/set. things appear to work fine with the actual teaming of traffic regardless -- probably because ids are used instead of names -- but port configuration is affected (see following comment).
Getting items: