From patchwork Wed Feb 23 02:59:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 12756185 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 012BDC433F5 for ; Wed, 23 Feb 2022 02:59:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233316AbiBWDAF (ORCPT ); Tue, 22 Feb 2022 22:00:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237629AbiBWDAC (ORCPT ); Tue, 22 Feb 2022 22:00:02 -0500 Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [194.104.109.102]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B03B53E29 for ; Tue, 22 Feb 2022 18:59:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1645585173; 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=PkeatfizrXQIJ99/tdPYpVW3OtCAmWZ3EhQ+jqvxDUM=; b=KQFGbucKLFSheGXOu8H1TydoOpSn6cDGgJvaMxqJOpvGpOCXtcd36ieeDqOfYlIh36fRNj Jzj4T47d2xQsnE2VOIiKNIWYKvWOmuEhr5tQUs/qf+jVH3gBhM2/bHsKhn4V1bg47ntGNn KO8Wxy1tQOjNMHcZZQrNBYlwJP4ffXc= Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04lp2050.outbound.protection.outlook.com [104.47.14.50]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id de-mta-7-CtdbpbtAOk2iPBXiD_dBgw-1; Wed, 23 Feb 2022 03:59:32 +0100 X-MC-Unique: CtdbpbtAOk2iPBXiD_dBgw-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ndf2iJwmADvpSHKOca6KSWw9IkQH5id9ZuGiVWyAYqwoMAEv1V7oKLTZPtKrAxgbb42l0mWtwWoB65ubsicOchahrCVUdgNvRbOjxL06o+bM2oqajo52/aM5PgiJPJOFSQVuzgrpwDyssQMagrMd3BDEHHagjjqpC0V8/1f0087C8yKSC5+sLjJugPHowXSMiRrMHEg6frCLjVLZHwWuPjAXLIAwuW8tBywYZ1HVohyE2WMU0pgfcy2GGLes20M5svLFL7isxF+7g+QAz+vFCyu0ojm8gjNj8M6fAnDJ6kMrNFeaiq1vbr7PspDnXc4I9Ea2mgjjGLxnSObJgsPkiA== 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=V08zv6rkhHHKj34mR7Ygn/4fZ3xuwHPdv/RprAC6dWw=; b=I/dfgxmplyRw6XXtGC2DLtdbD6ZAHy79xVd5GpzOuKz+R0avrsLCZH4quQ8uLssQp1HirTjjVn+W91gVW5JE4ncMAezqp+67xfvXZuRn6PrL2CwmUYDKEGlU4hYI6EM7plHGn08tByclgNffhPs2ZkYygAjYxF9DHPbn2c81JvnH7XFMJpCTJO05tq/MsHjSvxOqkeJ26x/MHsVmOP8toA9aymT9U/YVFXlxvySvKX/6q72NtlbOW4cnXOylvQT03Ts072E+qybSROFztS0E2bPXeovF+1wLuPbryVKdte8IwSKLLsDinS6uFXz7nE3FMX3xUfyZtffroOyWHc8DsQ== 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 DB8PR04MB6362.eurprd04.prod.outlook.com (2603:10a6:10:106::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.22; Wed, 23 Feb 2022 02:59:31 +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 02:59:31 +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 v2 1/3] mptcp: add fullmesh check for adding address Date: Wed, 23 Feb 2022 10:59:47 +0800 Message-ID: <295a693ecc4ec1c3c241db0999d97d8718b7d992.1645584573.git.geliang.tang@suse.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-ClientProxiedBy: SG2P153CA0011.APCP153.PROD.OUTLOOK.COM (2603:1096::21) 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: eace7072-53ca-4842-b375-08d9f678836f X-MS-TrafficTypeDiagnostic: DB8PR04MB6362: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: twX50DNqW/5vrkSwPrG702QZPMkA2SDPGpIsMxV/v4UBTrVePd1Fzw4SuJKsv2EH13WUsatGIp8FxabegUEq8kSvC1LbCMFGVc3g9o8cen1518OqOYkrLaCNYOrSxKRtA7XmYuOqEzKwBerH4Bt9RMSlNJLIsobNZ5RdF02x0R+940l3iXpoA8W5RN6wD8QfAgXrWMf1lvIJtR3g+Gnt9YsvtnCw9pi/VlLFvn009SasHQMInAup4nbi3camTRG0LUolZzUJ+mWN1KSkzEpbvP2WCI6vBblEd5U+5whc1lMssY7D5oyvAdapRxxy0mRBKrW0o85OfeOgS7G/wp3m3hpoBTKnO5N6gh69z5qQQXzlVZxsN+nwR0ORuiV/REyumeqVJCR8zVYBblscPHmq0RzJ3wBgzuXpSTC3fklA5YF0bBen6FxtHxCR1ZmNxOMDbuMIFCT8gd4pgZ0OEhpC9yQkDe01WaUemgPFFeWIqimc2Y0MKRZ96fQfZbGfdIgNQ6GgDJnlPYYc1AFjlmT/OL71JrhMvjpdVPER0UG9OeqAy3BEcKRI3P+l4vKvQZCvfPvQZPH/HZwSRIeZvYXcIbLvNB0bHOpmfmj1MfPCYZV8E5yiiHr4H+4OTzL8bTqXy/7Bex4MKVbZmToT23aEpg== 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)(2906002)(186003)(26005)(2616005)(36756003)(44832011)(4744005)(6512007)(6506007)(55236004)(110136005)(86362001)(8676002)(54906003)(4326008)(38100700002)(316002)(5660300002)(6666004)(66946007)(6486002)(66476007)(66556008)(8936002)(508600001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: LJGr24j3Zy0z5paP68z3/3MnPklLU2PxTPjywA5zeqQuvL0wj4ATzyrtgHD16XKAtPBpEN1IMpgBUoL54cDXR7ysgYjwm3ZapgkAFy8B6nRNAYotXz2ya48p5TrVvjqDBL45R4jZfius6eTt3Vl8V+MTC0DG80jqxXNZxHAxxAY2Fo1mFdc9pdFuRitQ2Q1QQ9IEscUiQNBzhU7CAzcv71E9Q1RGeo3jWonCfq4Irxf/tAiGv9lDHuRHLCUiVyef6VAjXyJgBSVP1mADXrMXtlqty2AuEantaKeBjlyn2LrLnHEroMxhJ1osTDbfFFgSCujTkkwTd0icy8gMWzROz+hl4QAtETohMleSUjtBXisQ7DNmGG8HkKRlzgvPv/g/fqc05NWb7Z5pBsHE/xBS/8IcT+QwLi7eWjm8oneLc345u98rBbp6LeQQOA6MQv8w8YWLbDlfSoGudQLVU+lelJM1pG+Nvo8eBMyYA0rz3NPumKVAH9ZEys/p7M8czqf8Gnec0jTFXG3vvCNf95g4/xTdQlW1jCGiAglKuL8RCZ6XyWDG4p3dk583T6+mfoaTAbtrjULnFm4Auia5WPxCG70qv90mX0DVBsw3pfGomU6DbdJx/HhFHwYFviXM6m8UOJYpLAgXb3m79Ferb5A7F7zgfmyb98ghg7bLWvp7AtoHSO/NoWVq/V2D02R95YePoJYgwkm6328gr+0BYgL885Fiydr4nuSlOP8zs/QNyeVS2ZJHAkIN9tI3tncPo/dYZC0tmptH9rLOJTUyKBn5ROUyiNA2/5liBRSWO8wuH/AMz5ArnNuppNByO2Tme5uGU+ZHvPSXaYJKZ6uOCIu6imR1dF6koEsaZ1DXdAHb1lIiJPnDGYC2MNrrUlyoz6a+IYKYd/9rLUXNZRiRAfWVfyxzPZLdNJcpCwVWC70tVuNHDK01o3dmPQGQ9irZdD1nNYiGHXD2Dy9e1gzYooyvg1dw1yqEh/NI3seg1saz06NTm9KpTJ044pOI5KeDG8aS6dvrz+LSZ30byfDBzv8y3ZP1UMAozHks0nzXkI3XOopTf6tweyeA/1eIDIRDpkgRnEOFGs5cpKoyoRUGiok1dU0hyclIT5Jep6+o2pUN6vdbOIv4cS+2dsTugsCrdpZ2HG/iVocwu4lLyTxBTpU4Yl/2Gt9TdhUfbCjXPRWvzU3gVdkM12XpBJUYn/Gys23MoXX+0b3Y9r/WlfVv3q4x8VvBvs9joIQMdcgB/tqakBaWjWTuMAj2FhQSZxCv1V+t2x8dIGLiJPbC5Zm0v/z6t2bblHiv4XaxK4mO3bKNHMkGo/t39AIzG6SoS6RJnUJ13qzl8Em1v10ON752h2WcMsqnaZXEFk67ZT4WChXg28hOtROPARFYKqtszh9AOtjdqLMOiMg5s0QXgnbIUuw5AhNSDxzu261yaLyLiGLJixuNENKaW1OdwlAtRhMY5Ack3B0ZfBM0BBlBxDrGu0izi8+pMN/w6QBGiHfDAaCi/D3fmylq5BB4kagu+3vDlILzsmfav8DLFzUmVAtLfziydYM7iPgaRrDTpD1U2POPPWotCpffzPeoQhNG05zdQ3nGjYj9iEQ9yeXMoLO3wPnEtyZfxLKvJiqT+WMaa9y9oSU= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: eace7072-53ca-4842-b375-08d9f678836f X-MS-Exchange-CrossTenant-AuthSource: HE1PR0402MB3497.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Feb 2022 02:59:31.2373 (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: jJoQJ4dGtGored/ogDSNan9ePI35SoVasw5Gn0HevNQEyMPs7uTNmzv7hcVpPk8269TICAKbqMeWi2m2SFWkyw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB6362 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..0b744720 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("invalid flags\n", *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 02:59:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 12756186 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 0DA56C433F5 for ; Wed, 23 Feb 2022 02:59:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235384AbiBWDAM (ORCPT ); Tue, 22 Feb 2022 22:00:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237624AbiBWDAL (ORCPT ); Tue, 22 Feb 2022 22:00:11 -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 EC86D53E21 for ; Tue, 22 Feb 2022 18:59:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1645585182; 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=h74JOeVSl8oOoWOAMazqdffP0RbIFhqoE9rf4wX3IPA=; b=M45w2hNwzDYEKttaLC9I8VZfEpP5W2eBsQQ2rdVOIYJAOcagoFuQjAkYGUUpdVqF9n/OgK E6k69Nv30OlRzn5clgzMMFPYFfs2EkMAu1rFRPoRWeCis2nyR1BLPnTxFmJWk5UCYUATP/ xrX76+AKcmLkhTGAEv6N0fp441Vg/+4= Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04lp2055.outbound.protection.outlook.com [104.47.14.55]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id de-mta-14-GoJZbsfVOqSl4U8v0Y_Q9g-1; Wed, 23 Feb 2022 03:59:41 +0100 X-MC-Unique: GoJZbsfVOqSl4U8v0Y_Q9g-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F6HqKd2Aq/zgVpUrFTE0Kf3F9MYlH1FN+jhYn9lgT1Jd9toZAhF/5bDBOBeRorhZgA0zgKCyI0LK1lI7M5Hmk9zdamKpNDR9tnP3RfmVo5ZO1B90EDhNy5CV2SBwarTPrDqxoTozXO1pOD85VIh5vgPgd4jPcWJQmOM+1h8ibnpb9/iu8u2Dtku60YslR35nXRElWWyi7VAIR0sLn9P33tHTRZgxOhcwVvLZFTfr1Q0iJv7RMEb7RMCdFT41SdtTXeq9GS2V+mX/auideOUzsB0bEsh0avlNhpPWKpEUzXlxZlo8BlvizymE+t57fo4q2WYt+A4nmipWEedWChQ7eg== 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=uzzGQzCnq3kLAYLSS7hRNekC+wNsuFLK9JcO7Fz+M9c=; b=gmZoKFiZ1fnixo1mJG2biTYpKS1bRytFNfl0G6KOSDtpUu8m7nVXSuDSPDGHKzsS6hvi2XpjZMnXYEJYQpfmtjUofFWwefrBRn8iswVfHG0HUEEtrzgmELBHDcrvVEMpzo3BToPkZcAaPfqbNkubPspNi5pHmp+flLpY2FuuEsB7OL7y7Hbp8hQdezk4Dhc8X0okb2HwpotBcuQ+qpYV1aUZgi2bM+xegBSM6itqnRJ0R4Cf7JpI4reUlY5BgwfcnJ2tC1C4geheAfW/ZzhCrJC5HOnMK5VLtSV6NS4a8r54GF/OfijJVLU2NDgYSoThGM8zyEw18rapd3HyU22Log== 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 DB8PR04MB6362.eurprd04.prod.outlook.com (2603:10a6:10:106::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.22; Wed, 23 Feb 2022 02:59:39 +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 02:59:39 +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 v2 2/3] mptcp: add fullmesh support for setting flags Date: Wed, 23 Feb 2022 10:59:48 +0800 Message-ID: <66b764a16aff656947eafac2fd37b55a549a5afc.1645584573.git.geliang.tang@suse.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-ClientProxiedBy: SG2PR04CA0186.apcprd04.prod.outlook.com (2603:1096:4:14::24) 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: 1e475dea-0201-4e6f-fe85-08d9f6788844 X-MS-TrafficTypeDiagnostic: DB8PR04MB6362: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: pyGX7kA+9zPZOLsvOptYtegZBzP1Bqv9qaWz/qaAIVSli/4ii6lcWfqnCtYwUC69S6/1nKv60af+utOWcAom/QgmFX/85y7j+VjuRx+ugHb37V59Z8Fh8LDa31hHomfd4ztN2p3TgI5o4NzIt9Sc29Y0vdsjEpCTa3m7LYeHQx/mhzoDBxBv+aMSIX8XR67yvx4lE0BNXJ9vYGnc3xcY4V0b5TPlsX4itvA+j+UP/1wA4WLvj5bHIJBIODOyodzNODa/fyGMGdeMsa+TYc77+Ieaf+UFftWlZltBDHkyTHMNr91Fxlzp/cxhxh1SrFR89NDRohi7j00oe6bFamO6xPGkUxPX5waU7Tnbd7HSffQwpXaaQKPWquBYUx/lfUGQ50hq+xNmxPAQXn0SCZiextuLN+lNreZ3ySOxjNb7MdQ36ULCxooZHqh2htrt/Yvv1kes1QZJRw+hut3AxvZyGCMarlku0OGV3bcBkqOg07uuA5t8u9PbgTiDXPxxbW++ZAjLuMb3KQWMfsTg5tqg1xw6sJCaV/aLglHseNlKlqagVieqgsYUOIoJsg6680Hpqnhw4EetlOOqK1blTwfZR4AJ+1Q1wFyD5R7kMuOIvnFMNpM877ncok9U6l6vZMjI6b9odgBPVgrsE6KvMGeUaA== 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)(38100700002)(316002)(5660300002)(6666004)(110136005)(86362001)(54906003)(4326008)(8676002)(66476007)(66556008)(6486002)(8936002)(508600001)(66946007)(186003)(26005)(83380400001)(2906002)(44832011)(55236004)(6512007)(6506007)(36756003)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: U1DGbwlWTlxOifr9G3l1BSxsCfB0ocD+8QfE2EtUBqjOcLUoLBuXWze/zzP9vKwYoIS8aahPyXB3TH+9KbhlF4kEtu38VtcXDuKqIVaoD/LtAHWofN1wbGZdF7PRDauffSJOqQ7r/FAkXrEQEAAjRKR3namHwuqrCF4l7eF1G52Tl2jBuclJWtMnOxmhcv9a2OXpnmfHHSMKqkfUyLH9EwTxrlfj3n8BmULVPL59RffKSenRedwrRVd8JHwZ6lVWd7q1GBlxChZdW6Gk5kdta2bs3Rzi1WGtwrnfQfHnbBxCgKkkuIMmFQBPALDWYL1Kjql82CEoQtZw24GEzPpWgmYB2MMg1rijQy0r6LRbqnElqURRPrafdK3CDholcxxB3WIDenwBaBNUCOGHmLBRq78AI6kXLn11y29hqS0/0J6htSko8FUie82OqJC4cjL5G2JHu0i4dsJHtcYPyw5HH439ifRsK5CyEPYpRaG6+dQYtC2KVbmBgdFt7w1khzp29G8BTGV8hgbdmTxh1znb8a0ebf1OUh9wDITs26xKm9SYqBEPjOFfvSxxGcpHB3xsJWvg57Asmtk3LDKiElJiE9NHDXVhWQNGn8GAbWXK73yrBM36z+rOJn74s/2S2FjalsLubmqySfLXW+XRkJDKaYDEJD8FgjqRZ07wDGjlPwxm4At9jvKJIA1+U/mCgseiThyf06vsEgy05xN54qRR6kOpRrYEfHi2BS09/YZ9iaYY2xQh5eVsc6KL8/PQBgJ5+AU2BgNd9QfBYWOG6b/oZY4tUze4hFxK500bXX23CUM3UssBYXcjp/ufUzwKKLZaukb+KDfIak8VEH9LDyMrhViR41J6NXWC488iOffTwzJ9wqy1hDN2VGln/jUgPSyavHdwi+8Ps5EBmwDeMp1SArEFQxoSRxxWO7CptN6QL+GsmYz9jYZMk4EA9o9sd3dJqVzgl4N5YwJCdqFierBx0ME8PiHxZ7FlheJRPkJKZnMeSBEG6puze9hLARJxuIkrKpVLqp0W0JCDY0BGdeM96Ih7Lx19Pskrnur3GjdylRzMBDr6EwqVtE39hRY9Eylz5CGvLNh9S5LzVBS8KPLJXZX/855p3TsSHTsFUKqVocacGXjTJsXF8ZWiskLW96I0zdjQZDxZ2zRLLVZOz9a+mZflSq5X8qm+m81MVVDCnz7VK8W7o7Uk7M4697KNNhMLQRFMWXKwlL3mlv7CYwMbBzhpWny2ilyXhqsYBeSAprL4IpShB91kPPywB0e94VQAfgQnmo29KSzem45xVUPH7b1+O5xAH8WaPIDQClm5sWtl2xw43WV6DNV19EUPk9I8Eiolewfe4HbL5xK/pn/edB1EZJdcIQbEuZ8pXmC6FFUtBDnTvhJHMF+N304v0YeIOaL1JBFi6ReqjYvKq1D+OJRqsu/9UZikGwSYfFSfsxvR3KmeBybNq/+7eVb1d7aDdB7Wth7q+tQaGip0/riZNuJzkU+fL9bBsebVcOM+01vZchV+ywIoLBJ+VJ3KyuPRxhnDlwRcbN0ThDuL0fPKiA84Klyr9+bCY/IOxVPUf639Gz5TTgxQBjagppLIKUS8ablUrLBPHuQez5tUjCxlUeUWHA5/CBet4asr/HhnKis= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1e475dea-0201-4e6f-fe85-08d9f6788844 X-MS-Exchange-CrossTenant-AuthSource: HE1PR0402MB3497.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Feb 2022 02:59:39.4554 (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: kAI7q63nEf9eurroItPDjSQ/s+I2WF9WILzg1lvrfRc5mm0ph0iBwS8upo+9O+oq/nVx+kd/E1Z8MYS/hC9pVQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB6362 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 | 18 +++++++++++------- man/man8/ip-mptcp.8 | 8 ++++++-- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/ip/ipmptcp.c b/ip/ipmptcp.c index 0b744720..247d1caf 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,9 +124,10 @@ static int mptcp_parse_opt(int argc, char **argv, struct nlmsghdr *n, int cmd) (flags & MPTCP_PM_ADDR_FLAG_FULLMESH)) invarg("invalid flags\n", *argv); - /* allow changing the 'backup' flag only */ - if (cmd == MPTCP_PM_CMD_SET_FLAGS && - (flags & ~MPTCP_PM_ADDR_FLAG_BACKUP)) + /* allow changing the 'backup' and 'fullmesh' flags only */ + if (setting && + (flags & ~(MPTCP_PM_ADDR_FLAG_BACKUP | + MPTCP_PM_ADDR_FLAG_FULLMESH))) invarg("invalid flags\n", *argv); } else if (matches(*argv, "id") == 0) { 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 02:59:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 12756187 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 24853C433F5 for ; Wed, 23 Feb 2022 02:59:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237656AbiBWDAV (ORCPT ); Tue, 22 Feb 2022 22:00:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237722AbiBWDAT (ORCPT ); Tue, 22 Feb 2022 22:00:19 -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 44AD056C33 for ; Tue, 22 Feb 2022 18:59:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1645585189; 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=J/WWkrKIdxBqKtuQ+M1jfSmc5WJGxQXYBhGNno54OjM=; b=dNeXErkbRrOzpSbJ2nvhNmjNXZcmWAlr2Sd7aKv7LylwrkLGrKzs3dObqZnYDkJadWWJzB lJFw9EtrC0HvYFaES68mDUP2oA/yVDSoLkvo2crLs2iGCx5PkrHzOgwbP8bTvYIFePiyb/ MN+bMhfquJ5LblkwUlznRWXGsj8DH1s= Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04lp2053.outbound.protection.outlook.com [104.47.14.53]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id de-mta-20-EHDbEqSGMXyG1g0wPzjV-w-1; Wed, 23 Feb 2022 03:59:48 +0100 X-MC-Unique: EHDbEqSGMXyG1g0wPzjV-w-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WmppBIkfb/B9o2fVYTcaWAEM2lfIe6fTABiyDhf8qZ1jWBTT59cQnS5zsgbMVvKmXTA/DEL403MGifC5A7PEB8DoYPyG0UB7dpWPz9EWn44i0p98+EWNG66u1nvFitRIC9jFOaVZbLyTb0XxeFUzhH9Fz0bRlvjO4+9PiNkhZ4ltmtZBWiFZuqwW6Jx6wro7s9livY9lcTjvclzV/RxfURicWvkC8oBr5nLvh77VT0A5/w3zfHAwcI9SMa3FRwd9XqQecC1hYSzJMe1eL7VvE3PSIjmbudzKYixODA46U6t8rWh88SShhQm4+3JkZbbMQtiHfXh5p56L7dJvh1l5hw== 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=7TNmfSsTYeiwxbo4rbwO298n2C1IdCvhgweo4Avhpvg=; b=E735mT4/OVALVb63zHxTkLQmRtefsulDzDs6t2CzwEML6Bw1cCwPeWwrokRuAFIC6HxOtD9z0bbGaoItvJqttKdKr/op7kflSq6JuM0/bprKLbwt9FRYQSuheusOSdhn2gULok2YOwJBFQfGl+pue2lF74ZpgOosKH5JwOuJgMf+0bhTJEohQVXS2JFXNVBLLU96aW3q7g5BVAq1O0lP0DI8tu5xoz0JYySBlI7mUOcU9FHYSErvqV7iVGK4qnTQ2ogpeiHOiTz9yoJ3xMlNCOi1JzXRkzwdNYTU6U39dOAol4aMHRdG+nKI2m9KmBK4dQeq5ch+/MquxPCN5C5GAw== 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 DB8PR04MB6362.eurprd04.prod.outlook.com (2603:10a6:10:106::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.22; Wed, 23 Feb 2022 02:59:47 +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 02:59:46 +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 v2 3/3] mptcp: add port support for setting flags Date: Wed, 23 Feb 2022 10:59:49 +0800 Message-ID: <387a16252f20df06f0926d5e8ca328ce288b864f.1645584573.git.geliang.tang@suse.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-ClientProxiedBy: SG2PR06CA0155.apcprd06.prod.outlook.com (2603:1096:1:1f::33) 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: aaebefd9-94d7-4371-1676-08d9f6788ca3 X-MS-TrafficTypeDiagnostic: DB8PR04MB6362: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: l3fvSozGVYLHCmDHvZfjNaA1NqiFx6Y0OdEULW33nCFulB8B3PtA3d/XZLw7P/nn5mhXiEvROoW3vZlaZu82kFFv3wcii9UY/UPtWtxL/pEO9uQJ2yfJMCQUQjxm9vKzCIm6q8iII9wsXnZA+qSJwv7P5M43sn8kDy5qwoPw6LW2xUbhcWs5t2xuOCR36uXz7ePMUyc91YrOoOe296Cfui9gSK8ZEaKRC06aZUkRs61H96LUyJkfNu4IUDqmqmEPZ9HioeY6oNGncCrDDu3zYaXeSWNOH1sd+bohxAtwGvXjF5oxcAV449iZgMMz87zyaGnKVFmmmzp48ujMMflKZcRiemdP8wlkSp2SDS9qXXMERhLOSrtVXKj3atDgCZEWMixM9vdKQi9G9VkW6pzPI6TUzFAQ7hi2RbQ8ZmNGW0G6d9cvPtyaa5w0vReXfWsyKgYY6kjoNK3RJ8HVkK3pXKbzhuzLAjOK7CC30UxZgwpvAqvqNIqCkb4P+69lQHWBMbyTBkN2XM8qyN0Wums4J8CXfPb+Filu/OkoamsjAz8IWahtOWzYD2kZJmp38mD2zW1Eb5pzPbmOTrSnYNf5bjbFEs1qj+ecPwYzy5aIg1W3LBog/iwza96vPekxrg7WE2oKW+DCjvm0NgfwZHy6rg== 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)(38100700002)(316002)(5660300002)(110136005)(86362001)(54906003)(4326008)(8676002)(66476007)(66556008)(6486002)(8936002)(508600001)(66946007)(186003)(26005)(83380400001)(2906002)(44832011)(55236004)(6512007)(6506007)(36756003)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: h5mXyk+cieBYKZ2FrIKhsaGl7lcEzNS/I/rloe0Vc3PeMV19KWoF7ptpXMcXQnn39KSvOVAt/LEbFjoGOoaITSjS+JbfluCpXKKECyxVkh+xc6CKa9XA3gPAb+gQ2d9gflm65ASDk/GFfeXUfTRLcCx6PHwzyUjXpWygvyXLtLbQZU+wnWJOBPXXLBDVXQTuIecUkELnxuCa4zNEz9XtSDrCWSnQm2+EEB0eBK3p7hgruHRAD397yXQw4Cfo/mrmnW19o9gxzYo30ylVrFNXMUV9ybUzOi4pTIEApi2arzChYAmg1pmeBfiopfwm2ogwUFf4KE/0hMLOW0BNv+/DQ1XdyM0anu/kxLpqeO4pmoT+1JpaN3tzPz3XmYVnwcdounZZjhWDY9TUV/ihbJTec0TaEBmbWhorh5aIPu51RcS7mXG09IUmJvrSyG8ecaZHXBE1UuaHdzeyTpDfLg4toAS2LZGfcgc7oPz0RiISnUbmt8xTnui5B3hY23TXIj986j/pBYMkKODJxWKxd83NqnTEMZ0AASxClS4Se3fN+CumfgpXTeefy+H2yfF7V6H9g8KphYl3gUh6yTMgfa7mwqCWD+HZvs/LCXhW4mLvZBYtc4vXifcWlC1L/5jrwChY5462BXmf9kKyS20Z/jjX1m3jNO/jgU+F+sYgv1ajyJQ0z3u7BkeanH3wxaiHsaJ4iOtKsLj2HfT+E4cA3MUnM3ExDCBY5VrG3dSISN1ivrA4zhgiHeQ9kXMccrOVj+3KN/WCzbVBzLNVNmaL/qvR67bAyUO2uE7qxzG8T+X4f2tfECjkGx33eS8HgkxImprM7JCEy1ZdXCbvThEc1BMpPV9S1CYG16pG0IO86CpaO0kjH9JKqupWuk9QtUtt8ebyIO6VRt+SXeNxiA/725D5DuojSMnONljzKSNJqvKCKb16zzSgyV3Sv/DWvi/cPBBuaadKIFFtD29pe6mr5xB9s4kV/3oH+/PQdI1/fpCZMPYlmpXpwfmDL9MUvZLhVEazq/B0tma+I4WWihMSemqMDQANrfayzHZoNTlkwccbD1WUAXCK78Rbo+SWpLrDZV+C6lkugzMe02J46hecfDF+btyjVt+yALEzhGr4znygabuCVQ77VwS06jlc+9Lyqyy1UsPbVDS3epA3zvHqLOiOXeF/0xy433v+Byo2PbcoSbbYt4YYb+7DLmU3KUMFAblf+qvh0Ih3t9asbpAeHviHRhR6Yzr1uJCk0uwhKXQAnGdMbFuJVNfRGirKL7SHSQ/zlPibPdT49DUWh70zItbtr4LC6oK8mX08DYUrzeCLPVIqhHJJhpzf7yeR5kEjXiRUmRZ5i/FNUKB07y7sjuvIslO170k87bOpqYx6oYMlAZAUBx2o88OoHwPjpMfsZD8gJztrIsjK1MD9AN1kYPn65pcAzN08TGDCgyi94C7ESwLKGlIs0K3QYOpCyxACPfCd9ddIer+tlqrkRn0XhsXFWj1O/36wQmJTZE3AZKJtGTOqt78r/lo4SsUJFOF+zXVIsBFH5cn0of6Ycl60wUqx8O++eKRQN7yU4iEslToa8ZLZeuYZ4qQpw4zQ+M4V6j/WIGXnbbw0jorfmQ74zJDsUCNnoM7BBA3uAzl7F8G2NR0= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: aaebefd9-94d7-4371-1676-08d9f6788ca3 X-MS-Exchange-CrossTenant-AuthSource: HE1PR0402MB3497.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Feb 2022 02:59:46.8454 (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: DtoluO6dHhkOPQ3rmiSGa6wpXp7acQ5Butk0iI77Scp3YpMlbEQEfPPdiCfGsxsv22CcCgLp4ZfWh/0NfIaoHA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB6362 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 247d1caf..b06afcf7 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 "