Do not fail on unexpected 'route_up' notifications from OpenVPN clients
authorJulien Muchembled <jm@nexedi.com>
Wed, 20 Aug 2014 12:07:29 +0000 (14:07 +0200)
committerJulien Muchembled <jm@nexedi.com>
Wed, 20 Aug 2014 12:25:13 +0000 (14:25 +0200)
commitd7d7b425413785fa5dbf99bbcb0fd43841e5ab9d
treed9d6768c17489c75032cc04aa57e7952aeac1518
parent2c3d66bbcde0682fa0d896c44978e391e38abb85
Do not fail on unexpected 'route_up' notifications from OpenVPN clients

This fixes the following error:

  TypeError: unsupported operand type(s) for -: 'NoneType' and 'int'
  Traceback (most recent call last):
    File "/usr/sbin/re6stnet", line 438, in main
      tunnel_manager.handleTunnelEvent(read_pipe.readline())
    File "/usr/lib/python2.7/dist-packages/re6st/tunnel.py", line 389, in handleTunnelEvent
      m(*args)
    File "/usr/lib/python2.7/dist-packages/re6st/tunnel.py", line 412, in _ovpn_route_up
      self._connection_dict[prefix].connected()
    File "/usr/lib/python2.7/dist-packages/re6st/tunnel.py", line 76, in connected
      i = self._retry - 1

What happened is probably that a route_up notification was received just before
killing/recreating the connection for the same node, and then process twice
the same OpenVPN notification: in this case, the first was for a previous
connection and should have been ignored.
re6st/ovpn-client
re6st/tunnel.py