The tunnel: T2920: Add checks tun with the same source addr and keys bring in new bug "if a sit tunnel available, the commit will crash".
Reason:
If a sit tunnel is in the system, the ikey is not available. Follow sit dict.
Fix:
Easy fix to change this line to
exist_key = tunnel_cfg['linkinfo']['info_data'].get('ikey', "")
or
change function get_interface_config to put ikey with a default value.
{
'ifindex': 9,
'link': 'none',
'ifname': 'tun99',
'flags': ['POINTOPOINT', 'NOARP', 'UP', 'LOWER_UP'],
'mtu': 1476,
'qdisc': 'noqueue',
'operstate': 'UNKNOWN',
'linkmode': 'DEFAULT',
'group': 'default',
'txqlen': 1000,
'link_type': 'sit',
'address': '50.9x',
'link_pointtopoint': True,
'broadcast': '216.21x8',
'promiscuity': 0,
'min_mtu': 1280,
'max_mtu': 65555,
'linkinfo': {'info_kind': 'sit', 'info_data': {
'proto': 'ip6ip',
'remote': '216.21x',
'local': '50.9x',
'ttl': 64,
'tos': '0x1',
'pmtudisc': True,
'prefix': '2002::',
'prefixlen': 16,
}},
'inet6_addr_gen_mode': 'none',
'num_tx_queues': 1,
'num_rx_queues': 1,
'gso_max_size': 65536,
'gso_max_segs': 65535,
'ifalias': 'HE IPV6 TUN',
}