Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp2621287rda; Wed, 25 Oct 2023 07:56:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFL9ORlWDt+gdCKg0f8DVMy/v6Zb2kJ7WnVigvdZVZbwAjgJKEIHkf7BryCQExE/nW92S6o X-Received: by 2002:a81:4ac2:0:b0:59b:e449:2d51 with SMTP id x185-20020a814ac2000000b0059be4492d51mr16761006ywa.49.1698245765959; Wed, 25 Oct 2023 07:56:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1698245765; cv=pass; d=google.com; s=arc-20160816; b=smVcGECA3zYvNqdKN8HRls6QrZyk2DitgInf5UrZ2rVvd19dQ0cjbgdzER3/UVIQMy ploB4jsJ1mn2eZNfIQkPhj0VaTAPLtZJJku8iam+3Ljqj50PHfLd0ew5gtfIlmHDdrLK OKN57h80yGni+l93g/2hPvJ/ylsC/C02r9UDz4fyKozZe4pg7n2IEF+JayFrnCrggNqy WVizYH4Q9mRO8XlLqkdxPKIacCp3gqdW1yqDuJm3Y8k2eU+mxjeTwMn2NVsCTA4b5jKy eptim2ad+dQedA6szSRLJglkx8XG1wYz4hYOGW4zU0u2nXbBTHuUM2H4aHLTI1h6ziQT ngaA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=uDtjhWUNPIEbgo3w+H2lsIQojUT4glWYx5p2pTDzNXo=; fh=z9iGP4l7xSTEJRW5hsadvPrAVCwRvhfdVJbZYHezquc=; b=oidV1ctXjGygJmkB2Q6dvhmjPkrpIs+wakSM4kJI72Zxo8BIhK9YicVRqv7T4KULO+ 64KgksjEs+9zcfZA3FARosmavGqoLaaZLiN7kywD9oXEvDWeiMFeUko1JpR0260z8DE7 vEmpr2WT+SEUB1EDCMMrol3Pqmy8VFV3y8Zp8JDIJ13E5RIoKT5eOfyZ8yZaNPpTuQLY XvFp7hB7mtMd5LQxWPmYax1WRrIeAxJUu+ztIaPKAM3J+tapgjtFYD0MfKUKTV65k1Er +ywtdLHliONBkp+re0VWF0JI52WApXkKmYGrrV8nc4KwcHvdV13qoCzblB/o9qL/mte5 /40g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=FxnnNpvr; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id v4-20020a818504000000b005a82a298f71si10968506ywf.564.2023.10.25.07.56.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 07:56:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=FxnnNpvr; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 493D9803D02D; Wed, 25 Oct 2023 07:55:35 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234762AbjJYOze (ORCPT + 99 others); Wed, 25 Oct 2023 10:55:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234446AbjJYOze (ORCPT ); Wed, 25 Oct 2023 10:55:34 -0400 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2080.outbound.protection.outlook.com [40.107.6.80]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65CDFB0 for ; Wed, 25 Oct 2023 07:55:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q8V+NAGEpvrHa5Qrs//nbyAi+WqLRRdp3MwFxq3dpbiFrthSGkgkQ8zOlvoSW9v8tXaGJovLVlvhEU9WfMeKTB3lkqVteEZzPdVFb/lq05WHH7GSykkwzAa2lLDNXQ8LS5c3hxUyR7/9JxeLG7MSWtwcniJ3veLyU4d9y7p9354/Ze/w5V/z835qJhDyByTFnIpgUCxFU+4uK8O4lBiEdhIZKK1rM/5zOjmzK/zSEK1XhXAUHZf+3IhpmapGe5fl1i+BNZD8AtyqdlxQbzPeI3w8ZjDUr8OV+Z1jZWOz/yAYu1PyzMY5xcV9OAUrTTaPc5rvmTnSjYDvO9/MASMzPg== 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=uDtjhWUNPIEbgo3w+H2lsIQojUT4glWYx5p2pTDzNXo=; b=aqhetn+A3I5rX6MbyoG7hIG/ckERxagg+1Dyqhiv+tAyuBiWg91oj6gIJrKTCi7lqLfbqdCzPuSUxOJ0s/J+oojvc27galls3KeVvBWi4vMmMLj31p64St6YQbys+EMdnYDZ1nRG+frcs/SJ1xiCzsmEGGUl+dZN63Qz7nvoCH4RxUaEfAg2reXvBeJ8FBmMosL5qKJmoRrhno0XxzFCisflhzX3GezMepbo0ASybzuUN/FFsdWx4NZaNRotRxC2MM9NpyTAdgLr2C7Hs/7EAqn20yScUZ/nwnpplT9fAoBQbLVJPHSi5Y6etj1tb6IAzcJugiIlnGUoc8vrL7Yr8g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uDtjhWUNPIEbgo3w+H2lsIQojUT4glWYx5p2pTDzNXo=; b=FxnnNpvrII6qjBh1sBnoYmuiuTGUG3dHsgNRHjWZvMGKmNrbqUyR6K4QmQ7eaPY7HU9+1OgZNcIwY3B4T+P/oJGrRt1l9CTQdtNPSV8yQ8yG7WqFO6uOGR8GYbkPMBfOZvTFdWK+hixg2imGcMJ/X77QQES9r4lttPjA/PYkSIw= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AS8PR04MB8898.eurprd04.prod.outlook.com (2603:10a6:20b:42d::15) by PA4PR04MB7614.eurprd04.prod.outlook.com (2603:10a6:102:ea::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.18; Wed, 25 Oct 2023 14:55:28 +0000 Received: from AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::b21b:d65f:6b00:34a0]) by AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::b21b:d65f:6b00:34a0%6]) with mapi id 15.20.6933.011; Wed, 25 Oct 2023 14:55:28 +0000 From: Iulia Tanasescu To: luiz.dentz@gmail.com Cc: andrei.istodorescu@nxp.com, claudia.rosu@nxp.com, iulia.tanasescu@nxp.com, linux-bluetooth@vger.kernel.org, mihai-octavian.urzica@nxp.com, silviu.barbulescu@nxp.com, vlad.pruteanu@nxp.com Subject: Re: [PATCH BlueZ 1/4] btio: Handle closed channel in server_cb Date: Wed, 25 Oct 2023 17:55:26 +0300 Message-Id: <20231025145526.3027-1-iulia.tanasescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: VI1PR09CA0152.eurprd09.prod.outlook.com (2603:10a6:803:12c::36) To AS8PR04MB8898.eurprd04.prod.outlook.com (2603:10a6:20b:42d::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8898:EE_|PA4PR04MB7614:EE_ X-MS-Office365-Filtering-Correlation-Id: 9fe540ba-5492-43da-c019-08dbd56a6d70 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0olHpoWziUhHHKqv3zaaW+HgsHaNnGo7T5HH4s1FnWi6sUU4i0wpLKpDLqAt09iQp+bz5aEKfgvhb3nT95lxRunn1B9Y5Hq8MYytt9m4qBU8+kTSfSbJUlbLHnFhSftip3gtZn8IQY3KEh96X3vjLMyxyrXEzMW7BDHejesmjC2A7qADS1BTCjWggXQSw3/H0yFn5a5G+w03wJDGRglQFl3QjP+PWPQyH5RUJ6eMeYeXp/Cn+BJb2ubpYhXLX0X6kDh0/TxLV7WIrVV75LHH1ZJ5Tnx4Qq0AbNgtIIkkSUyQHRnmAFsnPCW2UNdQ0IsvdT9nWUPJ9nWVy3rRIHta6nIHFHthxK0CyIFNsuxARusIg+RpVO4yol476eAAawRAtFgwN9ZPCfXHebPz97/AvuLup5lf7Vg8HfmJtfwFuhls4s4dvLdm9Nr99N0Z2qt2HdnVaYg5Fkyptg7JN7CQZDqxbtnDO726t2WhRk3plqiClx0O/t0stVKIfdkFRR2zKpcT58Ptr+n4JIqMNtwz1QOv+Y8r2pB2VzgJTjuiryTAuz0zs5vXTF2UsmHTKNyx X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8898.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366004)(136003)(346002)(376002)(396003)(39860400002)(230922051799003)(186009)(1800799009)(451199024)(64100799003)(53546011)(6506007)(1076003)(2616005)(26005)(6512007)(8936002)(5660300002)(4326008)(2906002)(8676002)(44832011)(478600001)(6486002)(66556008)(86362001)(316002)(66946007)(6916009)(41300700001)(66476007)(38100700002)(83380400001)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?elRxrohS2qdoIQlRK3gdV6SViy3qhIELO/HdJSvivvd3FP9XSjcDE1v9LVzz?= =?us-ascii?Q?1T6xz6cHKI9v+jE4339pNTjUEEZDnyUIYvWTizfqCeFNv6EYdcIYrMapNo4v?= =?us-ascii?Q?2Jqo+N35MnSJz3MyH7tQqhfin133uPHKReF2vJJRizEJHJqqfz7SuSBBlptm?= =?us-ascii?Q?4e/fLYa26/nTNHmR3s5wLCBt2vPrstORCWitSk5PvSx8peEyrSp1AWkeik6l?= =?us-ascii?Q?k46RhLnZs3lGZ0APtOPHvH9IgD6v3kdmjM1xv7rgKCIIlN/oZxJEEQxP1Lz2?= =?us-ascii?Q?Q/X5QOYs7SRhJP7l38oBRN9kk/EeZ055xpOxCyzjsq5YVRFknD5PVLV13Ilq?= =?us-ascii?Q?QqugZutOCjJQOFFbtSeQ8nIsC1dBhnRDIoaDjw3B7i7bR7jTGoBOsUc4Y1CK?= =?us-ascii?Q?G3HDKUKZ6piziz0Q77IpO/KGtI1ksssYiLS45ksENxJTCdzff5H3psqr+dcY?= =?us-ascii?Q?Z0ECO+OYRIOuWrnsC7g3z30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av?= =?us-ascii?Q?B9ZlQN97L1AaZmz+P+QeN0kpdKGFii0qyIUEykgtBvNkuRLIJQYWp3fi1rA9?= =?us-ascii?Q?5824+m7AE2SFIqMgTtLC5IK1/QRHicrkdOx9rqjnA0g+r+H9H+hcwGiernk/?= =?us-ascii?Q?ZGwSgXyUTLALxRF5Csd74vDtVCqqvxKgrJm1LjYXuFb607HKpRI/FAyENQLl?= =?us-ascii?Q?Lr4lrfmt1SSjNFYXj+nYEFi/3kohQDgKa+4lp8kHyNp8MBpDEY9nWy5t+7T9?= =?us-ascii?Q?7Q=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9fe540ba-5492-43da-c019-08dbd56a6d70 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8898.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Oct 2023 14:55:28.3570 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 2RnZ3H0n6ssgMUwlBlQftli141LHivdsME3NZXGbRX8Rv3kCOWBmVZVqv/TgydJ3qD/fDO8R4fvdP0t2Yplf7Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB7614 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 25 Oct 2023 07:55:35 -0700 (PDT) Hi Luiz, > -----Original Message----- > From: Luiz Augusto von Dentz > Sent: Monday, October 16, 2023 8:01 PM > To: Iulia Tanasescu > Cc: linux-bluetooth@vger.kernel.org; Claudia Cristina Draghicescu > ; Mihai-Octavian Urzica octavian.urzica@nxp.com>; Silviu Florian Barbulescu > ; Vlad Pruteanu ; > Andrei Istodorescu > Subject: Re: [PATCH BlueZ 1/4] btio: Handle closed channel in server_cb > > Hi Iulia, > > On Mon, Oct 16, 2023 at 8:49 AM Iulia Tanasescu > wrote: > > > > This handles G_IO_ERR and G_IO_HUP conditions in server_cb > > > > --- > > btio/btio.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/btio/btio.c b/btio/btio.c index d45b8240d..c63a6d1df > > 100644 > > --- a/btio/btio.c > > +++ b/btio/btio.c > > @@ -247,7 +247,8 @@ static gboolean server_cb(GIOChannel *io, > GIOCondition cond, > > GIOChannel *cli_io; > > > > /* If the user closed the server */ > > - if ((cond & G_IO_NVAL) || check_nval(io)) > > + if ((cond & (G_IO_NVAL | G_IO_ERR | G_IO_HUP)) || > > + check_nval(io)) > > I believe this was done on purpose to only check for NVAL, the other > conditions shall probably be notified back via callback so it can process the > error reported. > It seems that server_cb is supposed to accept an incoming connection on server io and pass the child io through the confirm or connect callbacks. But if the condition is G_IO_HUP for example, we shouldn't get to the point of calling accept. > > return FALSE; > > > > srv_sock = g_io_channel_unix_get_fd(io); > > -- > > 2.39.2 > > > > > -- > Luiz Augusto von Dentz Regards, Iulia