X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=debian%2Fovs-monitor-ipsec;h=50242774a2933164ae28c030f02b620649e46439;hb=c563de0e389f42164d4f7bf76845dced4590a18c;hp=87a149113f1bc2df61e5c301ed3d09c98a21cb99;hpb=bf42f674e77a4cb01863b3f975d3258b3c89dd58;p=openvswitch diff --git a/debian/ovs-monitor-ipsec b/debian/ovs-monitor-ipsec index 87a14911..50242774 100755 --- a/debian/ovs-monitor-ipsec +++ b/debian/ovs-monitor-ipsec @@ -1,5 +1,5 @@ #!/usr/bin/python -# Copyright (c) 2009, 2010, 2011 Nicira Networks +# Copyright (c) 2009, 2010, 2011, 2012 Nicira Networks # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -42,7 +42,7 @@ import ovs.vlog vlog = ovs.vlog.Vlog("ovs-monitor-ipsec") root_prefix = '' # Prefix for absolute file names, for testing. -setkey = "/usr/sbin/setkey" +SETKEY = "/usr/sbin/setkey" exiting = False @@ -266,11 +266,11 @@ class IPsec: def call_setkey(self, cmds): try: - p = subprocess.Popen([root_prefix + setkey, "-c"], + p = subprocess.Popen([root_prefix + SETKEY, "-c"], stdin=subprocess.PIPE, stdout=subprocess.PIPE) except: - vlog.err("could not call %s%s" % (root_prefix, setkey)) + vlog.err("could not call %s%s" % (root_prefix, SETKEY)) sys.exit(1) # xxx It is safer to pass the string into the communicate() @@ -421,17 +421,20 @@ def main(): ipsec = IPsec() interfaces = {} + seqno = idl.change_seqno # Sequence number when we last processed the db while True: unixctl_server.run() if exiting: break - if not idl.run(): + idl.run() + if seqno == idl.change_seqno: poller = ovs.poller.Poller() unixctl_server.wait(poller) idl.wait(poller) poller.block() continue + seqno = idl.change_seqno ssl_cert = get_ssl_cert(idl.tables)