From patchwork Thu Oct 24 15:45:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felix Huettner X-Patchwork-Id: 2001808 X-Patchwork-Delegate: echaudro@redhat.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=stackit.cloud header.i=@stackit.cloud header.a=rsa-sha256 header.s=selector1 header.b=WSdwYcbQ; dkim=fail reason="signature verification failed" (2048-bit key) header.d=stackit.cloud header.i=@stackit.cloud header.a=rsa-sha256 header.s=selector1 header.b=WSdwYcbQ; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.137; helo=smtp4.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XZ9Hc0gGxz1xwy for ; Fri, 25 Oct 2024 02:46:03 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id E54A3407CB; Thu, 24 Oct 2024 15:46:01 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 0b61V6BHrJr9; Thu, 24 Oct 2024 15:45:59 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=2605:bc80:3010:104::8cd3:938; helo=lists.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 29E52407AD Authentication-Results: smtp4.osuosl.org; dkim=fail reason="signature verification failed" (2048-bit key, unprotected) header.d=stackit.cloud header.i=@stackit.cloud header.a=rsa-sha256 header.s=selector1 header.b=WSdwYcbQ; dkim=fail reason="signature verification failed" (2048-bit key) header.d=stackit.cloud header.i=@stackit.cloud header.a=rsa-sha256 header.s=selector1 header.b=WSdwYcbQ Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp4.osuosl.org (Postfix) with ESMTPS id 29E52407AD; Thu, 24 Oct 2024 15:45:59 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 0A203C08A6; Thu, 24 Oct 2024 15:45:59 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 7EC97C08A3 for ; Thu, 24 Oct 2024 15:45:58 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 6D94060687 for ; Thu, 24 Oct 2024 15:45:58 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id myHs2KPXT78t for ; Thu, 24 Oct 2024 15:45:57 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2a01:111:f403:2613::615; helo=eur05-vi1-obe.outbound.protection.outlook.com; envelope-from=felix.huettner@stackit.cloud; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp3.osuosl.org 79A4A60650 Authentication-Results: smtp3.osuosl.org; dmarc=pass (p=reject dis=none) header.from=stackit.cloud DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 79A4A60650 Authentication-Results: smtp3.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=stackit.cloud header.i=@stackit.cloud header.a=rsa-sha256 header.s=selector1 header.b=WSdwYcbQ; dkim=pass (2048-bit key) header.d=stackit.cloud header.i=@stackit.cloud header.a=rsa-sha256 header.s=selector1 header.b=WSdwYcbQ Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on20615.outbound.protection.outlook.com [IPv6:2a01:111:f403:2613::615]) by smtp3.osuosl.org (Postfix) with ESMTPS id 79A4A60650 for ; Thu, 24 Oct 2024 15:45:56 +0000 (UTC) ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=xFUfr+tTK2CicXd4sl8VlWEqzIr7PCfFe3iZelJcv9CrB88U0js1YKhEJ/dP/GuAm1J5iSSa80FvQKiPqIgNzWCCrgle4/L/ofIxKzHOcDH+aYn0oFdsHxKzLjI8ysJNm00w4d0Fgp7QkfnA4tjuMX/5eeyNRm3GFNPGpwcJGYiSy2+3jalVvrrnjnAgwGugspRnu3adlVWebZvRzCesjqfqVL0uaqA/V4xj3I5FUgzAjUw/gIqa2MqGJDpRtbZ/HFu19KCFO6EE8DZb7Rpj73hA+SwMHJmJyjE+W44JEukEuHUhrMRDBkwjCtZcR2LjtIuobqAfeg/VSTlYbEx+Rg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=VE/KB787wPx8Q7F0Z715ZTxRIIS64EnS6bFnhyjjI/c=; b=rSyYEwHec+0ytL1uV2zlEBMqYt8zXOVSS8NXGQv2dqaluieRKYhIGg0gPWxTegFmNp2L/r0v6R/c1+JBnjJ7ppL1pUN+EnsfqqGNonptyFJM+qjwfjZ4ikCQi9OsnZQ/N+MbcKxaosBrpKoSh+GN01CY4a/KmUsEQ5dhPdVt7iQ536DDVvQ+64jFySJYU52l/GG2geHhTHHSpsa31dXa0F15hxPxTvgtFTBIvHmsl/l7z3kLMh8DYHbeLO35GGKQBVWyLOKvt2IsFPrK/RpwHBp203cYtK3sb0cwUz9vP64K1//NDebEXDyMlgSNUG3aNvYTAhOKSAAuWT8lzc5p8A== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=fail (sender ip is 104.40.229.156) smtp.rcpttodomain=openvswitch.org smtp.mailfrom=stackit.cloud; dmarc=pass (p=reject sp=none pct=100) action=none header.from=stackit.cloud; dkim=pass (signature was verified) header.d=stackit.cloud; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=stackit.cloud] dkim=[1,1,header.d=stackit.cloud] dmarc=[1,1,header.from=stackit.cloud]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=stackit.cloud; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VE/KB787wPx8Q7F0Z715ZTxRIIS64EnS6bFnhyjjI/c=; b=WSdwYcbQZofG4WHiuzzuaZ1BkGDNJ5Q1jQxWom5yroieHQoBpsOC+jyssMDTSqbkk2V4tz6RZluYpFCRxu5OEZlbSYwtpys1h1/Ogj7pq7NwxjlCw+hR7hXwVaQsPmS9xG4aG/PqQ2ArP4OYvW8wNtKe0fq6bfhaQgErYexlW0X8zlE1Y5eJIiqhaSHltBEVyMGx4j0ie7DEIG17gLcphh33TwEDjPhLXxu0ERHSyIUFGqjZ026VmtCb/rjjb5c5xKSNkAcSGl4pPlMeo5pfIh5Y5I3V61BrjSH6c+35HS6MeaSP6qXrq30VaHUWQ4VxCMsmRxNDKYMsQGpB03HmhQ== Received: from AM0P190CA0002.EURP190.PROD.OUTLOOK.COM (2603:10a6:208:190::12) by DU4PR10MB8573.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:55a::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.17; Thu, 24 Oct 2024 15:45:52 +0000 Received: from AM2PEPF0001C714.eurprd05.prod.outlook.com (2603:10a6:208:190:cafe::73) by AM0P190CA0002.outlook.office365.com (2603:10a6:208:190::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.29 via Frontend Transport; Thu, 24 Oct 2024 15:45:52 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 104.40.229.156) smtp.mailfrom=stackit.cloud; dkim=pass (signature was verified) header.d=stackit.cloud;dmarc=pass action=none header.from=stackit.cloud; Received-SPF: Fail (protection.outlook.com: domain of stackit.cloud does not designate 104.40.229.156 as permitted sender) receiver=protection.outlook.com; client-ip=104.40.229.156; helo=eu1.smtp.exclaimer.net; Received: from eu1.smtp.exclaimer.net (104.40.229.156) by AM2PEPF0001C714.mail.protection.outlook.com (10.167.16.184) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.14 via Frontend Transport; Thu, 24 Oct 2024 15:45:50 +0000 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (104.47.51.172) by eu1.smtp.exclaimer.net (104.40.229.156) with Exclaimer Signature Manager ESMTP Proxy eu1.smtp.exclaimer.net (tlsversion=TLS12, tlscipher=TLS_DIFFIEHELLMAN_WITH_AES256_NONE); Thu, 24 Oct 2024 15:45:50 +0000 X-ExclaimerHostedSignatures-MessageProcessed: true X-ExclaimerProxyLatency: 4735586 X-ExclaimerImprintLatency: 2338941 X-ExclaimerImprintAction: 5d2e2230dd0548da82b41fed11117316 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=jb+GrbKUO/k6qBf3CWb46Q2YrJqbuN0a+NPVgTk9ELQKTShr2GEO6hgRVL9/ReG/mw0lpEkfRmPdR/0P6SweExgEzTZSLbbrN/AXij8XONs+66ZiZnbjXS8FyGUuQIrllkpSjvn5y/2FGIRhqeWfEhFvX+JI23g499frBuTXnHJhWgNc8cz6fr09zQhOJuqsfb92lL1p5LLICIuNm9AfJL6BD2W4XtlJ8XEc77JiyHiUd1obhagtBfjRdRnbaY1Bp2fg8W3eBwjjNPYtDlVESP4RwG/AArfJJJIZZFjhRHZjCLt53KY8avKKTqASY0sqtuqRQRrgS2jwmoG/Qo+PUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=VE/KB787wPx8Q7F0Z715ZTxRIIS64EnS6bFnhyjjI/c=; b=ww2tu0ZR7MXelY0JOI9xqFhvcRJiWw3l6EOLGRI6I0UaqrgsWKPYj/QVlW51lLKeHX/3LuKJeG/eC7Cpj0VC3gqwklc2sH5ycvcRDeohPqyhxD9ivCTkBjDLBKwNLMj2fO2Spo6FZSpJR8U4i0IlUNLuLTnxWU8ISAFpJA0I78DklFD2RtS9qYp/K01UhraVNEx444rfqKnVlBPhQg+gdJpoAxLthsXtHXjNOTtFcu1w6TSOTSPHcCZBhv+VWDHi4WnVbnHFpUjVVPOSi0Q3DggBhkntn40I9r031sSe9L5Tb0lFXmCeECA3+v7j9GwJxEC0oqNqTxgFare2eAmYkg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=stackit.cloud; dmarc=pass action=none header.from=stackit.cloud; dkim=pass header.d=stackit.cloud; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=stackit.cloud; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VE/KB787wPx8Q7F0Z715ZTxRIIS64EnS6bFnhyjjI/c=; b=WSdwYcbQZofG4WHiuzzuaZ1BkGDNJ5Q1jQxWom5yroieHQoBpsOC+jyssMDTSqbkk2V4tz6RZluYpFCRxu5OEZlbSYwtpys1h1/Ogj7pq7NwxjlCw+hR7hXwVaQsPmS9xG4aG/PqQ2ArP4OYvW8wNtKe0fq6bfhaQgErYexlW0X8zlE1Y5eJIiqhaSHltBEVyMGx4j0ie7DEIG17gLcphh33TwEDjPhLXxu0ERHSyIUFGqjZ026VmtCb/rjjb5c5xKSNkAcSGl4pPlMeo5pfIh5Y5I3V61BrjSH6c+35HS6MeaSP6qXrq30VaHUWQ4VxCMsmRxNDKYMsQGpB03HmhQ== Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=stackit.cloud; Received: from DB4PR10MB6917.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:3ff::16) by GV2PR10MB6574.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:150:b5::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.14; Thu, 24 Oct 2024 15:45:49 +0000 Received: from DB4PR10MB6917.EURPRD10.PROD.OUTLOOK.COM ([fe80::b865:87a6:68fa:764e]) by DB4PR10MB6917.EURPRD10.PROD.OUTLOOK.COM ([fe80::b865:87a6:68fa:764e%5]) with mapi id 15.20.8093.014; Thu, 24 Oct 2024 15:45:49 +0000 Date: Thu, 24 Oct 2024 17:45:47 +0200 To: dev@openvswitch.org Message-ID: <673527edfc89645d393f6669460c775e45a98391.1729784574.git.felix.huettner@stackit.cloud> Mail-Followup-To: dev@openvswitch.org References: Content-Disposition: inline In-Reply-To: X-please-dont-add-a-signature: thanks X-ClientProxiedBy: FR3P281CA0111.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a3::14) To DB4PR10MB6917.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:3ff::16) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: DB4PR10MB6917:EE_|GV2PR10MB6574:EE_|AM2PEPF0001C714:EE_|DU4PR10MB8573:EE_ X-MS-Office365-Filtering-Correlation-Id: 62c29c69-9dbd-48e9-7e69-08dcf442efe9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0;ARA:13230040|376014|366016|1800799024; X-Microsoft-Antispam-Message-Info-Original: N8y2eq1s8gQmW8XYVHQznApauH43oiHDeUYfgvjYywgY6IF/zK3jTvPibra2zFZiug5ygGRHqdK9/RpzrAFADb4HoUDZxoA/Xu8TTKIS26k9nMk2lh0UJfvBaf/3l7dbpl1d5CajUWDbSiCwoCgnQB0VqNjE6Y6xSY0CeUr8mkwCSHx3CnV3/aU8R+92s/ZCczs8jZ5z97ahZi7csMEGpnepvzZTk4IG3fesc9rj7NnIJ3YLoofRGTUpbO6fZHpTvxzuJA0MQ+PHM+EY19SCYceshPO9vOqryJ7fbn5R2n5rOMFyFAvCYtsxJbG8tdSQ6ovMEhS8bcPb/Tg2dVbA98LGSS8eZuHBgnc8WN59YCbmuN1PWx0iXPcV3Q8UrqGgtYoH12yJ7xG2BDOueF4Y9XoMFIE3Vputx6RG2L5Pfnnw/fSIrYIBRf541+nVFeAR6v8kSNoo6Bav6GmvqmU56X/4rjInbydOAMEWarRr5nKtEuDvs+vee/t8Fejh9eM02c4PWAmED6T9C8w0ARR0RRDfSU3gsBRHa6nPxHVPhIHUEvmgJePytaN/LUei+O+LNQRPvBu75/jYccqUuQ7AJ/4t05AbxZHrsB/2nC6da3GIQs8/3S4fRbbVfurjvbuWp/+0MkzP1i8Xq3+JKyFEI0ZndIaFVVGIuZ0YQZQL5um/F+UA5Jwu49DQvAy3cg/Qh/fz9XZtHJ54SP0bLaaFEnWMnff2J+bPifeWGvuy1zK8aai0SQ4DaVcnfnKRlABRJEBEGLdecpMQ4d/nJMC87ZUjnyGDIHwlABTTUauPTf4naH5mCEDknp77M/mkPUH40VYXmV70QPfoYK/ujALpnN12RmPnHbZbMPwXVlOiku0yqmlK7j9OkkVho2R2shp46PFHgXW+PeuaNk/uDUNjvlxvDErgrtTHtYOIIbwc08rL8eWEzx9GC2QUfK8YeaZS//rtGK+LcsAx+rEWaRaYUrvT4sMrNOhMtaBtb+NsKWisTj38zMYShT8Rxf6mynHRUbB8Y0czRpNbgjzIbaf463PVggCwKUNXorexJKfZDy49EV8qDVCTkKTjmw10hURHPExH+08gNzzPvoIPjLWt4syTXI+ejmNpwQ9CYQkuQzgkh9CznitKgYQ21D5+H8WSuaFA3YY5kz56lwxWiwUvB3dIFN4idRUWlUx30/PiNAmWKssDUwEhdDHv8xXt8P2JFzzoZrcxyD4g6LZfk7FPW5/VD7kR9SqsjatJyZN/9wbGqKocshGzVDl83dgxPFsa2PduCiQ+zC9tE0eSEWAQJMrAdeGPNxaKjnGrk6bG+eT4Grxyxa4BIBXaiuaDJlts X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB4PR10MB6917.EURPRD10.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230040)(376014)(366016)(1800799024); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR10MB6574 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM2PEPF0001C714.eurprd05.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 6186ef79-79b8-45b6-0b8d-08dcf442eeb4 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|36860700013|1800799024|82310400026|35042699022; X-Microsoft-Antispam-Message-Info: +8SQflmUTL2ds3ybnlzqBynbojktzThwKT7ssqc3ow9de+iZMhq23o+0uG/LTVupsuPKpl6YhoUoyAGplJ9WzPe394QgNcXOtbgbm1lX3dh211FDT3isVZ/Q2tsW9ytgxybnBEzea+JgtUcGHPTEos9RweB9GOBnMmS0zaK14tjWgI3mDAnpKUjCQv6HMTgbzPoPRG7LM25dwtJDR8BWuY2VZV08fuJj2+2UDbmM1P9diFdLVAkTnbb0LVG3HWWmNx90Xl8g4HTWWyqeu4IJbJA6ZAaN53xEx+Xkp+qlsjKxlYm6ImTbK+5SsDJUxp25z1jOEcEn/xSp0AMukWahlpmLen+5jYNVtM6X/m+O5IwI6/Ax5mdHs7cV+ujdze1FIpgk1YxKHnOxPKBFrpeEnUr3IsoArawhdpU5B/2DIHQ7xBQKTA9RAOm1JILiGWPv7kdanJwUwIWE5rj7H98NR7F2xxScy9Ob2d2lgQut1/AZoP0+Q9YV2r1nuxU0L1TMdpHsiqhrydlrs8Muix3achVGUjxD46FcCa0A8eTvLlEUkwtvN+VL5crswmGflF3mpdE0SC1zYQ6y6zBRCMAMWOtUMTl+Dlcxx4Tpyj0F8+fkOyrlaRhMtMfV37l+guSMJZyOGKusnkVbwthaVtGCYWC2Zydf8YCvSOZ6vlIMDhxhT+urBx6Q78YDx/u8Wq7JoDMdjWtytG3xEDFUVy6VFhsVTcvt4hVrpiJgV3n+G40xIqrHLm25gdjNhrAPrftgbFEy2RooRm523wkrdwVNqivhiHLPRh9xk83k4g8InNfBgQE7tYiIrfhU0/e9/uK5tyj+S8PkngknC++KkpjJUXkw2xE2E3sXZ9n7TPX6zx2ZH/z3laOuqQL7FcHyABthKSs4A/B7gy1NxSyOm/9mvbLLksW3DHilhi7kl+vXWdqwUezrn+QDC/YEgEmbp9mbiowq1nRoiq0gpyPVYgbkv1r+lyT2RRflEAbU9YkPFAVGalvlLpAGZ8rXXuE8t/RPoxBzovSbi9pOwPcGfL4kM9a1Mi1vJJUB3NcHgOHDVh00tXOhhm7w4xU4gI+mURQQazomIf4Y1KSmYEWlHjA/d+8qT3Tla3imuDiPB+bEyX6whJgDMg+HHjE/isrUgKKdWqB2KrB7ajI5V9XPRAe38z6Gqx5VVPUSpJaVYPAUTD78tvGJADUKDKrYSKLzAPkzqsQP8MG7O34GxD+jmQkUIaWBBgYo9mgf3Tb6I+mP6WuOtb6vL3SFnbIhMLn8OU0wdWS5Ws1U8HM1XxCJqEMUTdUzEZb84vRKu/dnXe7bbzkXfB3edK9DpD/gm141R83fKdtzvon1tB0Opr25/Bdv+RZX9/4RfOMpR9sGW2JFqC5efujgHvb28TvyABNJLqQQUwzDDSCqZZ3CKGktx3J2+w== X-Forefront-Antispam-Report: CIP:104.40.229.156; CTRY:NL; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:eu1.smtp.exclaimer.net; PTR:eu1.smtp.exclaimer.net; CAT:NONE; SFS:(13230040)(376014)(36860700013)(1800799024)(82310400026)(35042699022); DIR:OUT; SFP:1101; X-OriginatorOrg: stackit.cloud X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Oct 2024 15:45:50.6874 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 62c29c69-9dbd-48e9-7e69-08dcf442efe9 X-MS-Exchange-CrossTenant-Id: d04f4717-5a6e-4b98-b3f9-6918e0385f4c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=d04f4717-5a6e-4b98-b3f9-6918e0385f4c; Ip=[104.40.229.156]; Helo=[eu1.smtp.exclaimer.net] X-MS-Exchange-CrossTenant-AuthSource: AM2PEPF0001C714.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU4PR10MB8573 Subject: [ovs-dev] [PATCH v1 1/6] netlink: Support accessing namespaces. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Felix Huettner via dev From: Felix Huettner Reply-To: Felix Huettner Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" In the future we need to access routing table entries in network namespaces. As netlink has no easy way to get a socket in a network namespace we copy the logic of frr where we: 1. enter the target netns 2. open a socket 3. jump back to our original netns the socket will keep working between these jumps. Signed-off-by: Felix Huettner --- lib/dpif-netlink-rtnl.c | 6 +-- lib/dpif-netlink.c | 22 ++++---- lib/netdev-linux.c | 6 +-- lib/netlink-conntrack.c | 20 ++++---- lib/netlink-socket.c | 110 ++++++++++++++++++++++++++++++++-------- lib/netlink-socket.h | 7 +-- lib/route-table.c | 6 +-- lib/tc.c | 8 +-- 8 files changed, 127 insertions(+), 58 deletions(-) diff --git a/lib/dpif-netlink-rtnl.c b/lib/dpif-netlink-rtnl.c index f7035333e..2df905d92 100644 --- a/lib/dpif-netlink-rtnl.c +++ b/lib/dpif-netlink-rtnl.c @@ -158,7 +158,7 @@ rtnl_transact(uint32_t type, uint32_t flags, const char *name, ofpbuf_put_zeros(&request, sizeof(struct ifinfomsg)); nl_msg_put_string(&request, IFLA_IFNAME, name); - err = nl_transact(NETLINK_ROUTE, &request, reply); + err = nl_transact(NULL, NETLINK_ROUTE, &request, reply); ofpbuf_uninit(&request); return err; @@ -342,7 +342,7 @@ rtnl_set_mtu(const char *name, uint32_t mtu, struct ofpbuf *request) nl_msg_put_string(request, IFLA_IFNAME, name); nl_msg_put_u32(request, IFLA_MTU, mtu); - return nl_transact(NETLINK_ROUTE, request, NULL); + return nl_transact(NULL, NETLINK_ROUTE, request, NULL); } static int @@ -425,7 +425,7 @@ dpif_netlink_rtnl_create(const struct netdev_tunnel_config *tnl_cfg, nl_msg_end_nested(&request, infodata_off); nl_msg_end_nested(&request, linkinfo_off); - err = nl_transact(NETLINK_ROUTE, &request, NULL); + err = nl_transact(NULL, NETLINK_ROUTE, &request, NULL); if (!err && (type == OVS_VPORT_TYPE_GRE || type == OVS_VPORT_TYPE_IP6GRE)) { /* Work around a bug in kernel GRE driver, which ignores IFLA_MTU in diff --git a/lib/dpif-netlink.c b/lib/dpif-netlink.c index 84e2bd8ea..3e4e03697 100644 --- a/lib/dpif-netlink.c +++ b/lib/dpif-netlink.c @@ -1348,7 +1348,7 @@ dpif_netlink_port_dump_start__(const struct dpif_netlink *dpif, buf = ofpbuf_new(1024); dpif_netlink_vport_to_ofpbuf(&request, buf); - nl_dump_start(dump, NETLINK_GENERIC, buf); + nl_dump_start(NULL, dump, NETLINK_GENERIC, buf); ofpbuf_delete(buf); } @@ -1682,7 +1682,7 @@ dpif_netlink_flow_dump_create(const struct dpif *dpif_, bool terse, buf = ofpbuf_new(1024); dpif_netlink_flow_to_ofpbuf(&request, buf); - nl_dump_start(&dump->nl_dump, NETLINK_GENERIC, buf); + nl_dump_start(NULL, &dump->nl_dump, NETLINK_GENERIC, buf); ofpbuf_delete(buf); } atomic_init(&dump->status, 0); @@ -2141,7 +2141,7 @@ dpif_netlink_operate__(struct dpif_netlink *dpif, for (i = 0; i < n_ops; i++) { txnsp[i] = &auxes[i].txn; } - nl_transact_multiple(NETLINK_GENERIC, txnsp, n_ops); + nl_transact_multiple(NULL, NETLINK_GENERIC, txnsp, n_ops); for (i = 0; i < n_ops; i++) { struct op_auxdata *aux = &auxes[i]; @@ -3391,7 +3391,7 @@ dpif_netlink_ct_set_limits(struct dpif *dpif OVS_UNUSED, } nl_msg_end_nested(request, opt_offset); - int err = nl_transact(NETLINK_GENERIC, request, NULL); + int err = nl_transact(NULL, NETLINK_GENERIC, request, NULL); ofpbuf_delete(request); return err; } @@ -3476,7 +3476,7 @@ dpif_netlink_ct_get_limits(struct dpif *dpif OVS_UNUSED, } struct ofpbuf *reply; - int err = nl_transact(NETLINK_GENERIC, request, &reply); + int err = nl_transact(NULL, NETLINK_GENERIC, request, &reply); if (err) { goto out; } @@ -3520,7 +3520,7 @@ dpif_netlink_ct_del_limits(struct dpif *dpif OVS_UNUSED, nl_msg_end_nested(request, opt_offset); } - int err = nl_transact(NETLINK_GENERIC, request, NULL); + int err = nl_transact(NULL, NETLINK_GENERIC, request, NULL); ofpbuf_delete(request); return err; @@ -4066,7 +4066,7 @@ dpif_netlink_meter_transact(struct ofpbuf *request, struct ofpbuf **replyp, const struct nl_policy *reply_policy, struct nlattr **a, size_t size_a) { - int error = nl_transact(NETLINK_GENERIC, request, replyp); + int error = nl_transact(NULL, NETLINK_GENERIC, request, replyp); ofpbuf_uninit(request); if (error) { @@ -4818,7 +4818,7 @@ dpif_netlink_vport_transact(const struct dpif_netlink_vport *request, request_buf = ofpbuf_new(1024); dpif_netlink_vport_to_ofpbuf(request, request_buf); - error = nl_transact(NETLINK_GENERIC, request_buf, bufp); + error = nl_transact(NULL, NETLINK_GENERIC, request_buf, bufp); ofpbuf_delete(request_buf); if (reply) { @@ -4969,7 +4969,7 @@ dpif_netlink_dp_dump_start(struct nl_dump *dump) buf = ofpbuf_new(1024); dpif_netlink_dp_to_ofpbuf(&request, buf); - nl_dump_start(dump, NETLINK_GENERIC, buf); + nl_dump_start(NULL, dump, NETLINK_GENERIC, buf); ofpbuf_delete(buf); } @@ -4990,7 +4990,7 @@ dpif_netlink_dp_transact(const struct dpif_netlink_dp *request, request_buf = ofpbuf_new(1024); dpif_netlink_dp_to_ofpbuf(request, request_buf); - error = nl_transact(NETLINK_GENERIC, request_buf, bufp); + error = nl_transact(NULL, NETLINK_GENERIC, request_buf, bufp); ofpbuf_delete(request_buf); if (reply) { @@ -5223,7 +5223,7 @@ dpif_netlink_flow_transact(struct dpif_netlink_flow *request, request_buf = ofpbuf_new(1024); dpif_netlink_flow_to_ofpbuf(request, request_buf); - error = nl_transact(NETLINK_GENERIC, request_buf, bufp); + error = nl_transact(NULL, NETLINK_GENERIC, request_buf, bufp); ofpbuf_delete(request_buf); if (reply) { diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c index 0cd0850a3..2353ee1a2 100644 --- a/lib/netdev-linux.c +++ b/lib/netdev-linux.c @@ -3358,7 +3358,7 @@ start_queue_dump(const struct netdev *netdev, struct queue_dump_state *state) return false; } tcmsg->tcm_parent = 0; - nl_dump_start(&state->dump, NETLINK_ROUTE, &request); + nl_dump_start(NULL, &state->dump, NETLINK_ROUTE, &request); ofpbuf_uninit(&request); ofpbuf_init(&state->buf, NL_DUMP_BUFSIZE); @@ -6722,7 +6722,7 @@ get_stats_via_netlink(const struct netdev *netdev_, struct netdev_stats *stats) RTM_GETLINK, NLM_F_REQUEST); ofpbuf_put_zeros(&request, sizeof(struct ifinfomsg)); nl_msg_put_string(&request, IFLA_IFNAME, netdev_get_name(netdev_)); - error = nl_transact(NETLINK_ROUTE, &request, &reply); + error = nl_transact(NULL, NETLINK_ROUTE, &request, &reply); ofpbuf_uninit(&request); if (error) { return error; @@ -6858,7 +6858,7 @@ netdev_linux_update_via_netlink(struct netdev_linux *netdev) nl_msg_put_u32(&request, IFLA_EXT_MASK, RTEXT_FILTER_SKIP_STATS); - error = nl_transact(NETLINK_ROUTE, &request, &reply); + error = nl_transact(NULL, NETLINK_ROUTE, &request, &reply); ofpbuf_uninit(&request); if (error) { ofpbuf_delete(reply); diff --git a/lib/netlink-conntrack.c b/lib/netlink-conntrack.c index 0b3a8adf5..79ca17ec9 100644 --- a/lib/netlink-conntrack.c +++ b/lib/netlink-conntrack.c @@ -144,7 +144,7 @@ nl_ct_dump_start(struct nl_ct_dump_state **statep, const uint16_t *zone, if (zone) { nl_msg_put_be16(&state->buf, CTA_ZONE, htons(*zone)); } - nl_dump_start(&state->dump, NETLINK_NETFILTER, &state->buf); + nl_dump_start(NULL, &state->dump, NETLINK_NETFILTER, &state->buf); ofpbuf_clear(&state->buf); /* Buckets to store connections are not used. */ @@ -236,7 +236,7 @@ nl_ct_flush(void) nl_msg_put_nfgenmsg(&buf, 0, AF_UNSPEC, NFNL_SUBSYS_CTNETLINK, IPCTNL_MSG_CT_DELETE, NLM_F_REQUEST); - err = nl_transact(NETLINK_NETFILTER, &buf, NULL); + err = nl_transact(NULL, NETLINK_NETFILTER, &buf, NULL); ofpbuf_uninit(&buf); /* Expectations are flushed automatically, because they do not @@ -260,7 +260,7 @@ nl_ct_flush_tuple(const struct ct_dpif_tuple *tuple, uint16_t zone) err = EOPNOTSUPP; goto out; } - err = nl_transact(NETLINK_NETFILTER, &buf, NULL); + err = nl_transact(NULL, NETLINK_NETFILTER, &buf, NULL); out: ofpbuf_uninit(&buf); return err; @@ -278,7 +278,7 @@ nl_ct_flush_zone_with_cta_zone(uint16_t flush_zone) IPCTNL_MSG_CT_DELETE, NLM_F_REQUEST); nl_msg_put_be16(&buf, CTA_ZONE, htons(flush_zone)); - err = nl_transact(NETLINK_NETFILTER, &buf, NULL); + err = nl_transact(NULL, NETLINK_NETFILTER, &buf, NULL); ofpbuf_uninit(&buf); return err; @@ -340,7 +340,7 @@ nl_ct_flush_zone(uint16_t flush_zone) nl_msg_put_nfgenmsg(&buf, 0, AF_UNSPEC, NFNL_SUBSYS_CTNETLINK, IPCTNL_MSG_CT_GET, NLM_F_REQUEST); nl_msg_put_be16(&buf, CTA_ZONE, htons(flush_zone)); - nl_dump_start(&dump, NETLINK_NETFILTER, &buf); + nl_dump_start(NULL, &dump, NETLINK_NETFILTER, &buf); ofpbuf_clear(&buf); for (;;) { @@ -374,7 +374,7 @@ nl_ct_flush_zone(uint16_t flush_zone) attrs[CTA_TUPLE_ORIG]->nla_len - NLA_HDRLEN); nl_msg_put_unspec(&delete, CTA_ID, attrs[CTA_ID] + 1, attrs[CTA_ID]->nla_len - NLA_HDRLEN); - nl_transact(NETLINK_NETFILTER, &delete, NULL); + nl_transact(NULL, NETLINK_NETFILTER, &delete, NULL); ofpbuf_clear(&delete); } @@ -1101,7 +1101,7 @@ nl_ct_set_timeout_policy(const struct nl_ct_timeout_policy *nl_tp) } nl_msg_end_nested(&buf, offset); - int err = nl_transact(NETLINK_NETFILTER, &buf, NULL); + int err = nl_transact(NULL, NETLINK_NETFILTER, &buf, NULL); ofpbuf_uninit(&buf); return err; } @@ -1116,7 +1116,7 @@ nl_ct_get_timeout_policy(const char *tp_name, nl_msg_put_nfgenmsg(&request, 0, AF_UNSPEC, NFNL_SUBSYS_CTNETLINK_TIMEOUT, IPCTNL_MSG_TIMEOUT_GET, NLM_F_REQUEST | NLM_F_ACK); nl_msg_put_string(&request, CTA_TIMEOUT_NAME, tp_name); - int err = nl_transact(NETLINK_NETFILTER, &request, &reply); + int err = nl_transact(NULL, NETLINK_NETFILTER, &request, &reply); if (err) { goto out; } @@ -1139,7 +1139,7 @@ nl_ct_del_timeout_policy(const char *tp_name) IPCTNL_MSG_TIMEOUT_DELETE, NLM_F_REQUEST | NLM_F_ACK); nl_msg_put_string(&buf, CTA_TIMEOUT_NAME, tp_name); - int err = nl_transact(NETLINK_NETFILTER, &buf, NULL); + int err = nl_transact(NULL, NETLINK_NETFILTER, &buf, NULL); ofpbuf_uninit(&buf); return err; } @@ -1162,7 +1162,7 @@ nl_ct_timeout_policy_dump_start( IPCTNL_MSG_TIMEOUT_GET, NLM_F_REQUEST | NLM_F_ACK | NLM_F_DUMP); - nl_dump_start(&state->dump, NETLINK_NETFILTER, &request); + nl_dump_start(NULL, &state->dump, NETLINK_NETFILTER, &request); ofpbuf_uninit(&request); ofpbuf_init(&state->buf, NL_DUMP_BUFSIZE); return 0; diff --git a/lib/netlink-socket.c b/lib/netlink-socket.c index 976ed15e8..801b4badd 100644 --- a/lib/netlink-socket.c +++ b/lib/netlink-socket.c @@ -17,6 +17,7 @@ #include #include "netlink-socket.h" #include +#include #include #include #include @@ -25,6 +26,7 @@ #include #include "coverage.h" #include "openvswitch/dynamic-string.h" +#include "openvswitch/shash.h" #include "hash.h" #include "openvswitch/hmap.h" #include "netlink.h" @@ -94,6 +96,7 @@ struct nl_sock { uint32_t pid; int protocol; unsigned int rcvbuf; /* Receive buffer size (SO_RCVBUF). */ + char *netns; }; /* Compile-time limit on iovecs, so that we can allocate a maximum-size array @@ -106,7 +109,7 @@ struct nl_sock { * Initialized by nl_sock_create(). */ static int max_iovs; -static int nl_pool_alloc(int protocol, struct nl_sock **sockp); +static int nl_pool_alloc(const char *, int protocol, struct nl_sock **sockp); static void nl_pool_release(struct nl_sock *); /* Creates a new netlink socket for the given netlink 'protocol' @@ -145,6 +148,7 @@ nl_sock_create(int protocol, struct nl_sock **sockp) *sockp = NULL; sock = xmalloc(sizeof *sock); + sock->netns = NULL; #ifdef _WIN32 sock->overlapped.hEvent = NULL; @@ -294,6 +298,7 @@ nl_sock_destroy(struct nl_sock *sock) #else close(sock->fd); #endif + free(sock->netns); free(sock); } } @@ -1152,6 +1157,9 @@ nl_sock_drain(struct nl_sock *sock) * Netlink socket created with the given 'protocol', and initializes 'dump' to * reflect the state of the operation. * + * The dump runs in the specified 'netns'. If 'netns' is NULL the current will + * be used. + * * 'request' must contain a Netlink message. Before sending the message, * nlmsg_len will be finalized to match request->size, and nlmsg_pid will be * set to the Netlink socket's pid. NLM_F_DUMP and NLM_F_ACK will be set in @@ -1165,13 +1173,14 @@ nl_sock_drain(struct nl_sock *sock) * The caller must eventually destroy 'request'. */ void -nl_dump_start(struct nl_dump *dump, int protocol, const struct ofpbuf *request) +nl_dump_start(const char *netns, struct nl_dump *dump, int protocol, + const struct ofpbuf *request) { nl_msg_nlmsghdr(request)->nlmsg_flags |= NLM_F_DUMP | NLM_F_ACK; ovs_mutex_init(&dump->mutex); ovs_mutex_lock(&dump->mutex); - dump->status = nl_pool_alloc(protocol, &dump->sock); + dump->status = nl_pool_alloc(netns, protocol, &dump->sock); if (!dump->status) { dump->status = nl_sock_send__(dump->sock, request, nl_sock_allocate_seq(dump->sock, 1), @@ -1725,39 +1734,95 @@ struct nl_pool { int n; }; +struct nl_ns_pool { + struct nl_pool pools[MAX_LINKS]; +}; + static struct ovs_mutex pool_mutex = OVS_MUTEX_INITIALIZER; -static struct nl_pool pools[MAX_LINKS] OVS_GUARDED_BY(pool_mutex); +static struct shash pools OVS_GUARDED_BY(pool_mutex) = + SHASH_INITIALIZER(&pools); static int -nl_pool_alloc(int protocol, struct nl_sock **sockp) +nl_sock_ns_create(const char *netns, int protocol, struct nl_sock **sockp) { + int ret, ns_fd, ns_default_fd, err; + if (netns) { + ns_default_fd = open("/proc/self/ns/net", O_RDONLY); + if (ns_default_fd < 0) { + VLOG_ERR("something wrong when opening self net fd, %d\n", + errno); + return -errno; + } + char *netns_path = xasprintf("/var/run/netns/%s", netns); + ns_fd = open(netns_path, O_RDONLY); + free(netns_path); + if (ns_fd < 0) { + VLOG_ERR("something wrong when opening other net fd, %d\n", + errno); + return -errno; + } + err = setns(ns_fd, CLONE_NEWNET); + if (err < 0) { + VLOG_ABORT("something wrong during setns to target, %d\n", + errno); + } + close(ns_fd); + } + ret = nl_sock_create(protocol, sockp); + if (netns) { + err = setns(ns_default_fd, CLONE_NEWNET); + if (err < 0) { + VLOG_ABORT("something wrong during setns to home, %d\n", + errno); + } + close(ns_default_fd); + if (*sockp) { + (*sockp)->netns = xstrdup(netns); + } + } + return ret; +} + +static int +nl_pool_alloc(const char *netns, int protocol, struct nl_sock **sockp) { struct nl_sock *sock = NULL; struct nl_pool *pool; - ovs_assert(protocol >= 0 && protocol < ARRAY_SIZE(pools)); + ovs_assert(protocol >= 0 && protocol < MAX_LINKS); ovs_mutex_lock(&pool_mutex); - pool = &pools[protocol]; - if (pool->n > 0) { - sock = pool->socks[--pool->n]; + const char * netns_name = netns ? netns : ""; + + struct nl_ns_pool *ns_pools = shash_find_data(&pools, netns_name); + if (ns_pools) { + pool = &ns_pools->pools[protocol]; + if (pool->n > 0) { + sock = pool->socks[--pool->n]; + } + + if (sock) { + ovs_mutex_unlock(&pool_mutex); + *sockp = sock; + return 0; + } } ovs_mutex_unlock(&pool_mutex); - - if (sock) { - *sockp = sock; - return 0; - } else { - return nl_sock_create(protocol, sockp); - } + return nl_sock_ns_create(netns, protocol, sockp); } static void nl_pool_release(struct nl_sock *sock) { if (sock) { - struct nl_pool *pool = &pools[sock->protocol]; + const char * netns_name = sock->netns ? sock->netns : ""; ovs_mutex_lock(&pool_mutex); + struct nl_ns_pool *ns_pools = shash_find_data(&pools, netns_name); + if (!ns_pools) { + ns_pools = xzalloc(sizeof(*ns_pools)); + shash_add(&pools, netns_name, ns_pools); + } + struct nl_pool *pool = &ns_pools->pools[sock->protocol]; if (pool->n < ARRAY_SIZE(pool->socks)) { pool->socks[pool->n++] = sock; sock = NULL; @@ -1772,6 +1837,9 @@ nl_pool_release(struct nl_sock *sock) * (e.g. NETLINK_ROUTE or NETLINK_GENERIC) and waits for a response. If * successful, returns 0. On failure, returns a positive errno value. * + * The 'request' is send in the specified netns. If 'netns' is NULL the current + * namespace is used. + * * If 'replyp' is nonnull, then on success '*replyp' is set to the kernel's * reply, which the caller is responsible for freeing with ofpbuf_delete(), and * on failure '*replyp' is set to NULL. If 'replyp' is null, then the kernel's @@ -1810,13 +1878,13 @@ nl_pool_release(struct nl_sock *sock) * needs to be idempotent. */ int -nl_transact(int protocol, const struct ofpbuf *request, +nl_transact(const char *netns, int protocol, const struct ofpbuf *request, struct ofpbuf **replyp) { struct nl_sock *sock; int error; - error = nl_pool_alloc(protocol, &sock); + error = nl_pool_alloc(netns, protocol, &sock); if (error) { if (replyp) { *replyp = NULL; @@ -1851,13 +1919,13 @@ nl_transact(int protocol, const struct ofpbuf *request, * nl_transact() for some caveats. */ void -nl_transact_multiple(int protocol, +nl_transact_multiple(const char *netns, int protocol, struct nl_transaction **transactions, size_t n) { struct nl_sock *sock; int error; - error = nl_pool_alloc(protocol, &sock); + error = nl_pool_alloc(netns, protocol, &sock); if (!error) { nl_sock_transact_multiple(sock, transactions, n); nl_pool_release(sock); diff --git a/lib/netlink-socket.h b/lib/netlink-socket.h index 7852ad052..e4d645a62 100644 --- a/lib/netlink-socket.h +++ b/lib/netlink-socket.h @@ -251,9 +251,10 @@ struct nl_transaction { }; /* Transactions without an allocated socket. */ -int nl_transact(int protocol, const struct ofpbuf *request, +int nl_transact(const char *netns, int protocol, const struct ofpbuf *request, struct ofpbuf **replyp); -void nl_transact_multiple(int protocol, struct nl_transaction **, size_t n); +void nl_transact_multiple(const char *netns, int protocol, + struct nl_transaction **, size_t n); /* Table dumping. */ #define NL_DUMP_BUFSIZE 4096 @@ -270,7 +271,7 @@ struct nl_dump { struct ovs_mutex mutex; /* Protects 'status', synchronizes recv(). */ }; -void nl_dump_start(struct nl_dump *, int protocol, +void nl_dump_start(const char *netns, struct nl_dump *dump, int protocol, const struct ofpbuf *request); bool nl_dump_next(struct nl_dump *, struct ofpbuf *reply, struct ofpbuf *buf); int nl_dump_done(struct nl_dump *); diff --git a/lib/route-table.c b/lib/route-table.c index c6cb21394..d5d98585e 100644 --- a/lib/route-table.c +++ b/lib/route-table.c @@ -156,7 +156,7 @@ route_table_wait(void) } static bool -route_table_dump_one_table(unsigned char id) +route_table_dump_one_table(const char *netns, unsigned char id) { uint64_t reply_stub[NL_DUMP_BUFSIZE / 8]; struct ofpbuf request, reply, buf; @@ -172,7 +172,7 @@ route_table_dump_one_table(unsigned char id) rq_msg->rtm_family = AF_UNSPEC; rq_msg->rtm_table = id; - nl_dump_start(&dump, NETLINK_ROUTE, &request); + nl_dump_start(netns, &dump, NETLINK_ROUTE, &request); ofpbuf_uninit(&request); ofpbuf_use_stub(&buf, reply_stub, sizeof reply_stub); @@ -212,7 +212,7 @@ route_table_reset(void) COVERAGE_INC(route_table_dump); for (size_t i = 0; i < ARRAY_SIZE(tables); i++) { - if (!route_table_dump_one_table(tables[i])) { + if (!route_table_dump_one_table(NULL, tables[i])) { /* Got unfiltered reply, no need to dump further. */ break; } diff --git a/lib/tc.c b/lib/tc.c index e55ba3b1b..56f4ca7a0 100644 --- a/lib/tc.c +++ b/lib/tc.c @@ -244,7 +244,7 @@ static void request_from_tcf_id(struct tcf_id *id, uint16_t eth_type, int tc_transact(struct ofpbuf *request, struct ofpbuf **replyp) { - int error = nl_transact(NETLINK_ROUTE, request, replyp); + int error = nl_transact(NULL, NETLINK_ROUTE, request, replyp); ofpbuf_uninit(request); return error; } @@ -2349,7 +2349,7 @@ tc_dump_flower_start(struct tcf_id *id, struct nl_dump *dump, bool terse) nl_msg_put_unspec(&request, TCA_DUMP_FLAGS, &dump_flags, sizeof dump_flags); } - nl_dump_start(dump, NETLINK_ROUTE, &request); + nl_dump_start(NULL, dump, NETLINK_ROUTE, &request); ofpbuf_uninit(&request); return 0; @@ -2361,7 +2361,7 @@ tc_dump_tc_chain_start(struct tcf_id *id, struct nl_dump *dump) struct ofpbuf request; request_from_tcf_id(id, 0, RTM_GETCHAIN, NLM_F_DUMP, &request); - nl_dump_start(dump, NETLINK_ROUTE, &request); + nl_dump_start(NULL, dump, NETLINK_ROUTE, &request); ofpbuf_uninit(&request); return 0; @@ -2380,7 +2380,7 @@ tc_dump_tc_action_start(char *name, struct nl_dump *dump) nl_msg_end_nested(&request, offset); nl_msg_end_nested(&request, root_offset); - nl_dump_start(dump, NETLINK_ROUTE, &request); + nl_dump_start(NULL, dump, NETLINK_ROUTE, &request); ofpbuf_uninit(&request); return 0; From patchwork Thu Oct 24 15:45:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felix Huettner X-Patchwork-Id: 2001809 X-Patchwork-Delegate: echaudro@redhat.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=stackit.cloud header.i=@stackit.cloud header.a=rsa-sha256 header.s=selector1 header.b=gT9n+yHd; dkim=fail reason="signature verification failed" (2048-bit key) header.d=stackit.cloud header.i=@stackit.cloud header.a=rsa-sha256 header.s=selector1 header.b=gT9n+yHd; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.138; helo=smtp1.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XZ9Hm6jtwz1xwy for ; Fri, 25 Oct 2024 02:46:12 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id D638481233; Thu, 24 Oct 2024 15:46:10 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id jOvIvqoUthQa; Thu, 24 Oct 2024 15:46:09 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=2605:bc80:3010:104::8cd3:938; helo=lists.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org A881D803BA Authentication-Results: smtp1.osuosl.org; dkim=fail reason="signature verification failed" (2048-bit key, unprotected) header.d=stackit.cloud header.i=@stackit.cloud header.a=rsa-sha256 header.s=selector1 header.b=gT9n+yHd; dkim=fail reason="signature verification failed" (2048-bit key) header.d=stackit.cloud header.i=@stackit.cloud header.a=rsa-sha256 header.s=selector1 header.b=gT9n+yHd Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp1.osuosl.org (Postfix) with ESMTPS id A881D803BA; Thu, 24 Oct 2024 15:46:09 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 7B5ABC08A6; Thu, 24 Oct 2024 15:46:09 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 1522AC08A6 for ; Thu, 24 Oct 2024 15:46:08 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 248C3405B3 for ; Thu, 24 Oct 2024 15:46:07 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id HRWFzLDf0uYm for ; Thu, 24 Oct 2024 15:46:06 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2a01:111:f403:2612::631; helo=eur05-am6-obe.outbound.protection.outlook.com; envelope-from=felix.huettner@stackit.cloud; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp2.osuosl.org 756AF40BD1 Authentication-Results: smtp2.osuosl.org; dmarc=pass (p=reject dis=none) header.from=stackit.cloud DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 756AF40BD1 Authentication-Results: smtp2.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=stackit.cloud header.i=@stackit.cloud header.a=rsa-sha256 header.s=selector1 header.b=gT9n+yHd; dkim=pass (2048-bit key) header.d=stackit.cloud header.i=@stackit.cloud header.a=rsa-sha256 header.s=selector1 header.b=gT9n+yHd Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on20631.outbound.protection.outlook.com [IPv6:2a01:111:f403:2612::631]) by smtp2.osuosl.org (Postfix) with ESMTPS id 756AF40BD1 for ; Thu, 24 Oct 2024 15:46:05 +0000 (UTC) ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=Z2A/0YpmZztFY5FUCILlJ2rm0VglpfVkUU7+EvBRFvP5UG4YMqw3y7j1ZJGsKORgrCa+ulhfyp24yXppgQP9VQ9qd35gtdAROV1xa3JjeItcQYFV6TZ4ANrFJu9ATbkPyo3wBHzMF9y9wI5etE4UEwX+7+8QS0kVHcpfM22v3kQ7Ga2C3+7RToxwSPNfG08UXOEiV8L3IBVVCEL75Q72qvPVl5kmBoci7czRC2V1xYabA/RhvG/1JhqwKjgOQAyTNOhN86BzcR6cEBkln4qZWTv8WqZt988lUm14iX2wCU5q19QKeRiwNnWaZDt0UQbOTKL1oj5A/I4NdU92CT4NMQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=GzPWrjhquOHC03VQ8I5pJfSQ3ieaXhARuN1rnHTmcdI=; b=Q4cii+UaRKmCV6w3TbxW8/6fSs7hTslBYWP9seTP0u+7bdV7uvVmNjnz10fZpVN4KK/9DzHnXnN4puPjKgnETh1k+SzIoMOgfvoRp5v70QxZdGiZPGOYdp8EoHTpOAqX5f3Rs2VRQfOvkOtT+y4imwf325g65gy9CypapwUPh0VGYIoY/ReRaW96KzQ/tpgjGnwArMBy6EDAYo5D80mVu/UmRYIl2B30ro66tBHcTjXmmA+IIIrjfxpQdydh8BHHaDBg3D6aEUHMhb5UPlwlG0TyrSYVVjV+F7mXM6f0Bj4mKGX49PJwcS4BzRIEeX3nuzSN7NTw/Ezv6FnBpFss6A== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=fail (sender ip is 52.169.0.179) smtp.rcpttodomain=openvswitch.org smtp.mailfrom=stackit.cloud; dmarc=pass (p=reject sp=none pct=100) action=none header.from=stackit.cloud; dkim=pass (signature was verified) header.d=stackit.cloud; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=stackit.cloud] dkim=[1,1,header.d=stackit.cloud] dmarc=[1,1,header.from=stackit.cloud]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=stackit.cloud; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GzPWrjhquOHC03VQ8I5pJfSQ3ieaXhARuN1rnHTmcdI=; b=gT9n+yHdJAyuBTNLLDPGn9NCnn1ZgNFdDuhWoiJqNf6uHfg4RIGN34cogp7PpQGUfUh8khAb613+a9d8XchoYQ1p4WY+mytF/SkcG7zMpFdgDOlTBO3kJgrNdBcsazd9RPNSQWZefFcixiH9tc1mMyJLXwjOmAOE91ZphcS4h4VKcyIq1GK0tXFqmPol54uTpdDglfEEJ2TwgU9QxgElV5Y9MR10FApEsJJBM2pq6K2VeByfY+TDLfDY+yT1xhAdlFhtrJjzehq1lCv6wjHxTQ0n3j0/vjvKuOHsRf9pMw4es1dU1Jrc7ZXRCGi3iAosfkxLh90bRqCAV1+a6QJ75g== Received: from AM0PR03CA0008.eurprd03.prod.outlook.com (2603:10a6:208:14::21) by AS1PR10MB5697.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:479::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.15; Thu, 24 Oct 2024 15:45:59 +0000 Received: from AM3PEPF0000A798.eurprd04.prod.outlook.com (2603:10a6:208:14:cafe::59) by AM0PR03CA0008.outlook.office365.com (2603:10a6:208:14::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.20 via Frontend Transport; Thu, 24 Oct 2024 15:45:59 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 52.169.0.179) smtp.mailfrom=stackit.cloud; dkim=pass (signature was verified) header.d=stackit.cloud;dmarc=pass action=none header.from=stackit.cloud; Received-SPF: Fail (protection.outlook.com: domain of stackit.cloud does not designate 52.169.0.179 as permitted sender) receiver=protection.outlook.com; client-ip=52.169.0.179; helo=eu2.smtp.exclaimer.net; Received: from eu2.smtp.exclaimer.net (52.169.0.179) by AM3PEPF0000A798.mail.protection.outlook.com (10.167.16.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.14 via Frontend Transport; Thu, 24 Oct 2024 15:45:59 +0000 Received: from EUR02-AM0-obe.outbound.protection.outlook.com (104.47.11.236) by eu2.smtp.exclaimer.net (52.169.0.179) with Exclaimer Signature Manager ESMTP Proxy eu2.smtp.exclaimer.net (tlsversion=TLS12, tlscipher=TLS_DIFFIEHELLMAN_WITH_AES256_NONE); Thu, 24 Oct 2024 15:45:59 +0000 X-ExclaimerHostedSignatures-MessageProcessed: true X-ExclaimerProxyLatency: 5961696 X-ExclaimerImprintLatency: 1930482 X-ExclaimerImprintAction: 321ec38062fe4ab0aa068292ef5299f9 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Y6eqt+hhjYw76DX6YPiLICmFSwmkObVqXIlZ4egwMmyK/J7krpn3up8RU5rAThqZXNhoKUmwAqpSJ1Q5bUSfiT2kdRRny6iTd+dH+smUt0ubwZDcMoACnrblWCZ9T6Z6smyzYV6m1TlSKdqaZ8jceXQSo13YtLIzecx7WtagpKzceB39uTwJ/PKhxsJMVuQOGyVlDRVrvUBblgnoix6m/dlL0yJDDhKLlEpq4Fm4XZAbCkHQLUf59TWTwN/te3Se+4zkqe0idEk8+KUP+7kArlUyOAMOCwz33US6WqrcHHC1UUuzE4OjCm/AashkOdoONvLCJ5YvfMuSU4Lff2aDxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=GzPWrjhquOHC03VQ8I5pJfSQ3ieaXhARuN1rnHTmcdI=; b=CQ0N1a7l/q98rJIHJS6CeH165tdRRnVizDeMzSy9Otyluvr6NMe02HOEL7UdKSQ6hs3EujFQiz8i8nV+yuctwVkvk/6UWwuGqLwnR72Nqn8FEqmkZ3igrd4wKD1hUfI2k5uGQXET3efgXumovkFE76js6tkrnFc1PILlJyChXV9gwsIBMI1wjryPx1ISCeRePB3yyHvIy2annrYa65FEfr3TbQWuJ+fbagMrPDT9KgqYV9iLoVLAXfB10i5m5BXcRxnsdSCXeS1deml1VWWFgG7LmhNGjXiXi5eZTdtEX3XgFTMWiXmPMa1kYIL1/TlB95t2OCWPMoNyLc4Laok7qw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=stackit.cloud; dmarc=pass action=none header.from=stackit.cloud; dkim=pass header.d=stackit.cloud; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=stackit.cloud; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GzPWrjhquOHC03VQ8I5pJfSQ3ieaXhARuN1rnHTmcdI=; b=gT9n+yHdJAyuBTNLLDPGn9NCnn1ZgNFdDuhWoiJqNf6uHfg4RIGN34cogp7PpQGUfUh8khAb613+a9d8XchoYQ1p4WY+mytF/SkcG7zMpFdgDOlTBO3kJgrNdBcsazd9RPNSQWZefFcixiH9tc1mMyJLXwjOmAOE91ZphcS4h4VKcyIq1GK0tXFqmPol54uTpdDglfEEJ2TwgU9QxgElV5Y9MR10FApEsJJBM2pq6K2VeByfY+TDLfDY+yT1xhAdlFhtrJjzehq1lCv6wjHxTQ0n3j0/vjvKuOHsRf9pMw4es1dU1Jrc7ZXRCGi3iAosfkxLh90bRqCAV1+a6QJ75g== Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=stackit.cloud; Received: from DB4PR10MB6917.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:3ff::16) by GV2PR10MB6574.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:150:b5::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.14; Thu, 24 Oct 2024 15:45:58 +0000 Received: from DB4PR10MB6917.EURPRD10.PROD.OUTLOOK.COM ([fe80::b865:87a6:68fa:764e]) by DB4PR10MB6917.EURPRD10.PROD.OUTLOOK.COM ([fe80::b865:87a6:68fa:764e%5]) with mapi id 15.20.8093.014; Thu, 24 Oct 2024 15:45:58 +0000 Date: Thu, 24 Oct 2024 17:45:56 +0200 To: dev@openvswitch.org Message-ID: <4234e450c911bd2f4337bcf07c8145cdeb057a36.1729784574.git.felix.huettner@stackit.cloud> Mail-Followup-To: dev@openvswitch.org References: Content-Disposition: inline In-Reply-To: X-please-dont-add-a-signature: thanks X-ClientProxiedBy: FR3P281CA0114.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a3::6) To DB4PR10MB6917.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:3ff::16) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: DB4PR10MB6917:EE_|GV2PR10MB6574:EE_|AM3PEPF0000A798:EE_|AS1PR10MB5697:EE_ X-MS-Office365-Filtering-Correlation-Id: ad84695a-26d5-4697-7557-08dcf442f53a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0;ARA:13230040|376014|366016|1800799024; X-Microsoft-Antispam-Message-Info-Original: WMT054cn2/klhvYgILl2QbNWouOFaiqZ/yZGIJ0V4+GFyGFfIbE7O4BsCG0tvruJUnIMj1JjZ9WJShOKkS+3RZjubZfSDN9RWC5udhLbZ/QT/PT4cNs08/Wx1XFj5pBY44uYhrhTTsxBNMuAfi25xpm2gRLmi70AKrLsvIK844dm+eHG9BDo8TOvfzJOV9z3mbkXr+Q8G4WHXO4V1pWmw5nM3DRFPUgSPyURBuzBKAljn0C6oFKKchuayxN9k7xgcunUyioaeqVvukrWKVT43RcxR+krkYapV85nfZFDggKa3KzPm7nmB3zMHSLg2fA+03oFWh0yQ6ea3/REgzd/oiiYSKCywrlYcNNMBD97QSpoOQMiedLErmohtc8jnNy2w4RYPXYnb7S0MaFrZhfwusTVJLPuOUMSql4Tg/ik+md74Bw0EJis1+syS6scZgjxFcwtAOlJrVX3GkdUzm8mZJXiuKok5F4FfWUE4o1kcU528fv6QfjN7UM3vNd7Dko6Y9k0zBU0XRtFrKtXDKPpJy3V7sUi5r1cHtPfOvzNpIm/Aoeu9qRAuTxWzqOWiG2T0TBb9L3kObYzdBCNc2WGaavvElFAuYRAfesaWKLfcpzBv4FZHit0kt16BIq2UP+9U4IkNREWtM8q3sNrxmoux2vO/flsBK8F6WG+0yenv1hcql2iq0zEs7gpfI8eWtL94+hCIf/SOOukBcYOdvXg6aOVXuvY4JeO/+A2Bv+2Usw1sMjFYoWcpjSVh7QQpR3RxwwmrkvwTUifJJqmx875QZrKu7T8eQCSy+2On1yi2zpRGqghcHUM/Oq5Iedaa/80TPwEFuXf3QE0qYms8VqidxMIqEE9QTNPKmtrVByog7uXsTLykaJyMhgDXOm39ijh3cPq2hW31qbdv8ie/pMIK7NutC76A64mNtF2GzA9V8GoeI5wp2L/BFLchWwMdXAOZ2+Ypv55Q1VbNSn/+CYBKombYrsIxKZl6ZT78Wr1z5SI1x9SRje/HWv9urFFUFetmT1d01WXL3xzuSbAKnzcG/NB8fgpHx6k8x3zqEeC/0jpNm6fzTsJ18Sv9isgF0Ccium6aIAvGaHaqlmOQ/8hHJWkedXaOTG+QAw8H8C0Ej4BEFQrrxYWoGTzeWkAYxMUfaZHXu6ie9QZInKQ/+80ORxwXHvMO+UDdhzkk0pJM1qaFsUsCsTCR44aWDxJ/KGGw49LQH6MhbIKgIsz7GKcO6SL/cSkqZ072daG9nPJSp0P1/RbZTFw3Jb3RFVzeop6t72pv8wpONe9ugPQtz/+WrqTxEDm36LPUWAqhta1hnrJeZoC59xq5zaeOuHMJxkM X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB4PR10MB6917.EURPRD10.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230040)(376014)(366016)(1800799024); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR10MB6574 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM3PEPF0000A798.eurprd04.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: c52f7cbd-6efd-4e78-7628-08dcf442f410 X-Microsoft-Antispam: BCL:0; ARA:13230040|35042699022|82310400026|376014|1800799024|36860700013; X-Microsoft-Antispam-Message-Info: NSO9q7e2srwi22mqtP/sqonr7pgc4LMiZVfFWiB77uZbgMt234eAJW3kOSk87YTTT3Hf4kI2puShej/hbHyxN1Biuu+3J7mwvpY359yaGOEvXFg5nHFcZB/Xf3iVsFpHJNMb+JuBF/jTMJ66eKUNxKruoa9wZ/QcuALCHIVOif/E7AIE/mMEBEPl/kWYRJWgB3d2LJrYbPAQt/SuzwMMXkujjJ8XvL39IBn1y1WIpdjN6HmXDVLPUIwVKyNaG8128ZARtSxj3wG/BWS2I6cAsc+HpCKj/Jx9fmDV/6x8Z359X0sp2xvrp3MRDuI1lcLCgSTST8b8QgHPrkkTf5B8qq7MkZ5CDcVcxp19PDlP29Ew3OLa2KchojvP90oCH9sLTNnE7FLeg5AnSAQ8CJeJlS622Vc2/e/G2gtkGq5hVa6VRURen+d9GFnd1jN5aCds9csa6PAwwav85ei3vCb4lUHZiP+kurvBSURVj7OxvwrI/yUwOVcO6KdDHPWh7rhdIlZfpiH75KzBnF453bgSgVjW8HnyzD8c3GIgKQLNOkxJDWgBqSqPPq3yPlTDCNsFVz6JccxXWNsbQuy8N2rNwQB9Af4wnc0ilJPDVqqW0EGM7rdf63E7ni2Xg7fPuIGSQBa+hgu9N2LhwqrWhTNgXIq+85KuWRS7QZlMhSJneFH87UVJfRrhvHuZjiErVU0igmQl23feHnJlB3o4A0fJGHwSfokjUNSmPeGKv7cJtPy1dHCJfe52tKAUIilULF9ygLcIExwm2JR6MzbbrVOpWgsYG0LJPWI2qiuZnGlQKQwOQ38Ff/ygRSCX3u3IoBMgozp37ppZmbWfC4su9hOZR8pqLx1/eWBwvK9uX6mcxdqsp2EpUb+X5E6XGBl7GdPkD6UF2Pqt+urYV8VTelsuws0CwoxtQf5QX5k+vhNcc9/GaV7leFEeo5Be6yJuRtEYUW6hKVIACgVBWLjpzH6Ph/j98Rslq7sQFmuF/UwLf16pgQ7DnLabudhdcQInyyByclSIJsyg8N8sn4dy6l8yrvydpSxmSAIiPLVdNVnxB3SFAvpQ0nwvXCmWf19RQr39meJIiQfFKKntx2R1d0GTmjV1aUj9mATM2HMWJdUSUGRpnszLplU+0FUtyvRuf0cNxz0+Np/KBIvTThYx9J9QeB6LuY+hGhsEAAnIZAXk1v3yv1ZUTWy/PoLUeCO4auBknfnsQK2GaCRBCQBlucFXxzxKxzXh3z8EKzRNYi1aKH5T+UiNl9ODScpIvNksQYBS0RRDXTnyrPupaF9wCeYAgDTuNV0PdHyOVUaUx69sF9aOLkfCF+kpjujkVpVqhHlBcjfCbX8a8cArAR5Oj2X2uE3wYA0oxlEyrNdILcD82PDC52zy/UPChmq4sMAGNXLOWzIGXaFfEktyp5SWArtgcA== X-Forefront-Antispam-Report: CIP:52.169.0.179; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:eu2.smtp.exclaimer.net; PTR:eu2.smtp.exclaimer.net; CAT:NONE; SFS:(13230040)(35042699022)(82310400026)(376014)(1800799024)(36860700013); DIR:OUT; SFP:1101; X-OriginatorOrg: stackit.cloud X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Oct 2024 15:45:59.6379 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ad84695a-26d5-4697-7557-08dcf442f53a X-MS-Exchange-CrossTenant-Id: d04f4717-5a6e-4b98-b3f9-6918e0385f4c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=d04f4717-5a6e-4b98-b3f9-6918e0385f4c; Ip=[52.169.0.179]; Helo=[eu2.smtp.exclaimer.net] X-MS-Exchange-CrossTenant-AuthSource: AM3PEPF0000A798.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS1PR10MB5697 Subject: [ovs-dev] [PATCH v1 2/6] netlink-notifier: Support network namespaces. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Felix Huettner via dev From: Felix Huettner Reply-To: Felix Huettner Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" extend network namespace support also to the netlink-notifier. This is needed on the OVN side for watching routes. Signed-off-by: Felix Huettner --- lib/netlink-notifier.c | 10 ++++++++-- lib/netlink-notifier.h | 3 ++- lib/netlink-socket.c | 2 +- lib/netlink-socket.h | 1 + lib/route-table.c | 3 ++- lib/rtnetlink.c | 2 +- tests/test-netlink-conntrack.c | 2 +- 7 files changed, 16 insertions(+), 7 deletions(-) diff --git a/lib/netlink-notifier.c b/lib/netlink-notifier.c index 7ea5a4181..3089f81c6 100644 --- a/lib/netlink-notifier.c +++ b/lib/netlink-notifier.c @@ -38,6 +38,7 @@ struct nln { bool has_run; /* Guard for run and wait functions. */ /* Passed in by nln_create(). */ + char *netns; /* The network namespace. */ int protocol; /* Protocol passed to nl_sock_create(). */ nln_parse_func *parse; /* Message parsing function. */ void *change; /* Change passed to parse. */ @@ -58,12 +59,16 @@ struct nln_notifier { * Incoming messages will be parsed with 'parse' which will be passed 'change' * as an argument. */ struct nln * -nln_create(int protocol, nln_parse_func *parse, void *change) +nln_create(const char *netns, int protocol, nln_parse_func *parse, + void *change) { struct nln *nln; nln = xzalloc(sizeof *nln); nln->notify_sock = NULL; + if (netns) { + nln->netns = xstrdup(netns); + } nln->protocol = protocol; nln->parse = parse; nln->change = change; @@ -84,6 +89,7 @@ nln_destroy(struct nln *nln) if (nln) { ovs_assert(ovs_list_is_empty(&nln->all_notifiers)); nl_sock_destroy(nln->notify_sock); + free(nln->netns); free(nln); } } @@ -106,7 +112,7 @@ nln_notifier_create(struct nln *nln, int multicast_group, nln_notify_func *cb, if (!nln->notify_sock) { struct nl_sock *sock; - error = nl_sock_create(nln->protocol, &sock); + error = nl_sock_ns_create(nln->netns, nln->protocol, &sock); if (error) { VLOG_WARN("could not create netlink socket: %s", ovs_strerror(error)); diff --git a/lib/netlink-notifier.h b/lib/netlink-notifier.h index dd0c183de..913883bab 100644 --- a/lib/netlink-notifier.h +++ b/lib/netlink-notifier.h @@ -41,7 +41,8 @@ typedef void nln_notify_func(const void *change, void *aux); */ typedef int nln_parse_func(struct ofpbuf *buf, void *change); -struct nln *nln_create(int protocol, nln_parse_func *, void *change); +struct nln *nln_create(const char *netns, int protocol, + nln_parse_func *, void *change); void nln_destroy(struct nln *); struct nln_notifier *nln_notifier_create(struct nln *, int multicast_group, nln_notify_func *, void *aux); diff --git a/lib/netlink-socket.c b/lib/netlink-socket.c index 801b4badd..f08473f40 100644 --- a/lib/netlink-socket.c +++ b/lib/netlink-socket.c @@ -1742,7 +1742,7 @@ static struct ovs_mutex pool_mutex = OVS_MUTEX_INITIALIZER; static struct shash pools OVS_GUARDED_BY(pool_mutex) = SHASH_INITIALIZER(&pools); -static int +int nl_sock_ns_create(const char *netns, int protocol, struct nl_sock **sockp) { int ret, ns_fd, ns_default_fd, err; if (netns) { diff --git a/lib/netlink-socket.h b/lib/netlink-socket.h index e4d645a62..7e5be14ef 100644 --- a/lib/netlink-socket.h +++ b/lib/netlink-socket.h @@ -255,6 +255,7 @@ int nl_transact(const char *netns, int protocol, const struct ofpbuf *request, struct ofpbuf **replyp); void nl_transact_multiple(const char *netns, int protocol, struct nl_transaction **, size_t n); +int nl_sock_ns_create(const char *netns, int protocol, struct nl_sock **sockp); /* Table dumping. */ #define NL_DUMP_BUFSIZE 4096 diff --git a/lib/route-table.c b/lib/route-table.c index d5d98585e..de573634d 100644 --- a/lib/route-table.c +++ b/lib/route-table.c @@ -110,7 +110,8 @@ route_table_init(void) ovs_assert(!route6_notifier); ovs_router_init(); - nln = nln_create(NETLINK_ROUTE, route_table_parse, &rtmsg); + nln = nln_create(NULL, NETLINK_ROUTE, + route_table_parse, &rtmsg); route_notifier = nln_notifier_create(nln, RTNLGRP_IPV4_ROUTE, diff --git a/lib/rtnetlink.c b/lib/rtnetlink.c index 37078d00e..9c8d4df8a 100644 --- a/lib/rtnetlink.c +++ b/lib/rtnetlink.c @@ -210,7 +210,7 @@ struct nln_notifier * rtnetlink_notifier_create(rtnetlink_notify_func *cb, void *aux) { if (!nln) { - nln = nln_create(NETLINK_ROUTE, rtnetlink_parse_cb, &rtn_change); + nln = nln_create(NULL, NETLINK_ROUTE, rtnetlink_parse_cb, &rtn_change); } return nln_notifier_create(nln, RTNLGRP_LINK, (nln_notify_func *) cb, aux); diff --git a/tests/test-netlink-conntrack.c b/tests/test-netlink-conntrack.c index 2a62615b2..2f8962a02 100644 --- a/tests/test-netlink-conntrack.c +++ b/tests/test-netlink-conntrack.c @@ -80,7 +80,7 @@ test_nl_ct_monitor(struct ovs_cmdl_context *ctx OVS_UNUSED) unsigned i; - nln = nln_create(NETLINK_NETFILTER, event_parse, &change); + nln = nln_create(NULL, NETLINK_NETFILTER, event_parse, &change); for (i = 0; i < ARRAY_SIZE(groups); i++) { notifiers[i] = nln_notifier_create(nln, groups[i], event_print, NULL); From patchwork Thu Oct 24 15:46:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felix Huettner X-Patchwork-Id: 2001810 X-Patchwork-Delegate: echaudro@redhat.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=stackit.cloud header.i=@stackit.cloud header.a=rsa-sha256 header.s=selector1 header.b=J6kIrEjg; dkim=fail reason="signature verification failed" (2048-bit key) header.d=stackit.cloud header.i=@stackit.cloud header.a=rsa-sha256 header.s=selector1 header.b=J6kIrEjg; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XZ9J05F2Fz1xwy for ; Fri, 25 Oct 2024 02:46:24 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 17E1C4018C; Thu, 24 Oct 2024 15:46:21 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 5yIW9MkHmd-V; Thu, 24 Oct 2024 15:46:19 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=2605:bc80:3010:104::8cd3:938; helo=lists.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 0E2284002A Authentication-Results: smtp4.osuosl.org; dkim=fail reason="signature verification failed" (2048-bit key, unprotected) header.d=stackit.cloud header.i=@stackit.cloud header.a=rsa-sha256 header.s=selector1 header.b=J6kIrEjg; dkim=fail reason="signature verification failed" (2048-bit key) header.d=stackit.cloud header.i=@stackit.cloud header.a=rsa-sha256 header.s=selector1 header.b=J6kIrEjg Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp4.osuosl.org (Postfix) with ESMTPS id 0E2284002A; Thu, 24 Oct 2024 15:46:19 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id C7B66C08A6; Thu, 24 Oct 2024 15:46:18 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 1E8EDC08A6 for ; Thu, 24 Oct 2024 15:46:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id B6304608A0 for ; Thu, 24 Oct 2024 15:46:14 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id sO5ddzAx9PKs for ; Thu, 24 Oct 2024 15:46:13 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2a01:111:f403:2612::605; helo=eur05-am6-obe.outbound.protection.outlook.com; envelope-from=felix.huettner@stackit.cloud; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp3.osuosl.org 69C10607AA Authentication-Results: smtp3.osuosl.org; dmarc=pass (p=reject dis=none) header.from=stackit.cloud DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 69C10607AA Authentication-Results: smtp3.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=stackit.cloud header.i=@stackit.cloud header.a=rsa-sha256 header.s=selector1 header.b=J6kIrEjg; dkim=pass (2048-bit key) header.d=stackit.cloud header.i=@stackit.cloud header.a=rsa-sha256 header.s=selector1 header.b=J6kIrEjg Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on20605.outbound.protection.outlook.com [IPv6:2a01:111:f403:2612::605]) by smtp3.osuosl.org (Postfix) with ESMTPS id 69C10607AA for ; Thu, 24 Oct 2024 15:46:13 +0000 (UTC) ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=jZX82hAe25rLvEtVET6l3ffoiYiLZs57diDRxdVS1xZhfFJzNCWcYQJHla8tHoStJteCY6rlbYaaUpdZ7jDULMMC069O+Gi2zPAXLcwgVes3spKheAd1YM87xyv6Q+7LQJqoD/z4O71JjPsgaWCQjWg5UJifO4InrqoUDbKiZGOfhrFWGSQ4yuYSmncXqx0NfdNc6wCev/chnkyeiBUytyzkUGvdrHSct5XLo8iJIRJcRRzejweqxw5KRy9fujibsRPu4kUOV3nwmaRJUINPn6WW9BpDjmxvJmdDN7GPGGBVB8k339mSk1mLXkMSYAGudxLUQB4yu/qeTEv9w502gw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=md9ZZeLm5keoZXeZx36Lv+lQ/HGFQ+H7yDwJr7VEUPI=; b=GgOB3dUC8+O/h9HhwpaE3rpulNQ9JPnd8Y9Ub9fnuW5wrgApallnl7PQFqtSszC+hrsInBGY+709Ug6cULRq3BZMxhM4TBulTGQPfa2eHLW/vGwijhBukAbJ4HeJaRapQ8DgqXrrdGmVYEkRAUh78tNx1nG318TcpvSpObHMxb++nYYI+dUsfxQ4Figf+fCtIbW02ZXOntDctU9hFXMyoPBdtbaeVdfrM7VGwXxdTfg+Cdda7D53rRZtZjvD+YmSvPInbgjUelzMS0iO+QGmTesefHPhw0S6IjsJi7i3QYNW4T0oTSJOWkdqYgkZXmPe0BdWZdJgryCrOjYTXgbm1g== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=fail (sender ip is 104.40.229.156) smtp.rcpttodomain=openvswitch.org smtp.mailfrom=stackit.cloud; dmarc=pass (p=reject sp=none pct=100) action=none header.from=stackit.cloud; dkim=pass (signature was verified) header.d=stackit.cloud; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=stackit.cloud] dkim=[1,1,header.d=stackit.cloud] dmarc=[1,1,header.from=stackit.cloud]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=stackit.cloud; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=md9ZZeLm5keoZXeZx36Lv+lQ/HGFQ+H7yDwJr7VEUPI=; b=J6kIrEjgQeIDIwRA3pv1EdJnWnXXuY3V+Yq7NAfp0M37WOrBD9LDumtBUgu001nhCIFph/mtCOkYvMhJRKfihtpCuuEK4LRW7PPH9kfhElgMHPPfdOxg0RHvPEnyKtkkcq6eHbsJNKass4Z7ip0UJXYbzivdbzD0xXXaohqny4CmTluQVFQK3IaU/OJeSgstr7S8Jpq8KITqGZMK1F8bx4aJQpo9eRetdghOu3Bu05DtOJMyPxJT05nf/gtSC+zYbIXKx29qTGv0HUFOc19EIqwoK1i+EXocO1/s/lD0oivTfna3ke+yIkru3jtx+I1WwD8nlSZnoK8UMARexzndHQ== Received: from DBBPR09CA0025.eurprd09.prod.outlook.com (2603:10a6:10:d4::13) by GV2PR10MB6306.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:150:74::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.15; Thu, 24 Oct 2024 15:46:09 +0000 Received: from DB5PEPF00014B9F.eurprd02.prod.outlook.com (2603:10a6:10:d4:cafe::76) by DBBPR09CA0025.outlook.office365.com (2603:10a6:10:d4::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.17 via Frontend Transport; Thu, 24 Oct 2024 15:46:09 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 104.40.229.156) smtp.mailfrom=stackit.cloud; dkim=pass (signature was verified) header.d=stackit.cloud;dmarc=pass action=none header.from=stackit.cloud; Received-SPF: Fail (protection.outlook.com: domain of stackit.cloud does not designate 104.40.229.156 as permitted sender) receiver=protection.outlook.com; client-ip=104.40.229.156; helo=eu1.smtp.exclaimer.net; Received: from eu1.smtp.exclaimer.net (104.40.229.156) by DB5PEPF00014B9F.mail.protection.outlook.com (10.167.8.169) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.14 via Frontend Transport; Thu, 24 Oct 2024 15:46:08 +0000 Received: from EUR02-VI1-obe.outbound.protection.outlook.com (104.47.11.43) by eu1.smtp.exclaimer.net (104.40.229.156) with Exclaimer Signature Manager ESMTP Proxy eu1.smtp.exclaimer.net (tlsversion=TLS12, tlscipher=TLS_DIFFIEHELLMAN_WITH_AES256_NONE); Thu, 24 Oct 2024 15:46:09 +0000 X-ExclaimerHostedSignatures-MessageProcessed: true X-ExclaimerProxyLatency: 5112026 X-ExclaimerImprintLatency: 1844367 X-ExclaimerImprintAction: 9f0a67503a4e4980b4f1dd646cdf161c ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=pkursCeFu+2PoQ7yKDjrp8QvoDKGpRbzTQ645A1VUr677mCte1iP1GuYGUKqswDGX2yqObllguYfRrZXCBKYqf1654NfH6xx1Q2AhC2DLQHnbTU631XX3uWjBxWeKUTxuvuJQDUvlXyDSo4cXRo0beGJYhLpWUqWWLglSX/BGK07HkRuzlKv5hoI7rMwTLUA0ak1mon8E+xPMcT6vyDiG2Jjg7g3rDOIpBStvSrU6Snf82I6Nzs1be3uP0d1tmUQae27Erllm0KfGJTyqUVOK3qs/bOTyyeXOfhr131UjBky/ErrNXVvZEi0euCmrsPHfUAE9RqzJr3bHl+NzjxsUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=md9ZZeLm5keoZXeZx36Lv+lQ/HGFQ+H7yDwJr7VEUPI=; b=DXNO5qNiNUeDd+4yyAhsnX9VmKJH4yCRZSqJQ1K2fzs8Wusc++uQPc7n2qzcjad4Y22zdtsDH4m3ojIlass4tsU2W6hlwyjAVz8D+RfL/+8o/LyC7U46uOsm+koz7BL9YjVHGSnvB7qIbVI8yzS3b/V7n3fDNvRElvIY4VtI00qn84jawv/YghCO4L5VvdIKf0KMKHeQ0RZDrW6WQ2KpTDexvegf3UjPzNjS6n7FqHW9uElkkIMbLPsZNqPq9W6AZ5/ifTsJXRc0q+x9oflNQ4jHWz6oNwd+MlrYZ/AMkmz3j+ZH/02zgYdZKw9CCggR7x0TTXQGFpirOnJS+O/5Qw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=stackit.cloud; dmarc=pass action=none header.from=stackit.cloud; dkim=pass header.d=stackit.cloud; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=stackit.cloud; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=md9ZZeLm5keoZXeZx36Lv+lQ/HGFQ+H7yDwJr7VEUPI=; b=J6kIrEjgQeIDIwRA3pv1EdJnWnXXuY3V+Yq7NAfp0M37WOrBD9LDumtBUgu001nhCIFph/mtCOkYvMhJRKfihtpCuuEK4LRW7PPH9kfhElgMHPPfdOxg0RHvPEnyKtkkcq6eHbsJNKass4Z7ip0UJXYbzivdbzD0xXXaohqny4CmTluQVFQK3IaU/OJeSgstr7S8Jpq8KITqGZMK1F8bx4aJQpo9eRetdghOu3Bu05DtOJMyPxJT05nf/gtSC+zYbIXKx29qTGv0HUFOc19EIqwoK1i+EXocO1/s/lD0oivTfna3ke+yIkru3jtx+I1WwD8nlSZnoK8UMARexzndHQ== Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=stackit.cloud; Received: from DB4PR10MB6917.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:3ff::16) by GV1PR10MB7597.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:150:87::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.15; Thu, 24 Oct 2024 15:46:07 +0000 Received: from DB4PR10MB6917.EURPRD10.PROD.OUTLOOK.COM ([fe80::b865:87a6:68fa:764e]) by DB4PR10MB6917.EURPRD10.PROD.OUTLOOK.COM ([fe80::b865:87a6:68fa:764e%5]) with mapi id 15.20.8093.014; Thu, 24 Oct 2024 15:46:06 +0000 Date: Thu, 24 Oct 2024 17:46:05 +0200 To: dev@openvswitch.org Message-ID: Mail-Followup-To: dev@openvswitch.org References: Content-Disposition: inline In-Reply-To: X-please-dont-add-a-signature: thanks X-ClientProxiedBy: FR3P281CA0114.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a3::6) To DB4PR10MB6917.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:3ff::16) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: DB4PR10MB6917:EE_|GV1PR10MB7597:EE_|DB5PEPF00014B9F:EE_|GV2PR10MB6306:EE_ X-MS-Office365-Filtering-Correlation-Id: 147273f0-19f7-497a-0cd6-08dcf442fab7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0;ARA:13230040|376014|1800799024|366016; X-Microsoft-Antispam-Message-Info-Original: iPlch4P3rUYkRsgZEPg17XMR5Lxq/Jr1MxrkSm4ZDLL0r/B8CttLDzOnVYRxccknWePbdAs5bRi49slaCodZfIk9R6quzcwhMoxc3NkTZ3EVNn3BbXmmm6XYy058+ZVXsB3HWGD1AQI08helL3lUsR4KrY5PkZ6n1fzkhT8F9qCIH9XVsKAahZtn4Ai8kpDwy4YBKdJ7FKN4y2TtTAAyVIyDRTaepX2RCreWkHNuZ60i536b4Y54vLj5/9T0QYyUy/OTHLQgD+JGe4i7YRb8wBEPKhkZx40ndSECfk2q8X21kb6eVlwzvWMP86KYUdC1gP3LDOpuaoXhhpfW938BPp2iormeZ1ruHRHTfMWtnmhIfucvTmvCuY1O1/Sn/tHXxpL6oBEA3G15ktL9D0XLL5i1v87OgqR8+Hw8qAjToZ0ZWTlMOh2gYgfB0eX3zxP40BtiO5CXjsEXjrQEVZ+Ra51IaCElQXKYUBJ2l+Hax6MYOFMs+86eisAU00gR7Yct4niXuD/x/5QQHYxaaeymvYpJuBXu7bH8L8PvvO+PYxY/vU7zSlYBN3QSvS/9sWC2UG4QqnF1Oife2WyZq7AyUdfwuTwmFZZmR3LMmXwY9/JVyKZbu1JImXNI1lv2nKbVjujHIOYLt9Te+TneMLLFuRETAr3oTh9vvRtAC4pcJWSimh6jkeovJ2SRQRywVcV2tC3hMMC1PbY3QlnSXp3keXhThnDtJfK0WwGnak34VdfWXvJmpAscNset7wgn3sXsOaIpuJdoHJ1Kx6qYX2BGbp6/bDayoliutATUQW7kzZ/xcflsN7ABUmf8FS2QML0D6gmBy6VWLOzRWLEhT97Trd/fPxd7YZcskvTfdAH/pEkzP3exmNo+1D8lCsDzrD7UPQ8rbRaqCdmvGxY3GPSaKu+w/SYQEDVQDt3cvwgctWC8OWCroun9Zc3mNRiG2ny1tsvkrYjj2FkIwBcjWqz+bqfBQeS124NSvGfpxV/Tjz7FxhbHFkCPTGBj4RqLDu9APdR+2L3xRZ9v94Vsdt8K7O/kNTVzlsAbJAR+AVTTmKGQqHCjW4vPLTwfHk6QaxswlZuMCT/sf+jugsa4HfYe5xqhfMuNQ2SPUE/1eFW7Cd35eTGJ/xPD0xCX4DKZYwX7HeQcIsVIJiuedf0cnp9kNbc+oy6Yc0OZ+drbGtr+H6uIaEY02Dj1zDSMQqz4c+aiouxU6JZvrSxK/PlPe1i7wxcHvjfjQf6MCPXGWm11daHFNaLbWwB23O5sWHBt0apF2VgVaC1kOcy2utF7nR/w2OVPif2bOkmuVlxwFrvo1GVztSrYsR8BgpMHSNVEFgwP X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB4PR10MB6917.EURPRD10.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230040)(376014)(1800799024)(366016); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR10MB7597 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5PEPF00014B9F.eurprd02.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 22aa2fee-0b18-4512-5320-08dcf442f94d X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|36860700013|1800799024|82310400026|35042699022; X-Microsoft-Antispam-Message-Info: aWtx/BZaOYTjQD2zXyA2ylgcmEhzPYUcFeSow1BVcP9i+B8K5odv1M8OEYMoWDkxBBwFJ+DONxQio++BnfN9iOs0W9Dwr2Nb/QLy50OVErx5aFfi9t+Rct6IagMfO883buPcCQcYCNSnSwQxJMuj0UDCCHcCYWcIdXWJ+XBAEuTjB6+60UBTiaiXu3Lg00FLW9/1K1a1AkTGTLKKZz81yWWS6/ujeK8u1mvolUjtTuyx6HtL5c04Y6f4ww9CjW6bEHpFUTNk2XtVkSdDW/K9ifagA/8As5rCtlpLMI5RmG9ICOoQ+4K5d9ZlxyrcV25nzTWtPSXQGtEOs/bKtA4pogPJtA0UfCKqfCkvRwHit9I2mMoN3bZPZvFUh8omS/NrYMwqA+uwfgpwjY4EttYNcRSmdyOPk+/Ib0as3Vj166SFgf9BmopmPBvTxzieAUzutGEh4UgE8DLJkEbhHCq6IbSTMWvI7y7ET56QdSjLOxFDbtZ/dkDDHJtCDJizcr3380OEW/p95AjCK7LpflNT8N1QLqxZAgD6N92bmzmsO/t1K9GxVHFpO+oXEGC5MxNJPau3hXxlcaQH4mglW2Olg/s4xgj098emZLlOdd8qoMeYj3f4B4+sc+PJABPChBrZCi2dQHqt4qUpCZL7vNzt0+DHivfvOwV4oiTk8c6rc1321vgVgB9D9cuEfU/50nD1r/uPCw1ceXO+yemBrwWVBnplwbYVP2nyV91Q9pYgPzT/dRDSEO/1mUs/baQnD6+wrNQtqxP9dGu5v3LtIeY+ptneXHZkzbi0WCgtePNn6+NTXEnIZF3WeBYZGbDGLkqD/xrMJ1oSQFgpchS5IvRJ6jAgIkLCat7imy35Iflk+iM7zccxAmz+zUGzXT1kHdZuzOTf9+BNYO7Tx6gOjwvQUcwX6SMSQJUnmuKCej9UgCPJCHNHS4J+i7kH0kgGBQjwifQXbbStgQ/qdfDIk3AB/PKWGuwOzAV5CxyWrjz8M+buuB2QFa+f+9+mqtkxxOo5R2hdnA89HQQo8ymR5gwSrQWPA8WQHUCKKHXDLcPvyUizVOSt5bucSDTGRS5LmpoD+zsvdnHMWLqE5nyB+RupkkaAXtXt2AiGAHsgBbScewDzA433za1FA7ZtX2TRsdmcmiSdxbrCn1pXvVkQL1JntxaUoTfe1BtyTD2Tkyiq237tavvgKtovyaVQzsVTXCdKqWY9Cuti7CuzoqirLXoXe3xu0QrM0maxZuUbXWN2qasAJI7Uxx37b2OKojKyVgBULJQC5WL5UaZTR1iVTpUhYdpWQr500JmV6yvC7ChWqAj4uRT89NhDdt3LMO3SboIQFeuvAY7kJpEAKDh6r/aOsaJBsj2GkDyOAqFOSqKIlz+kj0eOULWXct9rYCZfHizCMTlkL9APnlelNZE4oWhSmg== X-Forefront-Antispam-Report: CIP:104.40.229.156; CTRY:NL; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:eu1.smtp.exclaimer.net; PTR:eu1.smtp.exclaimer.net; CAT:NONE; SFS:(13230040)(376014)(36860700013)(1800799024)(82310400026)(35042699022); DIR:OUT; SFP:1101; X-OriginatorOrg: stackit.cloud X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Oct 2024 15:46:08.7961 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 147273f0-19f7-497a-0cd6-08dcf442fab7 X-MS-Exchange-CrossTenant-Id: d04f4717-5a6e-4b98-b3f9-6918e0385f4c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=d04f4717-5a6e-4b98-b3f9-6918e0385f4c; Ip=[104.40.229.156]; Helo=[eu1.smtp.exclaimer.net] X-MS-Exchange-CrossTenant-AuthSource: DB5PEPF00014B9F.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR10MB6306 Subject: [ovs-dev] [PATCH v1 3/6] route-table: Expose data to ovn. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Felix Huettner via dev From: Felix Huettner Reply-To: Felix Huettner Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" previously the data generated in route-table was not exposed to ovn. This is now changed and we expose a few additional fields we get from the kernel. Signed-off-by: Felix Huettner --- lib/route-table.c | 55 ++++++++++++++++++++++------------------------- lib/route-table.h | 31 ++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 29 deletions(-) diff --git a/lib/route-table.c b/lib/route-table.c index de573634d..918e86472 100644 --- a/lib/route-table.c +++ b/lib/route-table.c @@ -47,27 +47,6 @@ VLOG_DEFINE_THIS_MODULE(route_table); COVERAGE_DEFINE(route_table_dump); -struct route_data { - /* Copied from struct rtmsg. */ - unsigned char rtm_dst_len; - bool local; - - /* Extracted from Netlink attributes. */ - struct in6_addr rta_dst; /* 0 if missing. */ - struct in6_addr rta_prefsrc; /* 0 if missing. */ - struct in6_addr rta_gw; - char ifname[IFNAMSIZ]; /* Interface name. */ - uint32_t mark; -}; - -/* A digested version of a route message sent down by the kernel to indicate - * that a route has changed. */ -struct route_table_msg { - bool relevant; /* Should this message be processed? */ - int nlmsg_type; /* e.g. RTM_NEWROUTE, RTM_DELROUTE. */ - struct route_data rd; /* Data parsed from this message. */ -}; - static struct ovs_mutex route_table_mutex = OVS_MUTEX_INITIALIZER; static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 20); @@ -84,7 +63,8 @@ static struct nln_notifier *name_notifier = NULL; static bool route_table_valid = false; static void route_table_reset(void); -static void route_table_handle_msg(const struct route_table_msg *); +static void route_table_handle_msg(const struct route_table_msg *, + void *); static int route_table_parse(struct ofpbuf *, void *change); static void route_table_change(const struct route_table_msg *, void *); static void route_map_clear(void); @@ -156,8 +136,12 @@ route_table_wait(void) ovs_mutex_unlock(&route_table_mutex); } -static bool -route_table_dump_one_table(const char *netns, unsigned char id) +bool +route_table_dump_one_table( + char *netns, + unsigned char id, + void (*handle_msg)(const struct route_table_msg *, void *), + void *data) { uint64_t reply_stub[NL_DUMP_BUFSIZE / 8]; struct ofpbuf request, reply, buf; @@ -171,7 +155,9 @@ route_table_dump_one_table(const char *netns, unsigned char id) rq_msg = ofpbuf_put_zeros(&request, sizeof *rq_msg); rq_msg->rtm_family = AF_UNSPEC; - rq_msg->rtm_table = id; + rq_msg->rtm_table = RT_TABLE_UNSPEC; + + nl_msg_put_u32(&request, RTA_TABLE, id); nl_dump_start(netns, &dump, NETLINK_ROUTE, &request); ofpbuf_uninit(&request); @@ -187,7 +173,7 @@ route_table_dump_one_table(const char *netns, unsigned char id) if (!(nlmsghdr->nlmsg_flags & NLM_F_DUMP_FILTERED)) { filtered = false; } - route_table_handle_msg(&msg); + (*handle_msg)(&msg, data); } } ofpbuf_uninit(&buf); @@ -213,7 +199,9 @@ route_table_reset(void) COVERAGE_INC(route_table_dump); for (size_t i = 0; i < ARRAY_SIZE(tables); i++) { - if (!route_table_dump_one_table(NULL, tables[i])) { + if (!route_table_dump_one_table(NULL, tables[i], + route_table_handle_msg, + NULL)) { /* Got unfiltered reply, no need to dump further. */ break; } @@ -235,6 +223,7 @@ route_table_parse(struct ofpbuf *buf, void *change_) [RTA_MARK] = { .type = NL_A_U32, .optional = true }, [RTA_PREFSRC] = { .type = NL_A_U32, .optional = true }, [RTA_TABLE] = { .type = NL_A_U32, .optional = true }, + [RTA_PRIORITY] = { .type = NL_A_U32, .optional = true }, }; static const struct nl_policy policy6[] = { @@ -244,6 +233,7 @@ route_table_parse(struct ofpbuf *buf, void *change_) [RTA_GATEWAY] = { .type = NL_A_IPV6, .optional = true }, [RTA_PREFSRC] = { .type = NL_A_IPV6, .optional = true }, [RTA_TABLE] = { .type = NL_A_U32, .optional = true }, + [RTA_PRIORITY] = { .type = NL_A_U32, .optional = true }, }; struct nlattr *attrs[ARRAY_SIZE(policy)]; @@ -292,11 +282,14 @@ route_table_parse(struct ofpbuf *buf, void *change_) && table_id != RT_TABLE_MAIN && table_id != RT_TABLE_LOCAL) { change->relevant = false; - } + } + change->rd.rta_table_id = table_id; change->nlmsg_type = nlmsg->nlmsg_type; change->rd.rtm_dst_len = rtm->rtm_dst_len + (ipv4 ? 96 : 0); change->rd.local = rtm->rtm_type == RTN_LOCAL; + change->rd.plen = rtm->rtm_dst_len; + change->rd.rtm_protocol = rtm->rtm_protocol; if (attrs[RTA_OIF]) { rta_oif = nl_attr_get_u32(attrs[RTA_OIF]); @@ -346,6 +339,9 @@ route_table_parse(struct ofpbuf *buf, void *change_) if (attrs[RTA_MARK]) { change->rd.mark = nl_attr_get_u32(attrs[RTA_MARK]); } + if (attrs[RTA_PRIORITY]) { + change->rd.rta_priority = nl_attr_get_u32(attrs[RTA_PRIORITY]); + } } else { VLOG_DBG_RL(&rl, "received unparseable rtnetlink route message"); return 0; @@ -365,7 +361,8 @@ route_table_change(const struct route_table_msg *change OVS_UNUSED, } static void -route_table_handle_msg(const struct route_table_msg *change) +route_table_handle_msg(const struct route_table_msg *change, + void *data OVS_UNUSED) { if (change->relevant && change->nlmsg_type == RTM_NEWROUTE) { const struct route_data *rd = &change->rd; diff --git a/lib/route-table.h b/lib/route-table.h index 3a02d737a..4f44a8085 100644 --- a/lib/route-table.h +++ b/lib/route-table.h @@ -26,6 +26,31 @@ #include "openvswitch/types.h" +struct route_data { + /* Copied from struct rtmsg. */ + unsigned char rtm_dst_len; + bool local; + + /* Extracted from Netlink attributes. */ + struct in6_addr rta_dst; /* 0 if missing. */ + struct in6_addr rta_prefsrc; /* 0 if missing. */ + struct in6_addr rta_gw; + char ifname[IFNAMSIZ]; /* Interface name. */ + uint32_t mark; + uint32_t rta_table_id; /* 0 if missing. */ + unsigned char plen; + unsigned char rtm_protocol; + uint32_t rta_priority; +}; + +/* A digested version of a route message sent down by the kernel to indicate + * that a route has changed. */ +struct route_table_msg { + bool relevant; /* Should this message be processed? */ + int nlmsg_type; /* e.g. RTM_NEWROUTE, RTM_DELROUTE. */ + struct route_data rd; /* Data parsed from this message. */ +}; + uint64_t route_table_get_change_seq(void); void route_table_init(void); void route_table_run(void); @@ -33,4 +58,10 @@ void route_table_wait(void); bool route_table_fallback_lookup(const struct in6_addr *ip6_dst, char name[], struct in6_addr *gw6); +bool +route_table_dump_one_table( + char *netns, + unsigned char id, + void (*handle_msg)(const struct route_table_msg *, void *), + void *data); #endif /* route-table.h */ From patchwork Thu Oct 24 15:46:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felix Huettner X-Patchwork-Id: 2001811 X-Patchwork-Delegate: echaudro@redhat.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=stackit.cloud header.i=@stackit.cloud header.a=rsa-sha256 header.s=selector1 header.b=tnxdgft/; dkim=fail reason="signature verification failed" (2048-bit key) header.d=stackit.cloud header.i=@stackit.cloud header.a=rsa-sha256 header.s=selector1 header.b=tnxdgft/; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.138; helo=smtp1.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XZ9JS4ZKcz1xwy for ; Fri, 25 Oct 2024 02:46:48 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id E7AD481099; Thu, 24 Oct 2024 15:46:46 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id Z71BM4walvyM; Thu, 24 Oct 2024 15:46:45 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=2605:bc80:3010:104::8cd3:938; helo=lists.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org BB358811B8 Authentication-Results: smtp1.osuosl.org; dkim=fail reason="signature verification failed" (2048-bit key, unprotected) header.d=stackit.cloud header.i=@stackit.cloud header.a=rsa-sha256 header.s=selector1 header.b=tnxdgft/; dkim=fail reason="signature verification failed" (2048-bit key) header.d=stackit.cloud header.i=@stackit.cloud header.a=rsa-sha256 header.s=selector1 header.b=tnxdgft/ Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp1.osuosl.org (Postfix) with ESMTPS id BB358811B8; Thu, 24 Oct 2024 15:46:45 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id A42F1C08A8; Thu, 24 Oct 2024 15:46:45 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 0AA35C08A3 for ; Thu, 24 Oct 2024 15:46:45 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id E3BBD401B6 for ; Thu, 24 Oct 2024 15:46:24 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id j15H2ljUfpNz for ; Thu, 24 Oct 2024 15:46:24 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2a01:111:f403:2606::609; helo=eur02-am0-obe.outbound.protection.outlook.com; envelope-from=felix.huettner@stackit.cloud; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp4.osuosl.org 96C5C4056B Authentication-Results: smtp4.osuosl.org; dmarc=pass (p=reject dis=none) header.from=stackit.cloud DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 96C5C4056B Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=stackit.cloud header.i=@stackit.cloud header.a=rsa-sha256 header.s=selector1 header.b=tnxdgft/; dkim=pass (2048-bit key) header.d=stackit.cloud header.i=@stackit.cloud header.a=rsa-sha256 header.s=selector1 header.b=tnxdgft/ Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on20609.outbound.protection.outlook.com [IPv6:2a01:111:f403:2606::609]) by smtp4.osuosl.org (Postfix) with ESMTPS id 96C5C4056B for ; Thu, 24 Oct 2024 15:46:23 +0000 (UTC) ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=FpFWgLjAt/X8KbWCoUe5p/AFrcHpkhbOxU2jhzwF1+MgIzJg6auuCLrnCRU22x7buyUtwyzZ/O6b7k4fzZcaJOqldaWMolJMyQ2KPYbFVg+tJAuMstA8L0aCRntzWfImy6qxwKIOwlprqLSNnsexXD9kXEdAIOJ+hkLpSWQsQRXJGsd0xf/VcHiLZ05YDyuRXt38stcyxTYeU3OuLCXmB552IfNyByUj/Rnpcb3kuHe+V+qByjwnHDehv/Gg3jIpJQ3Mv1riNBgGvlCkhRYDEolFNEcUgXrfikdkKX3KoZEJgMsvkhfAvM+o7jlXG1adOmD9N9zSNswAdhY0GbStsA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=yIPqnK2wpkf9fXqD3D8GmQwI6w4HWl32dOsZa/qBbhs=; b=J6slr2GLliKvWxVJsRiH+ePUcN8YBKQ7tfzbE0LOCb/zKzNQvJoZcKVWEuQczpxRqdI4MzZoI7cfqRIzmzu30eQpLZwJzHSepPQGi+ShCeQfLlAQ87EqAmyaZPRAdxsbQ4Jctpz/+Qc4NW7hi+jBOL1L+FJYn9NlSEJrn0nhujdpnjMVgy4kSfJuPS8c+NP5GyLc6qX68XyrESzlIvDcSO47faKNl3Ytjl1/z7URxXKefiwMeRCW0hSBQljqe0qU+xrGSo5RX9FUTYlz9I4+cw17wzgmWzy9BglH7gDL8s8nEAywsX+2utkb0DygW1nBxPFQXNYaeewJXWwpl581Hw== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=fail (sender ip is 104.40.229.156) smtp.rcpttodomain=openvswitch.org smtp.mailfrom=stackit.cloud; dmarc=pass (p=reject sp=none pct=100) action=none header.from=stackit.cloud; dkim=pass (signature was verified) header.d=stackit.cloud; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=stackit.cloud] dkim=[1,1,header.d=stackit.cloud] dmarc=[1,1,header.from=stackit.cloud]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=stackit.cloud; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yIPqnK2wpkf9fXqD3D8GmQwI6w4HWl32dOsZa/qBbhs=; b=tnxdgft/oDYEqxFfHx8EZOqQMewS65u6j2Xh8k3zyIIdyBd8BHTqZLYOVZXi657P2D0DoGHwwZcQIqzKSlBNbLnVE/owfaFgHohwuN/aBoZps22Pim9sHPJLf8pPnb5bSuLdjNbCD9PhmZx+86c70Z2DyxsJLEASQ4Awd0eAsqrJ1sgNQt/m3+lBB5EEKjxjqun9hcrBpMFJc6KWaMeLsvtWqM93Q7SIxdfklFl7wsGFC/VbqgZl8QMlxU7VtDrmqHGRfNK/gjixYYZ7+hj2L4WO8Xs8HP6ksD0c6m74JPJG56vavKdflfCpQD+VTeixgeHcPCqe317IAvuCU8kDkw== Received: from DB7PR03CA0083.eurprd03.prod.outlook.com (2603:10a6:10:72::24) by GV2PR10MB6283.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:150:7b::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.14; Thu, 24 Oct 2024 15:46:19 +0000 Received: from DU2PEPF00028D0F.eurprd03.prod.outlook.com (2603:10a6:10:72:cafe::2c) by DB7PR03CA0083.outlook.office365.com (2603:10a6:10:72::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.20 via Frontend Transport; Thu, 24 Oct 2024 15:46:19 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 104.40.229.156) smtp.mailfrom=stackit.cloud; dkim=pass (signature was verified) header.d=stackit.cloud;dmarc=pass action=none header.from=stackit.cloud; Received-SPF: Fail (protection.outlook.com: domain of stackit.cloud does not designate 104.40.229.156 as permitted sender) receiver=protection.outlook.com; client-ip=104.40.229.156; helo=eu1.smtp.exclaimer.net; Received: from eu1.smtp.exclaimer.net (104.40.229.156) by DU2PEPF00028D0F.mail.protection.outlook.com (10.167.242.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.14 via Frontend Transport; Thu, 24 Oct 2024 15:46:18 +0000 Received: from EUR02-VI1-obe.outbound.protection.outlook.com (104.47.11.41) by eu1.smtp.exclaimer.net (104.40.229.156) with Exclaimer Signature Manager ESMTP Proxy eu1.smtp.exclaimer.net (tlsversion=TLS12, tlscipher=TLS_DIFFIEHELLMAN_WITH_AES256_NONE); Thu, 24 Oct 2024 15:46:18 +0000 X-ExclaimerHostedSignatures-MessageProcessed: true X-ExclaimerProxyLatency: 10391245 X-ExclaimerImprintLatency: 1510007 X-ExclaimerImprintAction: b3c01b909f8b41868d9e222b43d3d07d ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ZoO1G/JxfpgYxxhtCsXoRtEGWgBQgPAfLJUODAEbDPHZnpue31KOMGNXJoCasjewK8noK1ggCynvfWadetgDrWuQUbfgRhBg3qPV8GuhttMIzNa0+JokbwWT7gz0uwIWp68XptXSPfB723WShG8P1zQA68FoFrOe+YsN3PBjXwuo1708RHlVw2VHPc1K3tiDUc8xBHumkZH4YkX6Q425UwcQTlhUboPEePEofKnQ2P0i04hj/tPON41Kw3hHQc/XO9yW0vf1Yd5SVhy6e9WJ3iieDeH9KjUBFu2nqj8RLZuoY6/o2xWBLYn93UKXhRJmQ8ns4QspIpKaLLysm84EtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=yIPqnK2wpkf9fXqD3D8GmQwI6w4HWl32dOsZa/qBbhs=; b=qmBeCetB3E7yKy+qZlYvKqvD2hhUKP/3P6r+bnoiMkEIUdGIMAJqDJ50Y/xbxDjIBlIWdk5Ckxqk8wzohRdjTOWUqGU0ycdshKc9vAt1wUfrabPHvBNsHQhzi5nYMDRsF7nL1AdlXdTU5/hroS3LWK9tSKwTfn63LdNNdYV8RrxdaZp3dAGX/oux8CvesI9dzrcjvRDWZpmSHetH9IGrVuVHxy3neJ/9jjvC+GsG0Z7kfPS7lbOWY2N6ayV1e3TeKRGFtYkdjXQvLCfXdMSmlP4wk11MeSzkxskkAFiZTuM3bGWZZA9I//xUZyTe7aGFw/SO7cKoPv2aA2B8mazZcA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=stackit.cloud; dmarc=pass action=none header.from=stackit.cloud; dkim=pass header.d=stackit.cloud; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=stackit.cloud; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yIPqnK2wpkf9fXqD3D8GmQwI6w4HWl32dOsZa/qBbhs=; b=tnxdgft/oDYEqxFfHx8EZOqQMewS65u6j2Xh8k3zyIIdyBd8BHTqZLYOVZXi657P2D0DoGHwwZcQIqzKSlBNbLnVE/owfaFgHohwuN/aBoZps22Pim9sHPJLf8pPnb5bSuLdjNbCD9PhmZx+86c70Z2DyxsJLEASQ4Awd0eAsqrJ1sgNQt/m3+lBB5EEKjxjqun9hcrBpMFJc6KWaMeLsvtWqM93Q7SIxdfklFl7wsGFC/VbqgZl8QMlxU7VtDrmqHGRfNK/gjixYYZ7+hj2L4WO8Xs8HP6ksD0c6m74JPJG56vavKdflfCpQD+VTeixgeHcPCqe317IAvuCU8kDkw== Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=stackit.cloud; Received: from DB4PR10MB6917.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:3ff::16) by GV1PR10MB7597.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:150:87::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.15; Thu, 24 Oct 2024 15:46:16 +0000 Received: from DB4PR10MB6917.EURPRD10.PROD.OUTLOOK.COM ([fe80::b865:87a6:68fa:764e]) by DB4PR10MB6917.EURPRD10.PROD.OUTLOOK.COM ([fe80::b865:87a6:68fa:764e%5]) with mapi id 15.20.8093.014; Thu, 24 Oct 2024 15:46:16 +0000 Date: Thu, 24 Oct 2024 17:46:14 +0200 To: dev@openvswitch.org Message-ID: <2dac0f38cbb015c8fe76e92889fea3efade28527.1729784574.git.felix.huettner@stackit.cloud> Mail-Followup-To: dev@openvswitch.org References: Content-Disposition: inline In-Reply-To: X-please-dont-add-a-signature: thanks X-ClientProxiedBy: FR3P281CA0113.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a3::12) To DB4PR10MB6917.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:3ff::16) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: DB4PR10MB6917:EE_|GV1PR10MB7597:EE_|DU2PEPF00028D0F:EE_|GV2PR10MB6283:EE_ X-MS-Office365-Filtering-Correlation-Id: 1c5cb273-c353-47b2-697c-08dcf443007d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0;ARA:13230040|376014|1800799024|366016; X-Microsoft-Antispam-Message-Info-Original: eCDgynV/kSbCRiE7aFgzJNItN9C3FqrjxeLSMCTJszlMCei+PXK+RP9TVXCZtopjfw4ROGm2tUKuFT726LAZKTZISiYtzXya4N8dWvzXnJs3B2zUyTRRjrvaJNrThT2OshWFeKKgKKX+8eCdt6nHEqgpRQaitPpq+tF5CE+hKopklml5hxmTX8A4Gbg911U56ZLnnNbOdfrK9UknN74DQcygHvlfSC4RDEpZazxfnRxd88AMPLJ+fWqJM9g4Qtf48STi6dX783bBVepWcmrknCh9vBS6jwPLXrSgFnmv3cBHjHnqu1cbSAiCeToQRcQy/K1eoMAVPu8KCY/0KQBW5MUmo3e60fO7zPmxWM1h7wHJWP8xkfTnqhkbk1JfuS/M9mGOAX290w00Udey9KzsJUk1vZ+O00kWfohjPkBDGEQvnB9A9zZQKXL5tQHZRq5idq/biN2fZ6nHi5YHIb58Q2U/ymMKRPW6PSgPCicFVLoVxJMcVNAdF9p/Ri/sJmHcG1zeTLIHpD0Fmif4baR+Uq7d/eqn/1GsXSNI9eDIqUUijsflS3P9f1Mgn06fYteOjqbL4HbIPdRuiPJRHqF0uP9KEGF3XzIPTrXhjJZE4CAGCCscWesaDKJnq541gJNBn6MWs4zAoQOJK/MPxLXIeaUTqofo3NZ5J3fXTx3/tUTH6qX5bRK4ppAKSN+15AEXhT5ZQmQIYHGooD54mm1Y/i0AuHOD0qVpROCPv84Ra0YG7jww3EcQm64CprjlFE1qYR4FX5Duzwp+OZkFhYvCyAF3YPYn7wfrXD+kHF9NqZz3X88skzaUVbIiB/oa7X2k1OB0Ic/zkit+NCH55q3UPspv7BPCDkQg6+oGipa8qDkPwJn5rNBbQe+89Jkf2pT2CLJVVuAeLvmpxe+NQk3rSSgErBKfe2hIwvOIHY2mMu+IfdpfiZ+AzcQ4FOzZ1qonjnjvbBQZZ4jIQgI43b1SAr3sBr+HZ0GPiobWrfObqoT8i5UwqUhu1OtpI03JYiymbFs3uo+d4s+JSSwOzaxvTDdmsdN5yIYKaIhYxZUE7dZiERPd0XPl3+RXDhe5OCvCe5SuHZLA+fGEU8puFwBpW/E5Rr0HcDONPg9nVnQuVKHWV70T6hT9P4UYDMMvJao60F+UzTwTQa1em1GTYrP50uR0fxJZ58y5rI9GYCc36+2r/BaA9wD70tvigTCR0+Nrz35SlWQjEG4KTwy7C5SdP0x5dG7cQdiDOKJS/emiF9LyAdF4RlDT1oBzvlqA1KmPN0A3A2MgfhW77iFYtrO4r7SXlMatqLtAfC23QyQlZnR6FlmxHyTLwzvgobGo8kd5 X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB4PR10MB6917.EURPRD10.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230040)(376014)(1800799024)(366016); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR10MB7597 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DU2PEPF00028D0F.eurprd03.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 431e7123-6b22-42b6-4ac0-08dcf442fef4 X-Microsoft-Antispam: BCL:0; ARA:13230040|35042699022|1800799024|82310400026|36860700013|376014; X-Microsoft-Antispam-Message-Info: Z281FF3S8Zc3uVnVxtZU1X9rfS5sSgCTO3w2BwbluG3MRN8qVkwWbG6KErYpswAV9/rhWHVlzbgpLLaTBlxCNJNbkAtJnOKZD8kvsKKFHL2lq6qAd8oWiFKxD+m0aDxmH7oALY0JksGrpxgSfccAwRSUXOiUPf7s+NXDodDhKekFSG5gCMPO5ZCcMrEyCA6KcK53+6W2ir6INN519VKB2kvDdG2MP79nTTf6Tm+0e0htO+M7YazrKrQPAyEJLtIFqHxfy2vS8zkXbBg+GvnTqKywUdHtwqNSC0faj2he7diB4YfH60IYnLlr1w8UyYu4z0PCUZAj6AwyAITPQzFFaS1rXlONbjeCTH+TARpmLrTWcIrhzao83NUYiITinPRVgGHmNwZkn0nqX3pz2+dRXOQIKRPTMNaFGuWvUNc5ZfSaYRDefpe13/NEAuJLfzxffyW8Kzj68tohMoIVBmKRc8e5F+p3UNNgsp882yNqevZ8ANdoQeqC6gYpgRBS/ibTbXbcyfetZ5Tr1Y8qsyrNfE5L5RBMbYkB+0gxtV9o7fPcu+GzMDVCAvOUqdkvSDOXDt/OOPh/RuwQm+hNDYUvXQ0hYAuipPyAA/KSprKnqNTgf1n+CpKhvf441c066SmsO5twVhpGzkaCp2jUX/MlrgITfdytHDA/lUxaHricOkhRC3GNYIE+WA2j4CdfuJhh3/2nZ6NIm7eiLwmcee7ko2JoO+cVkDmSttEXOBZcO39/mQ7RashzH3k2B8G/58jrmi2UvqjIuNf6EOKd8r8FPSgPRI/EN5gIZYGEaz5c9K1Gr58jgr3xrvX2XDRkZeKfpnZyFESieKiSY6VizQL4YLkhQ5U4TA4m4qjWD4FEFGtEtAvqGk9VFFLvaav70jPzZ+ZHZOK07U5BEIQr3Xt2ymgHG72JW27cBUoOdOLn7t+uwrIZRZU3bNHNJwDPtV9uL8pxT91Sf4r8WngH4n2HhSXbxRO1wMgwTsZzlDOVJskj3KCXzVZFMleo5vR7GHtRBJGM/pnRsbUIiHmPRAho9zgpGnhFAMR2hxiew+CKkrD3Jze3oRqM/O3WKVEPMY//IEjnCfP6jojfbWTsXfQ2lGPpCSSnTX849uJ0X7Ok8zfb3+KaZOwJMSqUi1TmV+O2txFhEyB1WvFzbSlpRLH/zDjJExeNR1Bhc6o8qf2Nk6QSHyA3I70i2tFclcx1VXRPwmXaQUnXpF9PjXjbVCm+LSFaN3BVo1ttmxniBHw7Bbol4ZLVer0KGVdtjF71W5+F+ZKs1bDn+Qh/2yFH4qmwmJU38KM8Z2Za69TlGGVOG46u7XyZJOs8e2Is8i9JsFk92I4Itjk510h1hlKEzAieUm+b0u8Gr4W8Lhm/nr3sTd+7PoOQbMa6b9vnUARTYdkaae1pnVtZRx1B+FoFaWivvg== X-Forefront-Antispam-Report: CIP:104.40.229.156; CTRY:NL; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:eu1.smtp.exclaimer.net; PTR:eu1.smtp.exclaimer.net; CAT:NONE; SFS:(13230040)(35042699022)(1800799024)(82310400026)(36860700013)(376014); DIR:OUT; SFP:1101; X-OriginatorOrg: stackit.cloud X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Oct 2024 15:46:18.3285 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1c5cb273-c353-47b2-697c-08dcf443007d X-MS-Exchange-CrossTenant-Id: d04f4717-5a6e-4b98-b3f9-6918e0385f4c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=d04f4717-5a6e-4b98-b3f9-6918e0385f4c; Ip=[104.40.229.156]; Helo=[eu1.smtp.exclaimer.net] X-MS-Exchange-CrossTenant-AuthSource: DU2PEPF00028D0F.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR10MB6283 Subject: [ovs-dev] [PATCH v1 4/6] route-table: Expose route_table_parse. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Felix Huettner via dev From: Felix Huettner Reply-To: Felix Huettner Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" also used on the OVN side to watch for routing updates. Signed-off-by: Felix Huettner --- lib/route-table.c | 3 +-- lib/route-table.h | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/route-table.c b/lib/route-table.c index 918e86472..9b5c9f29d 100644 --- a/lib/route-table.c +++ b/lib/route-table.c @@ -65,7 +65,6 @@ static bool route_table_valid = false; static void route_table_reset(void); static void route_table_handle_msg(const struct route_table_msg *, void *); -static int route_table_parse(struct ofpbuf *, void *change); static void route_table_change(const struct route_table_msg *, void *); static void route_map_clear(void); @@ -210,7 +209,7 @@ route_table_reset(void) /* Return RTNLGRP_IPV4_ROUTE or RTNLGRP_IPV6_ROUTE on success, 0 on parse * error. */ -static int +int route_table_parse(struct ofpbuf *buf, void *change_) { struct route_table_msg *change = change_; diff --git a/lib/route-table.h b/lib/route-table.h index 4f44a8085..968652d66 100644 --- a/lib/route-table.h +++ b/lib/route-table.h @@ -24,7 +24,7 @@ #include #include -#include "openvswitch/types.h" +#include "openvswitch/ofpbuf.h" struct route_data { /* Copied from struct rtmsg. */ @@ -55,6 +55,7 @@ uint64_t route_table_get_change_seq(void); void route_table_init(void); void route_table_run(void); void route_table_wait(void); +int route_table_parse(struct ofpbuf *buf, void *change_); bool route_table_fallback_lookup(const struct in6_addr *ip6_dst, char name[], struct in6_addr *gw6); From patchwork Thu Oct 24 15:46:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felix Huettner X-Patchwork-Id: 2001813 X-Patchwork-Delegate: echaudro@redhat.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=stackit.cloud header.i=@stackit.cloud header.a=rsa-sha256 header.s=selector1 header.b=tZ9wiecw; dkim=fail reason="signature verification failed" (2048-bit key) header.d=stackit.cloud header.i=@stackit.cloud header.a=rsa-sha256 header.s=selector1 header.b=tZ9wiecw; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.138; helo=smtp1.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XZ9Jz6PnFz1xwy for ; Fri, 25 Oct 2024 02:47:15 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 4E3DB81446; Thu, 24 Oct 2024 15:47:14 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id MKjUrAR3KSIs; Thu, 24 Oct 2024 15:47:13 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.9.56; helo=lists.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org CAD1E80B16 Authentication-Results: smtp1.osuosl.org; dkim=fail reason="signature verification failed" (2048-bit key, unprotected) header.d=stackit.cloud header.i=@stackit.cloud header.a=rsa-sha256 header.s=selector1 header.b=tZ9wiecw; dkim=fail reason="signature verification failed" (2048-bit key) header.d=stackit.cloud header.i=@stackit.cloud header.a=rsa-sha256 header.s=selector1 header.b=tZ9wiecw Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp1.osuosl.org (Postfix) with ESMTPS id CAD1E80B16; Thu, 24 Oct 2024 15:47:12 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id AD38BC08A6; Thu, 24 Oct 2024 15:47:12 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 0A88DC08A6 for ; Thu, 24 Oct 2024 15:47:12 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id AC9D340838 for ; Thu, 24 Oct 2024 15:46:43 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id UuYPtZI5DqvL for ; Thu, 24 Oct 2024 15:46:41 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2a01:111:f403:2613::600; helo=eur05-vi1-obe.outbound.protection.outlook.com; envelope-from=felix.huettner@stackit.cloud; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp4.osuosl.org 0123B407F7 Authentication-Results: smtp4.osuosl.org; dmarc=pass (p=reject dis=none) header.from=stackit.cloud DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 0123B407F7 Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=stackit.cloud header.i=@stackit.cloud header.a=rsa-sha256 header.s=selector1 header.b=tZ9wiecw; dkim=pass (2048-bit key) header.d=stackit.cloud header.i=@stackit.cloud header.a=rsa-sha256 header.s=selector1 header.b=tZ9wiecw Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on20600.outbound.protection.outlook.com [IPv6:2a01:111:f403:2613::600]) by smtp4.osuosl.org (Postfix) with ESMTPS id 0123B407F7 for ; Thu, 24 Oct 2024 15:46:40 +0000 (UTC) ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=ah+B0HDJmE10xwhx1mFZ9sgbQui6sCXxkQ0Xj+u//59o4lRRXyDD3SPQemjWnZ9hwTa40BELVY8askr9yJuatOfJ+TNj1/wNiembfcYZ+Vlpa9HlsgOAZ2I04Sx1JH9uJSPy5QZIF/F7wxOQ6LygidRsq6ngWJcuUhiONJuQ0GymfjNCZZ9bF78gdmFUSp8yJJukb0ApmXGahcEBrn5/+9/s0UP4yvMf1DDxiPg8L2e9QVYT9C7LRARgeSa27XX1J2Q0GK3eJgCEi+vlFtgRxvYkC66hfkK/fonRkTqES7p2jBQpPv0Y8peQQi8ldhjg6zLtB5Sz+Q7JnAEWN8ctdw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=2FVb/4SGqYHHE5dwFHeajnq7wX3DZRaR2kibW/KbhqM=; b=eErxf3YbZ/UHgJJas7xENq8g2W1IWKyn4VB+W0JJ81oX+PUvd9CNDLBXvoCV0uvDMxrwznbFQhqObY8IW5I9UiftWpimjfiWGri22EQ6qJ/5q1FcgN5PhkvUX0Q5m5NJXr3NviABSvsqxU8cwfIs8W9sexidKUN5TZXawMcmmkYqc/x1RyJZgLupBT2PrSSVjWHQvUy83hMusgKpDvKCwCFuDSEMgxqdlQvm4fP6QmYV7JUMF3Jkut707xxD7j2kpmt93JEhd0BzC0sf7WtkmD7b/40vagRr8VMuhl9PXaKChumrtStf42iectf250ixNWDIJAh0aVr4usFQauH8dw== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=fail (sender ip is 104.40.229.156) smtp.rcpttodomain=openvswitch.org smtp.mailfrom=stackit.cloud; dmarc=pass (p=reject sp=none pct=100) action=none header.from=stackit.cloud; dkim=pass (signature was verified) header.d=stackit.cloud; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=stackit.cloud] dkim=[1,1,header.d=stackit.cloud] dmarc=[1,1,header.from=stackit.cloud]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=stackit.cloud; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2FVb/4SGqYHHE5dwFHeajnq7wX3DZRaR2kibW/KbhqM=; b=tZ9wiecwYqf6vgBW+0B3Z5S83XPT0QPZSONeDLt4XYXaoob95pdeU479qVqGhFVQODDRi4+riExR8rFU4KhuFQqWOkW/3NGvaK8SCqdi9+TzKbxOgvBgRWj9FuOyzrxZwnHyVIQbE4bmqPptxSq0WjewbAl6X8fQKIwrsbsnuWOxH2qWY69dStVh7l01fCon1vs7TdklKGqW7Bt+0i5LgjO7ELdp0wde5tgotMoY2xI2rxD9o8OGY/vacNH7AliqmXP3XStXGe+TZJLQIoi3E4eoIQz0hi7uqEiGY6KR4E8nvazWEPCnSR5cGvq2RhSALXdeI6ZFc3ndgvHjW9CR7w== Received: from DU2PR04CA0189.eurprd04.prod.outlook.com (2603:10a6:10:28d::14) by VI0PR10MB8956.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:800:218::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.8; Thu, 24 Oct 2024 15:46:36 +0000 Received: from DB5PEPF00014B93.eurprd02.prod.outlook.com (2603:10a6:10:28d:cafe::82) by DU2PR04CA0189.outlook.office365.com (2603:10a6:10:28d::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.20 via Frontend Transport; Thu, 24 Oct 2024 15:46:36 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 104.40.229.156) smtp.mailfrom=stackit.cloud; dkim=pass (signature was verified) header.d=stackit.cloud;dmarc=pass action=none header.from=stackit.cloud; Received-SPF: Fail (protection.outlook.com: domain of stackit.cloud does not designate 104.40.229.156 as permitted sender) receiver=protection.outlook.com; client-ip=104.40.229.156; helo=eu1.smtp.exclaimer.net; Received: from eu1.smtp.exclaimer.net (104.40.229.156) by DB5PEPF00014B93.mail.protection.outlook.com (10.167.8.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.14 via Frontend Transport; Thu, 24 Oct 2024 15:46:34 +0000 Received: from EUR02-VI1-obe.outbound.protection.outlook.com (104.47.11.41) by eu1.smtp.exclaimer.net (104.40.229.156) with Exclaimer Signature Manager ESMTP Proxy eu1.smtp.exclaimer.net (tlsversion=TLS12, tlscipher=TLS_DIFFIEHELLMAN_WITH_AES256_NONE); Thu, 24 Oct 2024 15:46:34 +0000 X-ExclaimerHostedSignatures-MessageProcessed: true X-ExclaimerProxyLatency: 5895484 X-ExclaimerImprintLatency: 2166013 X-ExclaimerImprintAction: e20f10b0ab264b7ba2c1c8c55fdb9fad ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=atSfqPlmeuog0EWmCkioS/mlvFd0FQTOtqWwpspxSxtK8PHY1Sb4fBhn9D3t7ng3uE27H1bqYVrOilQc7B0ejrhlN70SU7k+9jultrZWEFRA9T29EHJSLEX3MGfXH99PXhCJq4VID0cYQeSWMjTrz4UndRO9ydVZvpCQa6quF0DAaedYooWpBvYTeocoiSlfeOjDxzNf4jXgM+u+WT/CAaYzQfCJ84VkOJ0XzEDG1GCRH4cniPAUfzZUxgOascEzmZXO+zVjmtPaIikGEJVJQEXc3STDzxnuEQutiSX5slKs8JrQ93ohfqNSSs5+dWSx2N6VoL/XTME156d5RKjSUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=2FVb/4SGqYHHE5dwFHeajnq7wX3DZRaR2kibW/KbhqM=; b=ZOMke7SAgWU3V7dhRl3SAH9F32KOIfskK4geUzDiNBbsXVGd1eDWDy1kRmTaTID1cp1ejPZ9tkA4Rs1bs93QGP38WBjUq+60cyGn1Nog7Ipj/O7yDkJ1mLW3pxRIFMWTZAyVzIZe1C8S1VSTJNC2NR6CohSENoOk0n13Mxj6bOGU00V46YaALeaIGwwnqe0gc//XLA1NLvbpDdt8zH/eyy1mOsim3xy5Ig0tMWqCrLcEFlxRoYbTc1gU+4HmEKIfbxqq/98A+4AV39+p92eFxUxRK2LiNYYfk1jBa4ufJqJtv0Z51brftrSv+H7K14ucvg1iCVgAjsLRybsHtqxUvw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=stackit.cloud; dmarc=pass action=none header.from=stackit.cloud; dkim=pass header.d=stackit.cloud; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=stackit.cloud; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2FVb/4SGqYHHE5dwFHeajnq7wX3DZRaR2kibW/KbhqM=; b=tZ9wiecwYqf6vgBW+0B3Z5S83XPT0QPZSONeDLt4XYXaoob95pdeU479qVqGhFVQODDRi4+riExR8rFU4KhuFQqWOkW/3NGvaK8SCqdi9+TzKbxOgvBgRWj9FuOyzrxZwnHyVIQbE4bmqPptxSq0WjewbAl6X8fQKIwrsbsnuWOxH2qWY69dStVh7l01fCon1vs7TdklKGqW7Bt+0i5LgjO7ELdp0wde5tgotMoY2xI2rxD9o8OGY/vacNH7AliqmXP3XStXGe+TZJLQIoi3E4eoIQz0hi7uqEiGY6KR4E8nvazWEPCnSR5cGvq2RhSALXdeI6ZFc3ndgvHjW9CR7w== Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=stackit.cloud; Received: from DB4PR10MB6917.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:3ff::16) by GV1PR10MB7597.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:150:87::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.15; Thu, 24 Oct 2024 15:46:32 +0000 Received: from DB4PR10MB6917.EURPRD10.PROD.OUTLOOK.COM ([fe80::b865:87a6:68fa:764e]) by DB4PR10MB6917.EURPRD10.PROD.OUTLOOK.COM ([fe80::b865:87a6:68fa:764e%5]) with mapi id 15.20.8093.014; Thu, 24 Oct 2024 15:46:32 +0000 Date: Thu, 24 Oct 2024 17:46:30 +0200 To: dev@openvswitch.org Message-ID: <702e5e3f34bf9a07257f07c92808c67b2af26146.1729784574.git.felix.huettner@stackit.cloud> Mail-Followup-To: dev@openvswitch.org References: Content-Disposition: inline In-Reply-To: X-please-dont-add-a-signature: thanks X-ClientProxiedBy: FR3P281CA0111.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a3::14) To DB4PR10MB6917.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:3ff::16) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: DB4PR10MB6917:EE_|GV1PR10MB7597:EE_|DB5PEPF00014B93:EE_|VI0PR10MB8956:EE_ X-MS-Office365-Filtering-Correlation-Id: 85456a8a-41b5-4737-54c0-08dcf44309c8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0;ARA:13230040|376014|1800799024|366016; X-Microsoft-Antispam-Message-Info-Original: cwF4VDxY7ffL6Bl11zV9qme/Ua1MLeEmDZOTqj6sNBPdlbMil2TMjrNI9kpiNtXi8Z9feDmON2gnPyTB5QGaOvhmYswL8Y8GL1vFE/5fau49ir9fDm/OiJ6QkFTZn7RK1xd1j5CpTMXOTZ7kOMr//tMC0EPvb6fvWi4S6krY9foXzIwnMM/ypBtqrgS4z4nJyLMUm2iYRK+RYal+eVjlRRRCbq8N9RDPBGmE9/cLY5nwVw+M+/etyd4VdpBXCS3xS79kG9u8pSEAVW8T7A2Z/XaEd9+4KU8L16/euOi3o32eA4lqwIkPnfKXsaOfExiYtiK6jQbKVPBM4I2Fdas4jYYFTi+YSUqWcmI245qXMWCmSxkRocZ0nF4RmVjqstcOmwa1KE+jCvvWR0GP6uyIw9k80j2Iztdt2i8hVhJpQaM/4GVu/UAEfKth9Lb3VOHqWETTsxheMK9h5Uep8vfXZY2GHZxZRAkb/rnPktAk3rusmT6kI/DTcOryBJgODY2WqOuL4hUvpRwKLXXrEWFTIgGYNjU+LBhfMY7h/hLU6+YkNOTRLPp5eM3z+IwiWb3rstvzTr9ijIfuTX/lC3huNUXH4fFv+xKicRsn0icpFdv8Iz0vAWZqTMbzwFpAL0Qtj7Mqi9ENL5m6w7J3tnHWzI9NnPlaa3UmWdE0zrjgcOMwHfKgHkrRqnSR5CCzzigUKUeAa7xP6mtCOEKKb8AE4xrvkeyOYWrkk/jLe7ChyF+/03J9WSRvKEeU1zF7Fio0J3QikHynzb7ho9XOH8bvvC7K2uCDgw3t9YRjmO6xV4r+vR2qaqYNqkmpSKObu2SA1Id6WnjK69Qh4Msw4LP8aoNduX3FSXGsCCZfihteCD7XZyYbW6JuEjps03h3/Rh8ntFnjt6ro0sx/AtogeGdDpq1LNvBmLXXCEVRLoZRs+R78VGgllv2oOlnUZtg6Av67Tqo37xI1Iho9Q6CSmlPYr6hYKwINavEKIMiOkAdk+xAIhvPrHgwLK3/t3OFf5ZGCmPxXEyfDp3QobJSU/G7nEA2Z8heR2WWdIaT/8PrCJwMoHK5vLsNRvt852MMd0Poa6T8GY11dwDLO+4SGna4oa7NspxV1U34FQhZwZq3G5XxA6QQxogUiwXXfY+6zLX94LE4J+06F97ft01vjhruCMzSERG2UTAFx1ow8XsNSiho0NuWHNjJ5oS7pJmWwk7X1xtQSg1yW3rEctb/AeWI/XneflCPTEQ2iMx988HtWvwnVIXgAILncy/f03m2ZfxLUIy+pbvoHaA7M6sJPXnZvrZ9JkgeMzcV9a4sDUBA0ClSZ5pw6CrU/6f6x0Cajt95 X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB4PR10MB6917.EURPRD10.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230040)(376014)(1800799024)(366016); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR10MB7597 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5PEPF00014B93.eurprd02.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 8a4e8608-2388-47e9-de2c-08dcf44308a2 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|82310400026|36860700013|376014|35042699022; X-Microsoft-Antispam-Message-Info: AJV3elXMtwcaJ6Fy9atE+V1Pz/qU/37of8fiCwRqwKBX5hpYGKss2QZa/N2iMOqpkiy33Gl/W2U2E7ZyRPiHP7rBYpvGolFzOWf827JUjfx/2feVc3EGinpoC2QkEJNRu+msptu0ntlPrgyHxmW+vpkIhHjar/pt6Un2HO4sUT87+UPU3l0yv8PpMZBktw9wW//ao2vrOlfln/N3+mFNezhUbJ5kPshitk1adidPGmZC9ub5/ETOXlDDWDnCUAQlItWtwvfVadZyHn9AHVjrE8sLsEdKzv1AhkI7XV/kma3HT/S2fS9Fyn0TtN+g6cqcHCcjn9C+7XmhumZijYhoG4hyg9XCCkIDcWW/xHph7BU6rOBWyoFtqDcG5BCto3ghjTzJt3J+yeg7pQTX5myidw8qZ71Hkgw/v574R3ViujHWIvmfVWF+H1BFgYcP8FTaVsofvCT2rshXKp4PfREV20GWONvLg1TPzO4HmB653OXjqTQmIybyccUhdH94EhhR1lTYeB0oa4n1KRf+0CvDnPuFYpcWLIvA16flIuRtGepTtmd3qgoVmIfPSn38SLMXc6Zl25EpQS6ClJ5lNan8hOB5mKwplcur4Jt1RgDE6+Kopjxo21apzVjiaLbOmGwCw95a8MNEBqXzuJbtps5fiDA97Me2WCkNJ9DpCA1UuFFT+VufS5O5ScTs8jZ8kZXjhL/bRmOn62sZejy/y0R0Fy3juJ5904WJDnmJepCfBdNjj8sCeAKM82bayYy3f9haaFAQQiuQUJBEyT1HTzqfqX7sNrfxwHh+gUyBeB/+E0ov2u1pNmdQgOEHHK2DtJ8SBCRoHADKgDyWS9io5Bto4rIkNqo1RPiRr57L6bHFHn2DMKoK4szg/jy+Gx7ToXN8Wb5lXTTq0WGXVb50Qu7QVMjZPzKG1dq3a/1kTn6Suxr+tIcx7tX1NbmsN/9iUP8Y3XCxIq8GQQ/GQpdJEXCKfdF0jZpVhjshYSPritMb0Raace89P6MAm5R/whDCzOnKEWhH5CBFBXuqmnsTA5DtRyGEPnOThkbl1q9YBBuFrX23Y1WI3muLDcZJ7miPHXZ7BpdevjiQFpiU/48lT5PjCANQO6DLmfDCKV1dSNOT/EMVYmiHxjFxWZVEY8kXm3blw3wB1f5claFdBoJOho+ahei1jJT/bJVDCWTRA6YFNRjSzAfoNTrVbrS7PMU1YERUs4HTNyP5ZD2kADuwIiORaFYMjHs6MbX9RV3//MZV5LU2i6CUVFkD4p0cjkhM81KdNZTczkxhBmFDQXzRLV8FefPmOGu4lw8GWHd8jVDM1IkropMz8JWoVx1utG482ORFKAVn5aSyKlDHA0vfSm74HEbOgtuiqJih8aXdfBUqdg4RgZEvHWGJcFohY5Z6KHaWyUPElMDuvBelIWLxfEd9Lw== X-Forefront-Antispam-Report: CIP:104.40.229.156; CTRY:NL; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:eu1.smtp.exclaimer.net; PTR:eu1.smtp.exclaimer.net; CAT:NONE; SFS:(13230040)(1800799024)(82310400026)(36860700013)(376014)(35042699022); DIR:OUT; SFP:1101; X-OriginatorOrg: stackit.cloud X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Oct 2024 15:46:34.0752 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 85456a8a-41b5-4737-54c0-08dcf44309c8 X-MS-Exchange-CrossTenant-Id: d04f4717-5a6e-4b98-b3f9-6918e0385f4c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=d04f4717-5a6e-4b98-b3f9-6918e0385f4c; Ip=[104.40.229.156]; Helo=[eu1.smtp.exclaimer.net] X-MS-Exchange-CrossTenant-AuthSource: DB5PEPF00014B93.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI0PR10MB8956 Subject: [ovs-dev] [PATCH v1 5/6] route-table: Support parsing multipath routes. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Felix Huettner via dev From: Felix Huettner Reply-To: Felix Huettner Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" multipath routes have separate structures for each of the nexthops. Previously if a multipath route was received it was treated as a route without a nexthop. Now these nexthops are parsed (up to a limit) and the ovs router uses the first route in the list. OVN will use the other routes. Signed-off-by: Felix Huettner --- lib/route-table.c | 148 +++++++++++++++++++++++++++++++++++++--------- lib/route-table.h | 12 +++- 2 files changed, 131 insertions(+), 29 deletions(-) diff --git a/lib/route-table.c b/lib/route-table.c index 9b5c9f29d..80325f6f9 100644 --- a/lib/route-table.c +++ b/lib/route-table.c @@ -207,6 +207,107 @@ route_table_reset(void) } } +static bool +route_table_add_nexthop(struct route_table_msg *change, + bool ipv4, + struct nlattr *nl_gw, + uint32_t ifindex) +{ + ovs_assert(change->rd.n_nexthops < MAX_ROUTE_DATA_NEXTHOP); + + struct route_data_nexthop *nh = &change->rd.nexthops[ + change->rd.n_nexthops]; + + if (nl_gw) { + if (ipv4) { + ovs_be32 gw; + gw = nl_attr_get_be32(nl_gw); + in6_addr_set_mapped_ipv4(&nh->rta_gw, gw); + } else { + nh->rta_gw = nl_attr_get_in6_addr(nl_gw); + } + } + + if (ifindex && !if_indextoname(ifindex, nh->ifname)) { + int error = errno; + + VLOG_DBG_RL(&rl, "Could not find interface name[%u]: %s", + ifindex, ovs_strerror(error)); + if (error == ENXIO) { + change->relevant = false; + } else { + return 0; + } + } + change->rd.n_nexthops++; + return 1; +} + + +/* The following function uses the RTNH defines of rtnetlink.h + * As these rely on casts from char * to struct rtnexthop * clang will issue + * a warning about alignment even though the defines will ensure that the data + * is alligned. */ +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wcast-align" +#endif + +static bool +route_table_parse_multipath(struct route_table_msg *change, + struct nlattr *multipath, + bool ipv4) +{ + static const struct nl_policy policy[] = { + [RTA_GATEWAY] = { .type = NL_A_U32, .optional = true }, + }; + + static const struct nl_policy policy6[] = { + [RTA_GATEWAY] = { .type = NL_A_IPV6, .optional = true }, + }; + + struct nlattr *attrs[ARRAY_SIZE(policy)]; + + size_t len = RTA_PAYLOAD((struct rtattr *) multipath); + struct rtnexthop *rtnh = RTA_DATA(multipath); + + while (len >= sizeof(*rtnh) && len >= rtnh->rtnh_len && + change->rd.n_nexthops < MAX_ROUTE_DATA_NEXTHOP) { + + bool parsed; + + struct ofpbuf buf; + ofpbuf_use_const(&buf, RTNH_DATA(rtnh), + rtnh->rtnh_len - sizeof(*rtnh)); + if (ipv4) { + parsed = nl_policy_parse(&buf, 0, policy, attrs, + ARRAY_SIZE(policy)); + } else { + parsed = nl_policy_parse(&buf, 0, policy6, attrs, + ARRAY_SIZE(policy6)); + } + + if (!parsed) { + VLOG_DBG_RL(&rl, "received unparseable rtnetlink route message"); + return 0; + } + + if (!route_table_add_nexthop(change, ipv4, attrs[RTA_GATEWAY], + rtnh->rtnh_ifindex)) { + return 0; + } + + len -= RTNH_ALIGN(rtnh->rtnh_len); + rtnh = RTNH_NEXT(rtnh); + } + + return 1; +} + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + /* Return RTNLGRP_IPV4_ROUTE or RTNLGRP_IPV6_ROUTE on success, 0 on parse * error. */ int @@ -223,6 +324,7 @@ route_table_parse(struct ofpbuf *buf, void *change_) [RTA_PREFSRC] = { .type = NL_A_U32, .optional = true }, [RTA_TABLE] = { .type = NL_A_U32, .optional = true }, [RTA_PRIORITY] = { .type = NL_A_U32, .optional = true }, + [RTA_MULTIPATH] = { .type = NL_A_NESTED, .optional = true }, }; static const struct nl_policy policy6[] = { @@ -233,6 +335,7 @@ route_table_parse(struct ofpbuf *buf, void *change_) [RTA_PREFSRC] = { .type = NL_A_IPV6, .optional = true }, [RTA_TABLE] = { .type = NL_A_U32, .optional = true }, [RTA_PRIORITY] = { .type = NL_A_U32, .optional = true }, + [RTA_MULTIPATH] = { .type = NL_A_NESTED, .optional = true }, }; struct nlattr *attrs[ARRAY_SIZE(policy)]; @@ -255,7 +358,6 @@ route_table_parse(struct ofpbuf *buf, void *change_) if (parsed) { const struct nlmsghdr *nlmsg; uint32_t table_id; - int rta_oif; /* Output interface index. */ nlmsg = buf->data; @@ -289,21 +391,6 @@ route_table_parse(struct ofpbuf *buf, void *change_) change->rd.local = rtm->rtm_type == RTN_LOCAL; change->rd.plen = rtm->rtm_dst_len; change->rd.rtm_protocol = rtm->rtm_protocol; - if (attrs[RTA_OIF]) { - rta_oif = nl_attr_get_u32(attrs[RTA_OIF]); - - if (!if_indextoname(rta_oif, change->rd.ifname)) { - int error = errno; - - VLOG_DBG_RL(&rl, "Could not find interface name[%u]: %s", - rta_oif, ovs_strerror(error)); - if (error == ENXIO) { - change->relevant = false; - } else { - return 0; - } - } - } if (attrs[RTA_DST]) { if (ipv4) { @@ -326,21 +413,28 @@ route_table_parse(struct ofpbuf *buf, void *change_) nl_attr_get_in6_addr(attrs[RTA_PREFSRC]); } } - if (attrs[RTA_GATEWAY]) { - if (ipv4) { - ovs_be32 gw; - gw = nl_attr_get_be32(attrs[RTA_GATEWAY]); - in6_addr_set_mapped_ipv4(&change->rd.rta_gw, gw); - } else { - change->rd.rta_gw = nl_attr_get_in6_addr(attrs[RTA_GATEWAY]); - } - } if (attrs[RTA_MARK]) { change->rd.mark = nl_attr_get_u32(attrs[RTA_MARK]); } if (attrs[RTA_PRIORITY]) { change->rd.rta_priority = nl_attr_get_u32(attrs[RTA_PRIORITY]); } + + if (attrs[RTA_GATEWAY] || attrs[RTA_OIF]) { + uint32_t ifindex = 0; + if (attrs[RTA_OIF]) { + ifindex = nl_attr_get_u32(attrs[RTA_OIF]); + } + if (!route_table_add_nexthop(change, ipv4, attrs[RTA_GATEWAY], + ifindex)) { + return 0; + } + } else if (attrs[RTA_MULTIPATH]) { + if (!route_table_parse_multipath(change, + attrs[RTA_MULTIPATH], ipv4)) { + return 0; + } + } } else { VLOG_DBG_RL(&rl, "received unparseable rtnetlink route message"); return 0; @@ -367,8 +461,8 @@ route_table_handle_msg(const struct route_table_msg *change, const struct route_data *rd = &change->rd; ovs_router_insert(rd->mark, &rd->rta_dst, rd->rtm_dst_len, - rd->local, rd->ifname, &rd->rta_gw, - &rd->rta_prefsrc); + rd->local, rd->nexthops[0].ifname, + &rd->nexthops[0].rta_gw, &rd->rta_prefsrc); } } diff --git a/lib/route-table.h b/lib/route-table.h index 968652d66..f96dbebb3 100644 --- a/lib/route-table.h +++ b/lib/route-table.h @@ -26,6 +26,13 @@ #include "openvswitch/ofpbuf.h" +#define MAX_ROUTE_DATA_NEXTHOP 8 + +struct route_data_nexthop { + struct in6_addr rta_gw; + char ifname[IFNAMSIZ]; /* Interface name. */ +}; + struct route_data { /* Copied from struct rtmsg. */ unsigned char rtm_dst_len; @@ -34,13 +41,14 @@ struct route_data { /* Extracted from Netlink attributes. */ struct in6_addr rta_dst; /* 0 if missing. */ struct in6_addr rta_prefsrc; /* 0 if missing. */ - struct in6_addr rta_gw; - char ifname[IFNAMSIZ]; /* Interface name. */ uint32_t mark; uint32_t rta_table_id; /* 0 if missing. */ unsigned char plen; unsigned char rtm_protocol; uint32_t rta_priority; + + size_t n_nexthops; + struct route_data_nexthop nexthops[MAX_ROUTE_DATA_NEXTHOP]; }; /* A digested version of a route message sent down by the kernel to indicate From patchwork Thu Oct 24 15:46:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felix Huettner X-Patchwork-Id: 2001812 X-Patchwork-Delegate: echaudro@redhat.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=stackit.cloud header.i=@stackit.cloud header.a=rsa-sha256 header.s=selector1 header.b=lUjSeAnb; dkim=fail reason="signature verification failed" (2048-bit key) header.d=stackit.cloud header.i=@stackit.cloud header.a=rsa-sha256 header.s=selector1 header.b=lUjSeAnb; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.138; helo=smtp1.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XZ9Jq4qrfz1xx6 for ; Fri, 25 Oct 2024 02:47:07 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 1933780B7C; Thu, 24 Oct 2024 15:47:06 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id E4perZAkaPEs; Thu, 24 Oct 2024 15:47:05 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.9.56; helo=lists.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 1488880DD7 Authentication-Results: smtp1.osuosl.org; dkim=fail reason="signature verification failed" (2048-bit key, unprotected) header.d=stackit.cloud header.i=@stackit.cloud header.a=rsa-sha256 header.s=selector1 header.b=lUjSeAnb; dkim=fail reason="signature verification failed" (2048-bit key) header.d=stackit.cloud header.i=@stackit.cloud header.a=rsa-sha256 header.s=selector1 header.b=lUjSeAnb Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp1.osuosl.org (Postfix) with ESMTPS id 1488880DD7; Thu, 24 Oct 2024 15:47:05 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id EA166C08A6; Thu, 24 Oct 2024 15:47:04 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 5D2A4C08A6 for ; Thu, 24 Oct 2024 15:47:03 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 406FF6085B for ; Thu, 24 Oct 2024 15:46:48 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 5j1tEwTnIgFe for ; Thu, 24 Oct 2024 15:46:47 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2a01:111:f403:2607::609; helo=eur02-vi1-obe.outbound.protection.outlook.com; envelope-from=felix.huettner@stackit.cloud; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp3.osuosl.org B4425608D8 Authentication-Results: smtp3.osuosl.org; dmarc=pass (p=reject dis=none) header.from=stackit.cloud DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org B4425608D8 Authentication-Results: smtp3.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=stackit.cloud header.i=@stackit.cloud header.a=rsa-sha256 header.s=selector1 header.b=lUjSeAnb; dkim=pass (2048-bit key) header.d=stackit.cloud header.i=@stackit.cloud header.a=rsa-sha256 header.s=selector1 header.b=lUjSeAnb Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on20609.outbound.protection.outlook.com [IPv6:2a01:111:f403:2607::609]) by smtp3.osuosl.org (Postfix) with ESMTPS id B4425608D8 for ; Thu, 24 Oct 2024 15:46:46 +0000 (UTC) ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=SLHHZyLjwf25bF7mp+ZfhVKFJHXQZhK0GG0bEv41X6EKVK8NaIxwTMBanm/3XWNJrmtQ/RmBepELis/1JQbZYypLN0Ewnn9CD86y/ZZPxEi8e+iZwjsInqqDmCXSSaEMukciJG4fity6qqsx6LU1p5t1dnR2A56+Z5cjyOV/R0Kl6lgOQ8G7ADAu5KAlLMbBQ9xOw0UB9w7KPWQ2a6sg7PJ3VDxYzxb4F19Xf4vSFS+HDLKqlGSrWcDk9BYxU0krWt1t89qNDDoup5/9vRdAkN3sdtsUbXRcwahqtahqQFG+vaQEydjkJGsYOxNz5TrH0WOI7iMHO7iklzCMfdlVDQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=JB4pAAmne4StQHinsTfKtU7r9z/rg1ebjLc5obJ/duc=; b=FHRM/hN7Dt0bTb3kUmYgZcl1y+O8uWAUiP9YnuoQfxp+CGRB3EdQ6FuXWjpMCePx8XMhAZCiECz4E6S/8b0XtDaiR1VnZouZeT9hEukWIKMrmNQ2ErRxMaMn9tTXixaP8GfZmUxCpGgz878PNH9RjGCt3//NjgRLyzJRDaY8+1FV7xC5TlftnWdDO/0tULu+qJtaD/Ic9fjxu7fzmdTGsaBjH0rP2gCSjSULNSqMLJxjC+Q1/Y1MaGxIoU2ZrfAJFQrMCv9v4+8MoBsTveCvVKKTAsQwFvHJylNprYnW+UbzkB8kCTAYYmNOOChT0od+rB8QiMJpYy/Fmr6lsE1f3A== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=fail (sender ip is 52.169.0.179) smtp.rcpttodomain=openvswitch.org smtp.mailfrom=stackit.cloud; dmarc=pass (p=reject sp=none pct=100) action=none header.from=stackit.cloud; dkim=pass (signature was verified) header.d=stackit.cloud; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=stackit.cloud] dkim=[1,1,header.d=stackit.cloud] dmarc=[1,1,header.from=stackit.cloud]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=stackit.cloud; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JB4pAAmne4StQHinsTfKtU7r9z/rg1ebjLc5obJ/duc=; b=lUjSeAnbZJS/b3cQ5QVwiRDNrwPFg6x2JAvlvFx6YMeWXn0nnmFNTvDOD2BIXNX6TptH59KTIHMMbG7kGGpCD5Kv1gtq4z6o4zmLO6m22s2bhbEBg8cbOPCcc97gT3gMAjVshN+NIVu5HoXDyMLiOot4KRI5O1wj4ct6QbtzgDNgiiyBG8hA645K3gfQiyRo4bBPxtNbA/NRa9U3LZwL6GGIjEUwaPsUhMqyJIqYE0eEZ7abmqN3AE9HAAAK3yBTM5hzG8FJO9J7Lv7R4IkWD5kHgErf8LwV/ZqooRxmwTXKlsf2Y7zB/nE74bWZIA7b9gP1xi8VO0u+G64XCxWlRQ== Received: from AS9PR06CA0485.eurprd06.prod.outlook.com (2603:10a6:20b:49b::9) by VI1PR10MB7812.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:800:1cb::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.15; Thu, 24 Oct 2024 15:46:43 +0000 Received: from AMS0EPF00000195.eurprd05.prod.outlook.com (2603:10a6:20b:49b:cafe::5c) by AS9PR06CA0485.outlook.office365.com (2603:10a6:20b:49b::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.20 via Frontend Transport; Thu, 24 Oct 2024 15:46:43 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 52.169.0.179) smtp.mailfrom=stackit.cloud; dkim=pass (signature was verified) header.d=stackit.cloud;dmarc=pass action=none header.from=stackit.cloud; Received-SPF: Fail (protection.outlook.com: domain of stackit.cloud does not designate 52.169.0.179 as permitted sender) receiver=protection.outlook.com; client-ip=52.169.0.179; helo=eu2.smtp.exclaimer.net; Received: from eu2.smtp.exclaimer.net (52.169.0.179) by AMS0EPF00000195.mail.protection.outlook.com (10.167.16.215) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.14 via Frontend Transport; Thu, 24 Oct 2024 15:46:41 +0000 Received: from EUR02-AM0-obe.outbound.protection.outlook.com (104.47.11.232) by eu2.smtp.exclaimer.net (52.169.0.179) with Exclaimer Signature Manager ESMTP Proxy eu2.smtp.exclaimer.net (tlsversion=TLS12, tlscipher=TLS_DIFFIEHELLMAN_WITH_AES256_NONE); Thu, 24 Oct 2024 15:46:42 +0000 X-ExclaimerHostedSignatures-MessageProcessed: true X-ExclaimerProxyLatency: 5996864 X-ExclaimerImprintLatency: 1889011 X-ExclaimerImprintAction: b4c8c380644846429b02ade9f2c5ce45 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=p2yG6B2Y+Amfd6v2AqwOqo+QU6En3uNo+GeE2Zt+iKrAlB8g4H42OOxGwxbYEP9wczhtwIZmW9jwX5KnMhkVXfZxNmkxln1WwN3EEBHtaeQ1nwBynlRGbUgVagaJWI8ZjyoqeiqzPHc2ClfVPyXnsdxV8krPctH0L5YX1OsuH6C/qBUZ57Kmp0DeejAg/7kN7s5feXXiuowRvBtqdg7Ij9mBqhkapbs+KwvlYCApVTR4dZ5ZZuH4WBAC7Nv7+ZE/jimGL4ayrfAba7pqi+hAGrcoKG3o2J0uKA20zuyiDkwcOmFFE1aarN7cKXE2s9J/3dbu9dgOlWlRf/xrOQ1pGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=JB4pAAmne4StQHinsTfKtU7r9z/rg1ebjLc5obJ/duc=; b=xAFXPMC9ZsX5RdGxdOUt8avGt7UPnRbZ53NewXagvmTTv1DI77XgD6pauIMsxDLjn9Zk6BVE57ZZA7aY2K46/Yq87tu7WK+eEZk+ExsJV7DcxVlR7LR7gvoyhbGcShWxMjrol4Vm0bBVNnP48Rp/jeg3+yjrnplPQFqTZEIIqIOMSeUDGg/3H2Z7/Xcw2rxtdzK+PF1AZ9hQWJ+MP5vcUjgre5IPhmMjGV+xlwHBica5of0Yqp5iNCi50DZUaaU4dsNibXBmc/cAoVsSNleDuqCydh1Su2wxxfHn1PUXMpYW1Ha2Nwa/+CfLoliAsJxFsuLUL+nD8j44EVLM7Up8gQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=stackit.cloud; dmarc=pass action=none header.from=stackit.cloud; dkim=pass header.d=stackit.cloud; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=stackit.cloud; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JB4pAAmne4StQHinsTfKtU7r9z/rg1ebjLc5obJ/duc=; b=lUjSeAnbZJS/b3cQ5QVwiRDNrwPFg6x2JAvlvFx6YMeWXn0nnmFNTvDOD2BIXNX6TptH59KTIHMMbG7kGGpCD5Kv1gtq4z6o4zmLO6m22s2bhbEBg8cbOPCcc97gT3gMAjVshN+NIVu5HoXDyMLiOot4KRI5O1wj4ct6QbtzgDNgiiyBG8hA645K3gfQiyRo4bBPxtNbA/NRa9U3LZwL6GGIjEUwaPsUhMqyJIqYE0eEZ7abmqN3AE9HAAAK3yBTM5hzG8FJO9J7Lv7R4IkWD5kHgErf8LwV/ZqooRxmwTXKlsf2Y7zB/nE74bWZIA7b9gP1xi8VO0u+G64XCxWlRQ== Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=stackit.cloud; Received: from DB4PR10MB6917.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:3ff::16) by GV1PR10MB7597.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:150:87::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.15; Thu, 24 Oct 2024 15:46:40 +0000 Received: from DB4PR10MB6917.EURPRD10.PROD.OUTLOOK.COM ([fe80::b865:87a6:68fa:764e]) by DB4PR10MB6917.EURPRD10.PROD.OUTLOOK.COM ([fe80::b865:87a6:68fa:764e%5]) with mapi id 15.20.8093.014; Thu, 24 Oct 2024 15:46:40 +0000 Date: Thu, 24 Oct 2024 17:46:38 +0200 To: dev@openvswitch.org Message-ID: <70e6a78ce7bd152ccac6db99d49a532ed342f69f.1729784574.git.felix.huettner@stackit.cloud> Mail-Followup-To: dev@openvswitch.org References: Content-Disposition: inline In-Reply-To: X-please-dont-add-a-signature: thanks X-ClientProxiedBy: FR3P281CA0112.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a3::15) To DB4PR10MB6917.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:3ff::16) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: DB4PR10MB6917:EE_|GV1PR10MB7597:EE_|AMS0EPF00000195:EE_|VI1PR10MB7812:EE_ X-MS-Office365-Filtering-Correlation-Id: 91df851c-b933-4f72-06ea-08dcf4430e6f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0;ARA:13230040|376014|1800799024|366016; X-Microsoft-Antispam-Message-Info-Original: m7+Da1sj74GlRgZ2J9gSiccLjplIKlXFxQfltuVfcisB8CBf2Hw6Lu9TYuEq6cH3XzhXBUeW0VZLvdLhun98mYr+JRNlP3GcQ4wbvdGP8wHt9Uo9BA151PUuxfLBXQFRrKXL5uPPQYnUHoMcP+6PjJBhNNGQxJqwp6eg+eXvDTGMIOxEZAT6HJolEr1t1eVOFjDoSLVxgHZ4m2/BfwjC9UwTPOuNmWDep0MJAgsFfv1vJ7Vu937BAV148TL1R21OGeCa+m7iNb36rrGsuc5SwIsy8rYyNunZLZhLxEPlVXi8hTw/fHY4FvWVXKWW6RMhjVyD7TaWC5bBiRcxxh37ejmdJcsevbG75k8yoyunUJjat7WUbC862rz7PoFsgwMrzOV0cMd/6E7hP7c4mJa8XTl5XtSbeyt4W5lTXMwEf0Kbvo5JnyI+E1rZR0TwDcjNxMtRkervmrDaWcXRTQ95NIOwePQOgfGbzN8uKc6nFKEVbl78hS4zIlJr8xwgsVDrtPZCR63zmM8w97260DGaGo6d1IUmp8UW+RXrzyh6Y8YRsOZsqEwLXHc1Hzj6c2UD4+ZLDzAumycwj/5RQxcz1/J9vXeZ/Ackxt1JyNnusLPOhrPjBEvFowIeb+E+lAL1Qy6S7+UVYFwmdp07HxoWxFj18B32oDBUzWxiKdwTPF+Eh8IQ448VFIAiOLDFspqkAPH2l/N5EJetHcwrjo2Jm1H6YeotU0+ZpJExSnhYNhEVvff/gqMsB1ml3ja/Vo+/5G4tFYxOgxU8pTpC1jLSpOffB42BcdmNfiWFoy8cGa/v6LJSQ9Lw9mj0Vmri/dxo1/Rotsp+BqfmpNZuTInmlyZEqN3FdV8zCbV3lxeMbT4ldLoIEBhgTOnPACBFs4yU85ljZ4MvChx2mvqPhhgiRk0SZ07zkGTWji0MK1kmDLHInajLRl2mUIoa2qsPatltZ1l7pMt8lYbYGMueYt9EYf+9yM7qpeFr81AlE6Sb/LoZ/5LEmXCgoqTq7KxJVqv5swEHKa3ul5P/e+2nThi8chhwxeitZrowiYSTLLav/PK4m3c7KWqxWQRDTjM6JVJcoOmVKxu6g+/HmI2CZV2Br+yJ7f3ZfXMDzpkE/Q/tSD9mXdS23qhHeAT/XCE2X/tTrVMzBFmT4OLObFCujOjULlHLEQxIeb24QX7zh9u08qF81IwETELkHycs/m4njFz7CTkCcFmfqE+2JtyrOMuhN+5U/5b4t6CKH0BSdj9BeGXSnb/8GAj5glDPmlyDmlRmNGjh8UGlB/VSwd4FF5YyMX1yu83W6ByK9Q9SehIE8gJDkCJJU95R5JGn83HB1/Rr X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB4PR10MB6917.EURPRD10.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230040)(376014)(1800799024)(366016); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR10MB7597 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AMS0EPF00000195.eurprd05.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: b670043c-9041-4306-7531-08dcf4430d50 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|35042699022|82310400026|1800799024|376014; X-Microsoft-Antispam-Message-Info: Q5aGZA42yaAYwq9aNIiruoSno2yv0/7cMdUzagqPLMYezXC8vwiXiNFncJyHpU3GCfFS0Jiw4WfuzBMhs2bHGWpGj08wGwTngfssg/AB0CIEyuOFW79EeSlUmluSEmuHDvxs1izxX6PvZ0BAKdSQMk+fO+YrWDvrYubOR7h/GonWpOn1Oc+EQ5m3E9E/hTjErJiWOV9ZqFxm5MfDF+nwrMh5lEn3K4QamBZCrQjpQJeCaUSCrzUUmpZPU3H4rXw1IB+qeXl/8lKqJNF3NCqfQjyzfAGlJR60BQkcQzDEjXvjcEjqSEcnFjxYSE1RZuARHyp5/7g86gTjfNY3HJfEhXPLrXMTw3GfUNd11UJLxdLNdHqpT3qLeMK6lLHL//Z8g7ls84Z8i2p0Rcu35cvNZSRgBIFhilvLT0PewPOuRiBzV0AXSauKmB+C06nuJzZRI7V1zGvCYvgPyGCTDG0Yevk7CYq7rz9NqC8PqVcri3oR9n82piK8XZLXbEdGIJnnA7PmeSNRQqjcPK2hWRo75pujL98CVHEv2jIdUselW7+6e/U59s6VyzuHp1NPfiEaw2dCAOeuvTSqZd2Ky5BRdATmpwnVDnnjoCu+ebw1tCJIOgebRmf23J1GAEOCD3Kro+UeTjglHDM+UQ9/9GexXvbUWwFl0uenm7gFoskiMDQ1A58TBEZUywDdaeZ4lY4MdZACkuKoZUlJ1F9EiJ16LGJ744com1MgXNdsEm5NrS7hYqxokFMLi3C4sSBY2nds3bAts08nXNCOAJUvbYhRWz6i4VZheJbyfZFE1HtjnjGWyvtsQmgQV7/gMjHnKm4c/pfE2x8x7NHi8buGL+8Jm+P/kR6lxhW46sBHG8R5lm9K9ZxdjKC2b4j3MGZD6RoLRODMc6dlUWONgeOH6fCYQ5F5MjO5/OtOFVz54eOXfHFVKN/kha4kfQ4+olJLS6jvH4Wxi48P8uOPbYjL9naQ1oRWulKVi5MJwzkaqxys7t+aVY4VxmCLJiO3AwAqaQRv/mSqgXPqtEbvvVnCxTZM+JDs3IWFAtrW/SMfaI0mXu6OUinkmugFunbWq28DAv2L4p0LvFT3habCs8v2dck7VDYY1l8ZUMYvXuRVb1ihq4piB1+8A/cFHF/fZ2aGjxOE7AsI+JN55BTvxAbtfbqrVdl04eUA2VD/Mxjin2n3ake88yK4BLPwa5a2fW0XUrwB8tDAlFYmgBImwOvLlCvVkZYyCs61UFrlzbuF9KBQyIWmiXMpOUXfrNqf3CGlT+abSZ6dXDrbBxppMdKs28KojPjP60K0qI6PbE4TrVWnt5xsqoScf6qBnY5VVbjzzavFAFAS/rc8gd0BSD/6cTVaz8d/uD8JFTD8wrJi/AcyEUrxlz1JdCm7+po/zPwFudo+72hCD8F3wYKeShc510qi5A== X-Forefront-Antispam-Report: CIP:52.169.0.179; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:eu2.smtp.exclaimer.net; PTR:eu2.smtp.exclaimer.net; CAT:NONE; SFS:(13230040)(36860700013)(35042699022)(82310400026)(1800799024)(376014); DIR:OUT; SFP:1101; X-OriginatorOrg: stackit.cloud X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Oct 2024 15:46:41.9255 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 91df851c-b933-4f72-06ea-08dcf4430e6f X-MS-Exchange-CrossTenant-Id: d04f4717-5a6e-4b98-b3f9-6918e0385f4c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=d04f4717-5a6e-4b98-b3f9-6918e0385f4c; Ip=[52.169.0.179]; Helo=[eu2.smtp.exclaimer.net] X-MS-Exchange-CrossTenant-AuthSource: AMS0EPF00000195.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR10MB7812 Subject: [ovs-dev] [PATCH v1 6/6] route-table: Store ifindex for received routes. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Felix Huettner via dev From: Felix Huettner Reply-To: Felix Huettner Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Sometimes it is not easily possible to convert the interface index to a name. Especially if we run in network namespaces. To still be able to act on existing information we also return the ifindex now. Signed-off-by: Felix Huettner --- lib/route-table.c | 1 + lib/route-table.h | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/route-table.c b/lib/route-table.c index 80325f6f9..ce70382a4 100644 --- a/lib/route-table.c +++ b/lib/route-table.c @@ -228,6 +228,7 @@ route_table_add_nexthop(struct route_table_msg *change, } } + nh->ifindex = ifindex; if (ifindex && !if_indextoname(ifindex, nh->ifname)) { int error = errno; diff --git a/lib/route-table.h b/lib/route-table.h index f96dbebb3..bcc3205e8 100644 --- a/lib/route-table.h +++ b/lib/route-table.h @@ -30,6 +30,7 @@ struct route_data_nexthop { struct in6_addr rta_gw; + uint32_t ifindex; char ifname[IFNAMSIZ]; /* Interface name. */ };