Comment 3 for bug 1703698

Revision history for this message
Liping Mao (limao) wrote :

@hongbin, I can reproduce this problem, I find the problem is when run "iface.add_ip('fd34:d27c:33d3:0:f816:3eff:fe3f:8693', 64)"

If I only run iface.add_ip IPV4, it works:
>>> import pyroute2
>>>
>>> ip = pyroute2.IPDB()
>>> with ip.interfaces['tap1e510214-51'] as iface:
... iface.add_ip('10.0.0.8', 26)
...
{'family': 0, 'txqlen': 1000, 'ipdb_scope': 'system', 'index': 20, 'operstate': 'LOWERLAYERDOWN', 'num_tx_queues': 1, 'group': 0, 'carrier_changes': 3, 'ipaddr': (('fe80::fcda:a6ff:fe93:e328', 64), ('10.0.0.8', 26)), 'neighbours': (), 'ifname': 'tap1e510214-51', 'promiscuity': 0, 'linkmode': 0, 'broadcast': 'ff:ff:ff:ff:ff:ff', 'link': 19, 'address': 'fe:da:a6:93:e3:28', 'vlans': (), 'ipdb_priority': 0, 'kind': 'veth', 'qdisc': 'noqueue', 'mtu': 1500, 'num_rx_queues': 1, 'carrier': 0, 'flags': 3, 'ifi_type': 1, 'proto_down': 0, 'ports': ()}
>>>

If I add IPV6, it failed

>>> import pyroute2
>>>
>>> ip = pyroute2.IPDB()
>>> with ip.interfaces['tap1e510214-51'] as iface:
... #iface.add_ip('10.0.0.8', 26)
... iface.add_ip('fd34:d27c:33d3:0:f816:3eff:fe3f:8693', 64)
...
{'family': 0, 'txqlen': 1000, 'ipdb_scope': 'system', 'index': 20, 'operstate': 'LOWERLAYERDOWN', 'num_tx_queues': 1, 'group': 0, 'carrier_changes': 3, 'ipaddr': (('fe80::fcda:a6ff:fe93:e328', 64), ('10.0.0.8', 26)), 'neighbours': (), 'ifname': 'tap1e510214-51', 'promiscuity': 0, 'linkmode': 0, 'broadcast': 'ff:ff:ff:ff:ff:ff', 'link': 19, 'address': 'fe:da:a6:93:e3:28', 'vlans': (), 'ipdb_priority': 0, 'kind': 'veth', 'qdisc': 'noqueue', 'mtu': 1500, 'num_rx_queues': 1, 'carrier': 0, 'flags': 3, 'ifi_type': 1, 'proto_down': 0, 'ports': ()}
Traceback (most recent call last):
  File "<stdin>", line 3, in <module>
  File "/usr/lib/python2.7/site-packages/pyroute2/ipdb/transactional.py", line 209, in __exit__
    self.commit()
  File "/usr/lib/python2.7/site-packages/pyroute2/ipdb/interfaces.py", line 1057, in commit
    raise error
pyroute2.ipdb.exceptions.CommitException: ipaddr target is not set