From patchwork Mon Aug 16 10:08:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antoine Tenart X-Patchwork-Id: 12438109 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 14AB1C4338F for ; Mon, 16 Aug 2021 10:08:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EDB6D61BA8 for ; Mon, 16 Aug 2021 10:08:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230306AbhHPKJD (ORCPT ); Mon, 16 Aug 2021 06:09:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:40698 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229726AbhHPKJC (ORCPT ); Mon, 16 Aug 2021 06:09:02 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9C91D61B2E; Mon, 16 Aug 2021 10:08:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1629108511; bh=ixj7Ews16X7qrEZhfOBYKxfWDow/6fUwCfpnAvB/nnU=; h=From:To:Cc:Subject:Date:From; b=OeKnwps7f4egPVZkL2Ekyw42qJhwgK9kXkihlPxy69hpsTA03tL/9AuhQUuS8yiS5 o0ofgwaPIm7hZVFrUEr9TzGir8QlmnxxQ0u/ut1m0H6h/3d4sMgmJPfSev+RZtX/8B lQm5UVAFGMqIrVsiJD+XYSCsivj37SFhGjfr5JZ0Q60Ifeal0ILk/wgaT9rA6VdoAL 2MoW9wYg8va0Q5ZTmBGYok0YfjJdIpIZhOVj1U7BFwn3SCucnmHVlyqO+Ji4CahaV6 E2GFzFO8+0MiCopU5CvvWbfBunKtegN7OinmLzDla9EdSmIXzvOUnCowP9IrGlx/w5 x7ful7sM3bb6Q== From: Antoine Tenart To: davem@davemloft.net, kuba@kernel.org Cc: Antoine Tenart , j.vosburgh@gmail.com, vfalico@gmail.com, andy@greyhouse.net, netdev@vger.kernel.org Subject: [PATCH net-next] bonding: improve nl error msg when device can't be enslaved because of IFF_MASTER Date: Mon, 16 Aug 2021 12:08:28 +0200 Message-Id: <20210816100828.29252-1-atenart@kernel.org> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Use a more user friendly netlink error message when a device can't be enslaved because it has IFF_MASTER, by not referring directly to a kernel internal flag. Signed-off-by: Antoine Tenart --- drivers/net/bonding/bond_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 04158a8368e4..b0966e733926 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -1759,7 +1759,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev, if (slave_dev->flags & IFF_MASTER && !netif_is_bond_master(slave_dev)) { BOND_NL_ERR(bond_dev, extack, - "Device with IFF_MASTER cannot be enslaved"); + "Device type (master device) cannot be enslaved"); return -EPERM; }