From patchwork Wed Dec 16 12:04:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Gray X-Patchwork-Id: 1417098 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=R2f6FD3E; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Cwv2G5LzTz9s1l for ; Wed, 16 Dec 2020 23:04:54 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 5CF9685FFD; Wed, 16 Dec 2020 12:04:53 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id H7YKZE3shKV2; Wed, 16 Dec 2020 12:04:52 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by fraxinus.osuosl.org (Postfix) with ESMTP id 0263585FA5; Wed, 16 Dec 2020 12:04:52 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id C7665C1D9F; Wed, 16 Dec 2020 12:04:51 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id A4599C1DA0 for ; Wed, 16 Dec 2020 12:04:49 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 8DAC286976 for ; Wed, 16 Dec 2020 12:04:49 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YU6FOEcvfbSs for ; Wed, 16 Dec 2020 12:04:47 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by whitealder.osuosl.org (Postfix) with ESMTPS id 457C58697C for ; Wed, 16 Dec 2020 12:04:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608120286; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/pHETdOeDQBoOLPpUX139zuvmv62lxHu0ioRoqaRzzw=; b=R2f6FD3EB6aM+7Sch2oLcqacFX+7Y+KJvGiyKxXmEU9/LBG7UysH2r0IDXci2Ua+6F3SrD kymwV5wkvhnp4Z5TALCZX/i8yxFJYqYuuS960pYR5uBivU3WszFWDlBVuEs1fKB6o4qfPg 10oHh+ApbkT7pW21p6LyuFidezU7LGo= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-457-Khe8Oj4aNVK8lwPX_7Sxrg-1; Wed, 16 Dec 2020 07:04:44 -0500 X-MC-Unique: Khe8Oj4aNVK8lwPX_7Sxrg-1 Received: by mail-wr1-f71.google.com with SMTP id r11so9386139wrs.23 for ; Wed, 16 Dec 2020 04:04:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/pHETdOeDQBoOLPpUX139zuvmv62lxHu0ioRoqaRzzw=; b=LeKtST/kPq4o566AjO5qTgnzsk44sVSjsDhBEw1Mz9B6gB1uhgUuwK0xW+W2IDqf20 tRYkSGDBFsUqMCzb655pQin/rmpXkHbH17Ep+A8B90BEHk4N6vgEyq+uzRDfkgEX6ary J5RwI6WmjlXI5V9VQUG+MDLZxYG4wDkjNhS2ZrsziQjDuZafZ7y9kEkke5vHSo4QsNrL lWk9qBJ46HLL/iRiPlpXhdqfqpIZSFSYc4mpnIY+R761gO69DnECfI+lFlzNdvSKTa3b Q8+FLMn5acMEHEX2N8pIv+LxmKEGKNvkg3ZmuHXtWZhEUq3359u+FBPbDkV9ExMD+kEO TjMA== X-Gm-Message-State: AOAM533khTlJUdejJjwIkIBKNAwAzIgiL/RFFtOlME0ykb8R8OyEcbbO MBFMcS6xpXfGnV+BT7phYTKuMH6VvHUvCwDg0b6gZBo04CMnpyaz5hzzMEQQqY4BNMh8LzKQvce GWNGHwpTz/052 X-Received: by 2002:adf:e54a:: with SMTP id z10mr38634227wrm.1.1608120283657; Wed, 16 Dec 2020 04:04:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJytz1tzdwhT7uj3puJuYagSdurt/Vb+GkKCoIOI6b1MP4wjvrixB0neX43C3vmtJT1DSQ3TMQ== X-Received: by 2002:adf:e54a:: with SMTP id z10mr38634220wrm.1.1608120283531; Wed, 16 Dec 2020 04:04:43 -0800 (PST) Received: from wsfd-netdev77.ntdv.lab.eng.bos.redhat.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id b7sm2739536wrv.47.2020.12.16.04.04.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Dec 2020 04:04:42 -0800 (PST) From: Mark Gray To: mark.d.gray@redhat.com, dev@openvswitch.org Date: Wed, 16 Dec 2020 07:04:34 -0500 Message-Id: <20201216120435.3453365-4-mark.d.gray@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201216120435.3453365-1-mark.d.gray@redhat.com> References: <20201216120435.3453365-1-mark.d.gray@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mark.d.gray@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH 3/4] ovs-monitor-ipsec: Allow exit of ipsec daemon maintaining state X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" When 'ovs-monitor-ipsec' exits, it clears all persistent state (i.e. active ipsec connections, /etc/ipsec.conf, certs/keys). In some use-cases, we may want to exit and maintain state so that ipsec connectivity is maintained. One example of this is during an upgrade. This will require the caller to clear this persistent state when appropriate (e.g. before 'ovs-monitor-ipsec') is restarted. Signed-off-by: Mark Gray --- ipsec/ovs-monitor-ipsec.in | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ipsec/ovs-monitor-ipsec.in b/ipsec/ovs-monitor-ipsec.in index 1793088d9be1..cac42d7b2b31 100755 --- a/ipsec/ovs-monitor-ipsec.in +++ b/ipsec/ovs-monitor-ipsec.in @@ -1146,6 +1146,11 @@ def unixctl_refresh(conn, unused_argv, unused_aux): monitor.ike_helper.refresh(monitor) conn.reply(None) +def unixctl_exit_noflush(conn, unused_argv, unused_aux): + global exiting + # Do not clear persistent state + exiting = True + conn.reply(None) def unixctl_exit(conn, unused_argv, unused_aux): global monitor @@ -1205,6 +1210,7 @@ def main(): ovs.unixctl.command_register("tunnels/show", "", 0, 0, unixctl_show, None) ovs.unixctl.command_register("refresh", "", 0, 0, unixctl_refresh, None) + ovs.unixctl.command_register("exit/noflush", "", 0, 0, unixctl_exit_noflush, None) ovs.unixctl.command_register("exit", "", 0, 0, unixctl_exit, None) error, unixctl_server = ovs.unixctl.server.UnixctlServer.create(None)