diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2013-11-27 16:00:48 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2013-12-02 07:45:42 +0900 |
commit | 9a2f31e3deab9f00d70c78378d6c2317ff7805e1 (patch) | |
tree | 396adf28845ac17833f1dc55dbec37df9d4d75bd | |
parent | 60d8f416a7967f7124a63eb4fb067bcfbf86fb95 (diff) |
vrrp: handle interface failure
handle temporary interface failure.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r-- | ryu/services/protocols/vrrp/monitor_linux.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/ryu/services/protocols/vrrp/monitor_linux.py b/ryu/services/protocols/vrrp/monitor_linux.py index a1226e94..e3337de2 100644 --- a/ryu/services/protocols/vrrp/monitor_linux.py +++ b/ryu/services/protocols/vrrp/monitor_linux.py @@ -187,6 +187,9 @@ class VRRPInterfaceMonitorNetworkDevice(monitor.VRRPInterfaceMonitor): except socket.timeout: self.logger.debug('timeout') continue + except: + self.logger.error('recv failed') + continue if len(buf) == 0: self.__is_active = False break @@ -200,7 +203,11 @@ class VRRPInterfaceMonitorNetworkDevice(monitor.VRRPInterfaceMonitor): @handler.set_ev_handler(vrrp_event.EventVRRPTransmitRequest) def vrrp_transmit_request_handler(self, ev): self.logger.debug('send') - self.packet_socket.sendto(ev.data, (self.interface.device_name, 0)) + try: + self.packet_socket.sendto(ev.data, + (self.interface.device_name, 0)) + except: + self.logger.error('send failed') def _initialize(self): # nothing |