From patchwork Wed Feb 23 06:50:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 12756488 X-Patchwork-Delegate: dsahern@gmail.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 85E44C433F5 for ; Wed, 23 Feb 2022 06:50:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238142AbiBWGul (ORCPT ); Wed, 23 Feb 2022 01:50:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238300AbiBWGuk (ORCPT ); Wed, 23 Feb 2022 01:50:40 -0500 Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [194.104.111.102]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E46226E2A2 for ; Tue, 22 Feb 2022 22:50:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1645599012; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0ttU4fHc61Snhsom8a65L/6WVy5QJJteLGtkqtOGFZg=; b=kCtiAq6axWCOmyAV2M0YBtA6KCb9AEYa7a7u/L5ql6SeOdNYkYtyZfRhVObDdtPeqaVORg ihqxtnvtP0cfZBnY+wJQEAEPKbX6JPvs64jmf/6uHYh8/xJ7k1/1foq7LDQ1d/LoiVQa9U yPEJx1rdkJZIig66KbJ6brdDdgYfdeg= Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04lp2056.outbound.protection.outlook.com [104.47.14.56]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id de-mta-8-lrfSABZeNxqbQ7wITMEkkA-1; Wed, 23 Feb 2022 07:50:11 +0100 X-MC-Unique: lrfSABZeNxqbQ7wITMEkkA-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BJc66TWzxt7qF7tq6h8CTrgSOqPS0T1sOVRUhBJjoOeCeQJ2yzlEp4jjMFZtU4oguS/ljRUp5L3xrOIKScLHps0tqP7NNJK8/VunFo9duFvMU+8T5vuk6N+rqSkz6tmCo0nER/9Er298egUz2dHVnFQK3mDGbCfYa+pBWkt1KWxcZoX8DfdjAlkeW/uOQFaazlaB30a6Z8qwbxZcK4OG12QGgXoSQbAefagfrHr52QeyEnT16vmbfS9dUoo8obChZT6K5r5q6Vc27Lzl60iwjWFQmiRXO1WfCo30zIxrl6J2BueVFrl5gMbxppkJAigBgvhrSVbX+H2/h9jKGnbtXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=nERJeosA0j3rvIDmBgck48UQ1C4Q+JXdi1jZ/BjMB4c=; b=Kkn4NBp+Juw5VSsaZQH93q6uoPSnu4Kt/iCiPH7qYN/E/rjhQzd53fNAzmW2c1JLwtGT5kutzuv61fayFUm6ZtYU3AfWcbVuEY/5Ic4TVD5XWPcFwR21Sz4LhYkbhp2aME/v6QXDeOWFLFvjm9XygMPxE9/Qm4Zxa7kDYUI61BcMXWNtwrEHkuxW3BvKk7LBKaO0p4daYeQAkvXr6qfuIcH+a15D7iRc38lgBiQuCptW/2rLHutQmI/Gilxf2CeSehwCtUK4OcBCPt1V0CzWCPW7fRFwmvtNpiO6tWFzYmG7wHvC3nYmz7giL6QRZoeRvMd/qbkaUn1QTNVz2RFwnA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) by HE1PR04MB3290.eurprd04.prod.outlook.com (2603:10a6:7:20::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.21; Wed, 23 Feb 2022 06:50:09 +0000 Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::60de:f804:3830:f7c5]) by HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::60de:f804:3830:f7c5%4]) with mapi id 15.20.4951.019; Wed, 23 Feb 2022 06:50:09 +0000 From: Geliang Tang To: Stephen Hemminger , David Ahern CC: Geliang Tang , netdev@vger.kernel.org, mptcp@lists.linux.dev, Mat Martineau Subject: [PATCH iproute2-next v3 1/3] mptcp: add fullmesh check for adding address Date: Wed, 23 Feb 2022 14:50:37 +0800 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-ClientProxiedBy: HK2PR0401CA0004.apcprd04.prod.outlook.com (2603:1096:202:2::14) To HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 65c6ef69-d0c3-4884-3ddb-08d9f698bbda X-MS-TrafficTypeDiagnostic: HE1PR04MB3290:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OyA3dzC92j0rnfeMzV2tzB3/AoMz6KqwoGj+5eR/MgQgbevI7VwYadIHg+ASURgRrN9Kkx0ol8ByIZPhGvry6CaQRhfjnMH7Urrsc1DRKe1SqulhxS1ydtojCBvJJq+s7sifYfLcik9Lvwn6r3wC68tXeDS64y/+phtLMW+fYs0/4AMQCIOqNjvzGjyedXhqjgVtDqqGlpbd+KPhidZbBSJvclpyFJc3sLLGr4vSriX/3EgyVsFySOSkKB7pRNgg6Zk/w9LejBBP1mEUQUfJdX8+r1UbH+Uc5Dh/1scPrqRlskIqKX5feDN0yIylvFO/1jIrRa2dyap9ZuNupyrG4ZNyGfWxaGbZCaQUm6xO57zK1WoXn7l3r0xeeKeu/yydLD27ZgEcGUUAC71k7huq7Nu/KHY8OMVclafHXmo3KpXvKU976Tr/hpj7s6l33VZejXaEvClXz7JYew/bbaQabbGzxGOXO/6PdjqBrOcs5Fyzq0CQUSQOz6aUpjcR3AR6bHwmhSfNsCsycDThxGkHnzWDyy594FrZ+N5VAcqyNX8RdWDWYtvWCb9zlrc/XFZlAoMh9z30ACNZLkDuBMs+WhOsbiaaDPj+WjSUC8G8xN2QoXepe6WIrl3OMD4dcXr1EkyfoqjKUBjbf+uR/SOTZQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:HE1PR0402MB3497.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(8676002)(66556008)(44832011)(4744005)(66476007)(66946007)(38100700002)(86362001)(4326008)(5660300002)(8936002)(2906002)(36756003)(6512007)(110136005)(186003)(26005)(2616005)(6486002)(508600001)(6506007)(54906003)(55236004)(6666004)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 3gin9KNPQDDFuT97xHOSvDzKL4EQDKHLndo6vEN2j3uBC5fgGdnhTILZyJdW/wOpltHsCDU5nASSA+lb4DbiF1kJQViNlxXggG1GOhKQn4DLpvLqbenDnNWbQ5RLOTVT90p5MdIQ2ViTGayynUpLnz3t8A+HhqEi5HPt7Y2vTwqrUZpH9YR6poRbYq7+8ER+e0ftYRs6/kC4r8YGZKYm7cxAwQjfEFRMVFAoVMb63ExDwFcMFrTw2HnSHx8gzBhkwGuaGaQQPcEx8dS/85lj2O6ZLEl4nuJlNh7mPbz2RvBOqxMX+Vqpdk4P1eDixl3m3XeItJDP55WipMwW1az7c7SGi9hhxgUYocjnmqpLLBqGSJpHCpsvp8kDWzhklO9bGiRwRO2fTD8RAuD1Odzx3ufcRlS8rUt3eZIRIS0DP5avfnHV01QsvhnlYYNwiheOLxs7kfHFaUqBzw4rhHT+W0uvv0fkaaqdm/huOdTJQcCZDezBckF7g/a/LmPBh9Pkf/QgprXnK6wVLXB5hDFKbN2LAJkxRZjbu50UJVWAGrPDaB+CcqU3Ry8z+v0DiLnnuz1B1E91vKP7mpqzhozcNGd8qm0lkg8k6Awjeehd4JAGvdkM5mfB36G5GrUBJyRAdUEzFYKHkxxd4JiyoaE5ayzoN3zYzIiz84I1al0AKowkPJKKm2hISxGJ0Bnqrhej7F3wkbeT1lXgPBA6qTINyDjw25tkJElbIgTZ/0YVYqcI/32tqRloyv3Dm4yD43XlUSWCumCoQAB+x/JkMJSsFktJAni+6qXZ3lQPMEy0c8B27BTx13YyICM2rp3Hu8OSrqPKFl+4vtofcAOThQbkZNjl0g2x8lN/s2RcfeNN/OCyj5o6KqsQRfMD4ybHNiq9owC0Fx1IwkMzjg5eM0SXuaGaFOcXMD7WefkmlHTx4eJ3xtXmenLiBRhQC9lKwsI9VWO00nLpjCFgRVG9j9Y3tqsH9Wh33mkYws850Z1WiZMdXCs0UH5tiJqy29WEL3AEnDfISHz8ozQku+K1VZp7z/KN44xM2iCcmDGRtUeVrMJBEpFklI0a2FqtxgqKNLUFb0wMFEeBeTyeH9uyZQq8WxOs7LbSWmvv3N6ncs864SMYIRiWrsLHWhiOQyDaY2jUWFYydvxZ2V/Qs7CTttTlJAxbpqB83E5JnlQTHYTwDUohC0N2XJ/p3nJ5c7aOnPu2uSWhDKN02tNRbIWzK8MDPfgcy1SJCVwKiWe3LmTLAj7w99IT9scwBUwNYJHJ1uD8cS36NQLr7YztLfgSmYJbLRAj61zq/P0rIpICb2yU2Oi9Vz5Cr4D4bFaEgrhw9gZ4z6eyx9I5/UxF0CFTqTX92B1o3QZ1TF3lJ0W5G2RdUIsNWkSkVbdJjBNPJuP5u6SfONcj0c1iNj9qaRxgxtMHOlEa9gLM7BsHxhwiGJU9dbg+WRmdpI0Hq4OgZRojgbltchCHzSHqVEM5hiBffSFCMCv0z5jazEmwozg6MbX3fdwd81adwomE4ODk6ThqwDynxsByOF+bWIp1c7jgC3MtdJ3eG9YAFTHEGTJLYBY1M3K4GVsJkNs6fV588hRj1yyS05sEbMTHUqWS3URtsC0PlYOoayYxJFfZZbYGubjA0pc= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 65c6ef69-d0c3-4884-3ddb-08d9f698bbda X-MS-Exchange-CrossTenant-AuthSource: HE1PR0402MB3497.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Feb 2022 06:50:09.7833 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: cxe/pDH1wOaBegnW2kEeKC41TeYccM4rmsr3zPx9SntL7y0DNJjDZPZu10wYF6IYiMUbahnObMr2jvBzULthtQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR04MB3290 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: dsahern@gmail.com The fullmesh flag mustn't be used with the signal flag when adding an address. Commands like this should be treated as invalid commands: ip mptcp endpoint add 10.0.2.1 signal fullmesh This patch added the necessary flags check for this case. Acked-by: Mat Martineau Signed-off-by: Geliang Tang --- ip/ipmptcp.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ip/ipmptcp.c b/ip/ipmptcp.c index eef7c6f4..5682c7df 100644 --- a/ip/ipmptcp.c +++ b/ip/ipmptcp.c @@ -116,6 +116,11 @@ static int mptcp_parse_opt(int argc, char **argv, struct nlmsghdr *n, int cmd) ll_init_map(&rth); while (argc > 0) { if (get_flags(*argv, &flags) == 0) { + if (adding && + (flags & MPTCP_PM_ADDR_FLAG_SIGNAL) && + (flags & MPTCP_PM_ADDR_FLAG_FULLMESH)) + invarg("flags mustn't have both signal and fullmesh", *argv); + /* allow changing the 'backup' flag only */ if (cmd == MPTCP_PM_CMD_SET_FLAGS && (flags & ~MPTCP_PM_ADDR_FLAG_BACKUP)) From patchwork Wed Feb 23 06:50:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 12756489 X-Patchwork-Delegate: dsahern@gmail.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5118DC433EF for ; Wed, 23 Feb 2022 06:50:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238377AbiBWGus (ORCPT ); Wed, 23 Feb 2022 01:50:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238300AbiBWGur (ORCPT ); Wed, 23 Feb 2022 01:50:47 -0500 Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [194.104.111.102]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BABE46E286 for ; Tue, 22 Feb 2022 22:50:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1645599019; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FOiz53udsAO5Ixsj+2pEay2qh39q2lWPP75LTQw+TEw=; b=j4MVShYLnkmjaaKAca26ZFDuqTHFh55C1Dm/64yD/jbo8qniKUmSd9QwX4gaSzz/qIylNB oyNu1BxSSTmedIgcJQEwJ0pa0KJTTemmTzjxLqyz59PAzeJrBbqMyiQMyMwTf64W1gAteW 18Md6zqn+lnJPgC8Hok/GOCE3GKth4I= Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04lp2059.outbound.protection.outlook.com [104.47.14.59]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id de-mta-20-kPRCISqIOj6sB5yuCwfznw-1; Wed, 23 Feb 2022 07:50:17 +0100 X-MC-Unique: kPRCISqIOj6sB5yuCwfznw-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R9g+TnbMOtvKwDzYSQ3QMvxpZxGAzN2uQfZjH9JuUaYbmDEiEDrqi2emIR7Sm4wbChWo2Fco/U7teMe9qTya2m3iFBkzdwYhE2UarrYqZwcSGzSufZW11cJpkIsbeJ9cSBYn2OLPciYKHWtg2u7VWKu5/gieSZsDg40jbhyzsScsDl8dqYYRBR6bYN3ZBKm4QpZ1gDAkXQaV1npvZxBH88jtJdAffa2o0B9XHdye9Dj9SsTdY60gwwgakyBbdoCWbSeyiIY/7LjQHt1X6GD3NeYBS8P45960pB8uuSDbbyOho6037rGiIOQTfiQ00TQuu8Eidh+LYp0qb7Dgv2AS3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=keAT9dbX5v6/e3rLu0ICirtktJA/LOZfZdPYTlhmmdk=; b=ENBeeR2ZajMhmdEEBaEhzAMcmFU4A7ZfF/9jcP/ZySsuJ+mDe7zErODGwRj101mZuJpzqqeMQ44zABaYoA6Y44z5JVcH4kj2YhiQTopIrMdNFy703M27pdOCHB+8oF1LGnLmFwYMARca3ephoU/QCc4f1hYC2AWMX+VQA71zWqp47Bw7Ct5sQKL+fRDOIeR7tNst4VSPRJRewEjJznTOfYvYndWkKSm2mST4oCKP4EBALAnli3vaDi6Wb4eX4K48grGcgAScK7WLcCCmLZFWWt0JSEnYNF0TrcqfS2VYWOczQmzYoMvC0oHNtNSu9E7OKg4OF980nJ0Q6SkSLakCdg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) by HE1PR04MB3290.eurprd04.prod.outlook.com (2603:10a6:7:20::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.21; Wed, 23 Feb 2022 06:50:16 +0000 Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::60de:f804:3830:f7c5]) by HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::60de:f804:3830:f7c5%4]) with mapi id 15.20.4951.019; Wed, 23 Feb 2022 06:50:16 +0000 From: Geliang Tang To: Stephen Hemminger , David Ahern CC: Geliang Tang , netdev@vger.kernel.org, mptcp@lists.linux.dev, Paolo Abeni , Mat Martineau Subject: [PATCH iproute2-next v3 2/3] mptcp: add fullmesh support for setting flags Date: Wed, 23 Feb 2022 14:50:38 +0800 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-ClientProxiedBy: HK2PR06CA0024.apcprd06.prod.outlook.com (2603:1096:202:2e::36) To HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 53111552-94ff-4d6b-fbb4-08d9f698bfb9 X-MS-TrafficTypeDiagnostic: HE1PR04MB3290:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: l+C8rKpupRlYGIqlyI8LLJKslFKj7F7Vx8mSgBynBeTACfbFYMAvdjZCLOxbxFkbhcOj+UqfCftZNAI4PYFewt3BZP7LNw2m9/bLXj4Q0Fz9CAtTiW728ZESqZ08bbBUerkj9BvStJZBlcBb6wWNqln3wbkoUq2VcQ+tLqPpiDuknfhq/UBD83ILafdI4927+eHh/pfM8WF0k45V66v9LjYUjOBgdFy8wMt7I495CpbXd63RIlRWqqdPTFL3BXF+ROgUklXq3ZNG+haXxjnY6xEf4hFTWiTqcXpXNln/GDfMXHYiHLxDWdKC7ExuapQCmYdxL/Gc30DGQfbJ3P0uiVuwRoSHHyoiLBwS42uXUP49mQ+8wAc1J/mhe+cttO+cURUDiFmBZ40ECcQHvEysdz4Xqf58l1jXHF4I9Sha6prWlJ5zweVmD0NAz3dnYr/Qkw+8eP9stWW9YUlZ/japisafdmiD+s6tWzA8ufGYhLIZWOCPOFXIh54QZYKjnZgUqptYMQbK0zDwTHiyAqPZtdcVWlN0lHXiP17ebaailmEQkfqwjghBi3CIjisSMeYiDGqanT74WNBKUWvNLc73iLtipUgStdPYRaxuRK+Gg+DprBa00VDONCyXDNoPlcpxmXWM91KviG5xMhiaLGWO4A== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:HE1PR0402MB3497.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(8676002)(66556008)(44832011)(66476007)(66946007)(38100700002)(86362001)(4326008)(5660300002)(8936002)(2906002)(36756003)(6512007)(83380400001)(110136005)(186003)(26005)(2616005)(6486002)(508600001)(6506007)(54906003)(55236004)(6666004)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Bjn7oICOIX+k9h37QsaeGWYFMPt6wx3LFX0S6ZibcM+zmgOTwF3yM7o3fghPqH23oGDjLJg+8KEDNolZl3vXxy/xbFD8nYpah+M7OovUfHfwrahjRYu2CRn94jzIgigtGZ7DnPSUozARFMmFSvwasgF4+nyk6xQaeeAaWo8JbQ6qOUdVwjlbLAw4/Mes6QlvP9nhnjjAVB7dJz9osunLg9aZIe/NljxV+UK/k1O+hvLO28vwpVOhKou9FGle5rRlrqD3pNQCtXxMa9c76W031GXJLXhyIN7m6/gq6AB8XAIzkR1/QBwnmg89x9xr0GInaWbXO0SgQu/jlMB/t8WzVyeiBZZWFPZNcAcKeBBG+HlreD7Rbs4y/9XbZEhzRHkjCuBUrgQSn0SBUNESw9uaUnL1bbwxrxW8XlY8ViCaEnleSDMZBfNPqXP3auLJ7fI8p5p2j2OGBQpYuz5sb3DbEXGfCXUA+PMdvi0f25ENqEj0YVeLcQcdgvg/07zoCohWKyHSatdrBM9jI5Qxo13+iwwblu8X/z5WjcUe47KYDkk+I5MxVT7E43u9agDtuPrmCNCWvpgq+Z8wElD6heAYbRsRwXRBZjS+qbp6BagOkSbnDE9jiOee1pJyDOm5pbkticbimF2tgA5fuiBz77cY1vLgtDjKWJLqPjBuRY+1tXXMMQFYYOQmtFghjI7O3LNarsotvAHWXgnoyV2wwRPjn7zophX250NQudZCwlXM+xMRuC+3BsUwJWvxxfDsnOPcZk9gESm4Ac93OAMIF3Ms4685DpBd/90itT8bmtzKb/JMOa4G4hj736Mmnw6ZpOsJq5UgPhtE75wlhyGjUFnDFS1LSeVy9R8u0emqS1TRL9XZjB3xjJBBUS+ULRML0deON58F+TK9G97oCYAeKU5QXHW0G9v3s+8r0CxIMHQDg3VcL+c37hxFATSptAh+KIkApQVx1ZSAWtODJxrFKvtM6JQ3/wmp5QRLLzs/K8CxgkQZiCgfbbPGeqtqA0BY2BciFfY6Q3U/MJnJJxinOCRv6YVmXQj/eO1/Uk13MxZcs/alFANY0Wevo7ivsDvOfNia4nCmCRJXNG7oHQ0kkYdMsC1oPp/wqt147v1B7HeqnbpLRicXuCaeVDZWyIe4JpIUEnE596iff2p8UzBwS1neVGV4aPFMKVhtovK1fmFDBMQyqXM7zKRrO9p0UJq6wZQwUf1EakS1JeIWe1W4vRxonAgWCiF3LFcQQDZc8hoqEgvugbI5Gnqoyi1J1++x9apTHRoOjIbpwlXPUksIcVT0t9bGZjnLj7GxirLk0tff1Wkq7TndwWqTIU83xWBdHRfzceXaBUmYR3vWQxA6dAHfKUGniLlv5n9b9/HIz9u+nTUkoYOPyTpIBN1gRrATNidkhxPsHofEEvIShdAf3WgPlfvGu4eZsWPsUId9Ajq8SacANBFP0uYgIN2RN+W79kArb23vIcK1RGyGOIA6T+7yy4OxkfQIVMAeg5EqLwZjocfPJsr6GTHmHza+yBGz+wxTpDP+kvKDfr8+Ypa2gw6kn5tI9APizHDAR/gO1DtTyRxj6fFr0zeKBpMLgcEi/wYmuGsZ9f6hQ6F8Flt6dKMjRlhJ3ZA/g/ROC8UMtAAB3Mw= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 53111552-94ff-4d6b-fbb4-08d9f698bfb9 X-MS-Exchange-CrossTenant-AuthSource: HE1PR0402MB3497.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Feb 2022 06:50:16.4546 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: GpzouTvi40f6coDdz5Nopolmk9J6AaTgoD4qX5GiVYZsqJdpJq4Dqb0ceZW7vl7Rq2TkZ2SNNVNaYXi+PWZtdQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR04MB3290 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: dsahern@gmail.com A pair of new flags, fullmesh and nofullmesh, had been added in the setting flags of MPTCP PM netlink in kernel space recently by the commit 73c762c1f07d ("mptcp: set fullmesh flag in pm_netlink"). This patch added the corresponding logic to pass these two flags to the netlink in user space. These new flags can be used like this: ip mptcp endpoint change id 1 fullmesh ip mptcp endpoint change id 1 nofullmesh ip mptcp endpoint change id 1 backup fullmesh ip mptcp endpoint change id 1 nobackup nofullmesh Here's an example of setting fullmesh flags: > sudo ip mptcp endpoint add 10.0.2.1 subflow > sudo ip mptcp endpoint show 10.0.2.1 id 1 subflow > sudo ip mptcp endpoint change id 1 fullmesh > sudo ip mptcp endpoint show 10.0.2.1 id 1 subflow fullmesh > sudo ip mptcp endpoint change id 1 nofullmesh > sudo ip mptcp endpoint show 10.0.2.1 id 1 subflow It can be seen that 'ip mptcp endpoint show' already supports showing the fullmesh flag. Acked-by: Paolo Abeni Acked-by: Mat Martineau Signed-off-by: Geliang Tang --- ip/ipmptcp.c | 20 ++++++++++++-------- man/man8/ip-mptcp.8 | 8 ++++++-- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/ip/ipmptcp.c b/ip/ipmptcp.c index 5682c7df..c7b63761 100644 --- a/ip/ipmptcp.c +++ b/ip/ipmptcp.c @@ -25,14 +25,15 @@ static void usage(void) "Usage: ip mptcp endpoint add ADDRESS [ dev NAME ] [ id ID ]\n" " [ port NR ] [ FLAG-LIST ]\n" " ip mptcp endpoint delete id ID [ ADDRESS ]\n" - " ip mptcp endpoint change id ID [ backup | nobackup ]\n" + " ip mptcp endpoint change id ID CHANGE-OPT\n" " ip mptcp endpoint show [ id ID ]\n" " ip mptcp endpoint flush\n" " ip mptcp limits set [ subflows NR ] [ add_addr_accepted NR ]\n" " ip mptcp limits show\n" " ip mptcp monitor\n" "FLAG-LIST := [ FLAG-LIST ] FLAG\n" - "FLAG := [ signal | subflow | backup | fullmesh ]\n"); + "FLAG := [ signal | subflow | backup | fullmesh ]\n" + "CHANGE-OPT := [ backup | nobackup | fullmesh | nofullmesh ]\n"); exit(-1); } @@ -46,7 +47,7 @@ static int genl_family = -1; GENL_REQUEST(_req, MPTCP_BUFLEN, genl_family, 0, \ MPTCP_PM_VER, _cmd, _flags) -#define MPTCP_PM_ADDR_FLAG_NOBACKUP 0x0 +#define MPTCP_PM_ADDR_FLAG_NONE 0x0 /* Mapping from argument to address flag mask */ static const struct { @@ -57,7 +58,8 @@ static const struct { { "subflow", MPTCP_PM_ADDR_FLAG_SUBFLOW }, { "backup", MPTCP_PM_ADDR_FLAG_BACKUP }, { "fullmesh", MPTCP_PM_ADDR_FLAG_FULLMESH }, - { "nobackup", MPTCP_PM_ADDR_FLAG_NOBACKUP } + { "nobackup", MPTCP_PM_ADDR_FLAG_NONE }, + { "nofullmesh", MPTCP_PM_ADDR_FLAG_NONE } }; static void print_mptcp_addr_flags(unsigned int flags) @@ -102,6 +104,7 @@ static int get_flags(const char *arg, __u32 *flags) static int mptcp_parse_opt(int argc, char **argv, struct nlmsghdr *n, int cmd) { + bool setting = cmd == MPTCP_PM_CMD_SET_FLAGS; bool adding = cmd == MPTCP_PM_CMD_ADD_ADDR; bool deling = cmd == MPTCP_PM_CMD_DEL_ADDR; struct rtattr *attr_addr; @@ -121,10 +124,11 @@ static int mptcp_parse_opt(int argc, char **argv, struct nlmsghdr *n, int cmd) (flags & MPTCP_PM_ADDR_FLAG_FULLMESH)) invarg("flags mustn't have both signal and fullmesh", *argv); - /* allow changing the 'backup' flag only */ - if (cmd == MPTCP_PM_CMD_SET_FLAGS && - (flags & ~MPTCP_PM_ADDR_FLAG_BACKUP)) - invarg("invalid flags\n", *argv); + /* allow changing the 'backup' and 'fullmesh' flags only */ + if (setting && + (flags & ~(MPTCP_PM_ADDR_FLAG_BACKUP | + MPTCP_PM_ADDR_FLAG_FULLMESH))) + invarg("invalid flags, backup and fullmesh only", *argv); } else if (matches(*argv, "id") == 0) { NEXT_ARG(); diff --git a/man/man8/ip-mptcp.8 b/man/man8/ip-mptcp.8 index 0e789225..bddbff3c 100644 --- a/man/man8/ip-mptcp.8 +++ b/man/man8/ip-mptcp.8 @@ -41,7 +41,7 @@ ip-mptcp \- MPTCP path manager configuration .BR "ip mptcp endpoint change id " .I ID .RB "[ " -.I BACKUP-OPT +.I CHANGE-OPT .RB "] " .ti -8 @@ -68,10 +68,14 @@ ip-mptcp \- MPTCP path manager configuration .RB "]" .ti -8 -.IR BACKUP-OPT " := [" +.IR CHANGE-OPT " := [" .B backup .RB "|" .B nobackup +.RB "|" +.B fullmesh +.RB "|" +.B nofullmesh .RB "]" .ti -8 From patchwork Wed Feb 23 06:50:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 12756490 X-Patchwork-Delegate: dsahern@gmail.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 16FB6C433F5 for ; Wed, 23 Feb 2022 06:50:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238470AbiBWGu4 (ORCPT ); Wed, 23 Feb 2022 01:50:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238300AbiBWGuy (ORCPT ); Wed, 23 Feb 2022 01:50:54 -0500 Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [194.104.111.102]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B9A76E352 for ; Tue, 22 Feb 2022 22:50:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1645599025; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=czTWBunkqDmTRriLhyIwr+8oCa80d/cjHM2qiQeFaQ0=; b=g7g7zVp7TWgcgKq8X17MzAb8aXJguczUa+C6JbOXBZZIMZaDIKOvVfrl3gmoQ9WUZr0yht 1fglP69hoT2BXOUFFRQAze/XxijdjDGW2SyTDHhfnSu4AMPb2F4pSL+4UeKfdiXu2CUJ18 2SluKzHk+VoUkhAh9Dsp53xu+GXVU9E= Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04lp2056.outbound.protection.outlook.com [104.47.14.56]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id de-mta-30-9Esq5DRtNoiE3WwxiJbFGA-1; Wed, 23 Feb 2022 07:50:24 +0100 X-MC-Unique: 9Esq5DRtNoiE3WwxiJbFGA-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N1RDpTyu8y6WiUtU0VNiuhaKJ32hFVNScla3XfLGYKTsC43gbzkJXH/UqeSP6dHHTBkW6Wm8JwTk9cuhIRhLZSEhdr0+qIHJrW7TCFMtBvxtd4gT3pBahU/fQXFdfEUEUE34TsjiEJ0APVR3zEBVMZ8sBZgYBd/24b1gQ/VG9/RZS0Bd8vimjSYwMhGWAxU+DNNhAFfM8qNCFIIR/BgSaZfFdraRIqekh2LzVVnlWKca3S2FoYGrAsigZUFESNT/fX+fq/HRtpvprQA54z7H8ObbQBkutwkdjlHuZNjfCVC0x3qfHcAoattO7keAuAqs0aAppFYfqQ/kHppRvrRpcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Ju2fSRW1SBCGia72GzaiR3aeymKl1j5uwTJNPBbH+GU=; b=EQworsiUHxDFx4DneNdygHVKlJQdgzxprouk56j3Zr689d2c48+0lU3VPuK1Wsg1i8xG43Y4gsaVnVWO3BkNcPWEek+yme7eYsJCFNeqINSEO4n9UGEdrInCaG/MXk3tdAJ9eNAVQ10G9X3CisX6wGyc0HOzlKVP2s9wWFonCBXei3CEkNisSXs13cW8Nii6H58doY+w6/AZCWzdoz5I0RuqFgUIRKFV623+lXAr1DkZAf+XeWd5sXfk5vlHDluWkSTDFNk4UGk1+/m+/bFEtGaYT7L50OdF/7gurOch3IYrXSWmlFPzontzKzBtPrtR5R89qjWIOXp2Oep6rw0yEQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) by HE1PR04MB3290.eurprd04.prod.outlook.com (2603:10a6:7:20::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.21; Wed, 23 Feb 2022 06:50:23 +0000 Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::60de:f804:3830:f7c5]) by HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::60de:f804:3830:f7c5%4]) with mapi id 15.20.4951.019; Wed, 23 Feb 2022 06:50:23 +0000 From: Geliang Tang To: Stephen Hemminger , David Ahern CC: Geliang Tang , netdev@vger.kernel.org, mptcp@lists.linux.dev, Mat Martineau Subject: [PATCH iproute2-next v3 3/3] mptcp: add port support for setting flags Date: Wed, 23 Feb 2022 14:50:39 +0800 Message-ID: <18bb653925ebd903715096daa5e86a2e81c3dff3.1645598911.git.geliang.tang@suse.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-ClientProxiedBy: HK2PR0401CA0019.apcprd04.prod.outlook.com (2603:1096:202:2::29) To HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e1669484-e339-40ae-7804-08d9f698c3fb X-MS-TrafficTypeDiagnostic: HE1PR04MB3290:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tcYJspK39mWf+QhOjvhnr07hIDvi0LKWzcHbl6BR7yXm02twBEMavZLJhrk8wxKzvevPufbbCji49y4UefH+647a3kYUj46ymKF73wuzof8jqqIPhpWacySXoGdH2YAFgQ2SzXIeEOWjWR7hbNUOSMLy+gJG+T14lZBBQAnZdQatYZInu5gKyY8GyNXfiPzYKUs+ggKtp2zZOATShlBKz4XvcF+FMKBXAcTgOo+UXRFnu08aE0j9uaDBiHnQOlrU0N+FEg6OYXXtpXLNU5NgY0+y1EC4UYlUPmaoCv1sjUSigR/79fv0xqfpbxU2HDIfO7ymYddRs7+EbQ3EQj/e7ZVfynal/qlrB3PZQM3Ns9ZIhvV0n7JDqmTaK9m27rvaRD8/kIO7gsrhXIdRAILLyC9fOFiEc44Qrwb7wdw5Mk6aTqiNRzYGqCG2zil8ZjGikLgaO05tm1qLbdj3GylBDtMCnwncE+AwSHr3iCG+2NzYgD50XQvgymcpygWMvY4fULK7WbZOkbr0r4FlyiBP8EyMNIfZeddsw97rneWyokFAD57oIOTBFT3Mp18m+cxS93CC3Y1OjnKcSqTLo9WpftlpsExm+PS7WQiTNhNPPPbxn56j814XlJzAHYZ9ao84O2yfbuifXtcexL97sLQDPA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:HE1PR0402MB3497.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(8676002)(66556008)(44832011)(66476007)(66946007)(38100700002)(86362001)(4326008)(5660300002)(8936002)(2906002)(36756003)(6512007)(83380400001)(110136005)(186003)(26005)(2616005)(6486002)(508600001)(6506007)(54906003)(55236004)(6666004)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: efVwhImxXGIiUnCUBc+2sMnpalH+2On3p7lHrm9LbhavjviZ8VsIInTdj6XTjG4iG7Xomc3yAJoPnIZq+jjBcetkmsvKvSpzE6T0ftYgrOOd1pZcKn4GwAs9EbjIqknE+TeRpeJAZZJbj/2cLnZMA1WKBGxOlQgcTfZMbIT+ghONsTCXT3rwrvTdwFQwVG6uxfgH9P56/A1o85znsF4KK8pruNQETG6kElqiQcJ5dO8y40aAlcLlmMVHAHArAZZ0ObW/ikeVQqjB2nvEdXWAe+tx3IGLRp/74hBm55CuIIDI1Z6m7IbM5nkxAgiYpvcwZjsIfFZsU+Yom6ChcsO2WgatHO/ryuDDc/Ss/MStiBHS5H3iohShvAkT8+RsRYRSzb3dugZM3iTovBW15s569Fsrn/iTrwX41eDPkCJpnwphaBWjhJR122w0C0Xud+dlVcc/84r/EBLMsLyr/DdE6u9eWh39bSQDFxJZ41ST/i0przv0Ke3xjrOuvLtHuR0sFufrAUq693L2Ru1w0nMER+4KxOTGyPg4fkknhh+0QhrZJrqKJm1w+LOnVRl5LcgFFLHy778o1ClfwgNhKxcS/J34b2IgP3iAdR7/GCd+xJD1ZObHTHCqJ1YHeYXWx79aMZhUZQrAsPJD5bmjFdns+7wfCPQah2uaQpp3kXlx9JBVlYQiVHOgrGYVpwLEFOiiJNb6bHFZLsPonZRt0bDEfChHtY6Tb4mcCymP+TQZ9fkzqUIKIy9iVDiHtoRHfVoPTa/xvcUwtVIEClFmCs1F0DAsERq3DN2pzJHpO7wnX1U5CbAXLLWozsNIMTsUBnNG/MjJ7GxstP1faH1fiJHT03PF4C867xNd0sykl29lKEB5/ofR3dkTwyASGY7hiGL4IdwTkOYbHDLmy9vAUtq9gAIiufP+9PPcrl9S7OVTwO33X+4YSQHY81U5DZ/ptmCob/yXWeSKtDE23RRLrPVzhghnP6DaaSlL+S0sLDhCEJ6dwU/JRIWaTflVH/KUhONKfJhQJXes6xcMbQ1A2G8JPkUbjKSFLKke68lGavw+uxwgN+YILL/lap4H51lS+cPq3f2eqbeLDaHFqgmTaIpIX7z5fcZ8rq60ZqMiHDqm6Ny368C91nsGAlcHobOGykXTWNMnuAvDaMQNrfLyeOiktWCfZWlj/nmh3TMt0KgNP/ZHr85/Xb4og4e6oT2MuRms6L6fxtGpYIqBDYVyZuUohiKVGhSUY68/bZ00kFhTaa8NHWx/czUXRn/D8GcgrwYlq54SPbeLzC2owOLmp2EPoL9Lhpy+xIdlyS366XJAVYFBQ6k2KjLjE4nhyP7MCPWZbJa1cIKoPlt/2Nec8d9QB/LZ/W9ZSnOmgEcHieDhlMlM8mxwvYBwPjBZSGV/8Xd0G4SXNMGkkgWTVgRgjKoFU9xb2xGv4d21FbQ+YxOn3IVvir9cTbiwevtH1SHAQExrRiA5b3QWu1Fv1ZcRN/fmFoBB8kYBB5OCBem2l7PwQ/sl0UhrCElKl4KGUyX8Lryoj6YuTTFp/ZnYI0zGvN90L4i6oTWYa5j9BGBhbZMtC5iuVCBfabombInbLGOaSVTuTfYtL0XpvSI/VAHh/OtjBzECuCvIFiMj4ITh926rcSY= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: e1669484-e339-40ae-7804-08d9f698c3fb X-MS-Exchange-CrossTenant-AuthSource: HE1PR0402MB3497.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Feb 2022 06:50:23.3916 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Wm+6iIfxi/E7lfEQiSxfWNzBRyYC466rhOeF2v/LiLOipK7ejSR1v1Gd7h6mLySe7VmNPRizhJA6Qxon6eWx0A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR04MB3290 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: dsahern@gmail.com This patch updated the port keyword check for the setting flags, allow to use the port keyword with the non-signal flags. Don't allow to use the port keyword with the id number. With this patch, we can use setting flags in two forms, using the address and port number directly or the id number of the address: ip mptcp endpoint change id 1 fullmesh ip mptcp endpoint change 10.0.2.1 fullmesh ip mptcp endpoint change 10.0.2.1 port 10100 fullmesh Acked-by: Mat Martineau Signed-off-by: Geliang Tang --- ip/ipmptcp.c | 7 +++++-- man/man8/ip-mptcp.8 | 11 +++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/ip/ipmptcp.c b/ip/ipmptcp.c index c7b63761..0033f329 100644 --- a/ip/ipmptcp.c +++ b/ip/ipmptcp.c @@ -25,7 +25,7 @@ static void usage(void) "Usage: ip mptcp endpoint add ADDRESS [ dev NAME ] [ id ID ]\n" " [ port NR ] [ FLAG-LIST ]\n" " ip mptcp endpoint delete id ID [ ADDRESS ]\n" - " ip mptcp endpoint change id ID CHANGE-OPT\n" + " ip mptcp endpoint change [ id ID ] [ ADDRESS ] [ port NR ] CHANGE-OPT\n" " ip mptcp endpoint show [ id ID ]\n" " ip mptcp endpoint flush\n" " ip mptcp limits set [ subflows NR ] [ add_addr_accepted NR ]\n" @@ -175,9 +175,12 @@ static int mptcp_parse_opt(int argc, char **argv, struct nlmsghdr *n, int cmd) invarg("address is needed for deleting id 0 address\n", "ID"); } - if (port && !(flags & MPTCP_PM_ADDR_FLAG_SIGNAL)) + if (adding && port && !(flags & MPTCP_PM_ADDR_FLAG_SIGNAL)) invarg("flags must have signal when using port", "port"); + if (setting && id_set && port) + invarg("port can't be used with id", "port"); + attr_addr = addattr_nest(n, MPTCP_BUFLEN, MPTCP_PM_ATTR_ADDR | NLA_F_NESTED); if (id_set) diff --git a/man/man8/ip-mptcp.8 b/man/man8/ip-mptcp.8 index bddbff3c..72762f49 100644 --- a/man/man8/ip-mptcp.8 +++ b/man/man8/ip-mptcp.8 @@ -38,11 +38,14 @@ ip-mptcp \- MPTCP path manager configuration .RB "] " .ti -8 -.BR "ip mptcp endpoint change id " +.BR "ip mptcp endpoint change " +.RB "[ " id .I ID -.RB "[ " -.I CHANGE-OPT -.RB "] " +.RB "] [ " +.IR IFADDR +.RB "] [ " port +.IR PORT " ]" +.RB "CHANGE-OPT" .ti -8 .BR "ip mptcp endpoint show "