From patchwork Wed Apr 3 02:36:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Herbert X-Patchwork-Id: 1075239 Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=herbertland.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=herbertland-com.20150623.gappssmtp.com header.i=@herbertland-com.20150623.gappssmtp.com header.b="KxxNNGel"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 44YqwG0HJZz9sNf for ; Wed, 3 Apr 2019 13:36:46 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726772AbfDCCgo (ORCPT ); Tue, 2 Apr 2019 22:36:44 -0400 Received: from mail-pg1-f181.google.com ([209.85.215.181]:46223 "EHLO mail-pg1-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726089AbfDCCgn (ORCPT ); Tue, 2 Apr 2019 22:36:43 -0400 Received: by mail-pg1-f181.google.com with SMTP id q1so7494321pgv.13 for ; Tue, 02 Apr 2019 19:36:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=herbertland-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=KKB9lP1StOuBm9fiMf8w3jn+LQysvJUcAsJwz1JUgBs=; b=KxxNNGelyXo9I6YmzaeBqKgN6b5/wCSSj1hc7wkfPZWq/vPe9nIGk44Dh9K7+mpqe5 oINAms4vIQs5EIuBYqcIAUS5Xa2cFW+OYkKaI6EJJuPy1BTYwu/YZnfpKqgvo1SaB3fm /A0DiYJrNrpbLLwoTJ6JPEVMfG/rMMfbpU0uzTzrmL6RbheUJ1rsoewQgC1FSdI1albg UNbGe9Jjm58JlXok2OGV10Hlx/oHDYTzARpXCjkX2J82PTZc4vYXJI+NkGPze+bXynkx QQgkD0CqjQU9NsKXpwLgNHnf16S7ynJqQEhNkP3j9OsWmQIcNtTF+VNcKDQVv8kQMuuQ Z+rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=KKB9lP1StOuBm9fiMf8w3jn+LQysvJUcAsJwz1JUgBs=; b=PHu2QZf1UQg7a1H2uTHx7nXAG3kCA34tVYxSGc8tBB7mSQjmkFy4obk2T/LAf9PSMh Jj9fp1P4gqtnp0l+XGHP5RA1XKZMLi/wtIgPkBa7lFQZ989OLOeIkdh5cIAwVeDYKW4D OH22ita8GCIc1QsNcoNJUaSkJKUYKQsQ3XfiwymU4Y8TI6Jl93dWEgzGYIiUqN/Z+qcH 9HsAYqo52jQayn3cyGZIH4humodclIXAKQ2x9Ios9TMHuSTEx6WZv1JsSvM3+6YzP+fj U/6NhyO0voq2hIJotD0Ua7ZZapelJbaoW9BlVvDGGAf4AUGCqR+cXj7tuMRmQVdFYHFW 2A/Q== X-Gm-Message-State: APjAAAVocw2leLDkgMk1U/DxicUCeSQ5wHATLgT4tc6leuffXyDcg/UB nIjcFJnc00L3hZlAVAD8IuTDcA== X-Google-Smtp-Source: APXvYqy8GBaQcBO+LOHCtj7+zgi89Fb1mW8B0Z/WO2Q0EQJ4oh1JCE4hRPzjHL4QGHZWrrGQSQauhQ== X-Received: by 2002:a62:4351:: with SMTP id q78mr58999736pfa.86.1554259002688; Tue, 02 Apr 2019 19:36:42 -0700 (PDT) Received: from localhost.localdomain (c-174-62-124-86.hsd1.ca.comcast.net. [174.62.124.86]) by smtp.gmail.com with ESMTPSA id b72sm40354896pga.86.2019.04.02.19.36.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 02 Apr 2019 19:36:41 -0700 (PDT) From: Tom Herbert X-Google-Original-From: Tom Herbert To: davem@davemloft.net, netdev@vger.kernel.org Cc: Tom Herbert Subject: [PATCH net-next 0/3] exthdrs: Make ext. headers & options useful - Part I Date: Tue, 2 Apr 2019 19:36:25 -0700 Message-Id: <1554258988-13008-1-git-send-email-tom@quantonium.net> X-Mailer: git-send-email 2.7.4 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Extension headers are the mechanism of extensibility for the IPv6 protocol, however to date they have only seen limited deployment. The reasons for that are because intermediate devices don't handle them well, and there haven't really be any useful extension headers defined. In particular, Destination and Hop-by-Hop options have not been deployed to any extent. The landscape may be changing as there are now a number of serious efforts to define and deploy extension headers. In particular, a number of uses for Hop-by-Hop Options are currently being proposed, Some of these are from router vendors so there is hope that they might start start to fix their brokenness. These proposals include (IOAM, Path MTU, Firewall and Service Tickets). Assuming that IPv6 extension headers gain traction, that leaves a noticeable gap in IPv4 support. IPv4 options have long been considered a non-starter for deployment. An alternative being proposed is to enable use of IPv6 options with IPv4 (draft-herbert-ipv4-udpencap-eh-01). This series of patch sets endeavours to make extension headers IPv6 options useful and easy to use. The following items will be included: - Reorganize extension header files - Allow registration of TLV handlers - Elaborate on the TLV tables to include more characteristics - Add a netlink interface to set TLV parameters (such as alignment requirements, authorization to send, etc.) - Enhance validation of TLVs being sent. Validation is strict (unless overridden by admin) following that sending clause of the robustness principle - Allow non-privileged users to set Hop-by-Hop and Destination Options if authorized by the admin - Add an API that allows individual Hop-by-Hop and Destination Options to be set or removed for a connected socket. The backend end enforces permissions on what TLVs may be set and merges set TLVs per following the rules in the TLV parameter table (for instance, TLV parameters include a preferred sending order that merging adheres to) - Enable IPv4 extension headers ------ This patch series is Part I. It reorganizes the extension header related files to make them easier to maintain and update. They are: exthdrs6.c (originally exthdrs.c) - This file contains IPv6 specific extension header processing including the TLV parsing loop and routing header processing exthdrs6_offload.c (originally exthdrs_offload.c) - This file contains IPv6 GRO/GSO offload support for extension headers. exthdrs6_options.c (new) - This file contains the code for processing specific Hop-by-Hop and Destination options (HAO, RA, Jumbo payload, and Calipso) exthdrs_core.c (existing) - This file contains only generic functions and helpers for extension headers and options. The intent is that its functions will also be called for IPv4 extension headers. Tested: Set Hop-by-Hop options on TCP/UDP socket and verified to be functional. Tom Herbert (3): exthdrs: Create exthdrs_options.c exthdrs: Move generic EH functions to exthdrs_core.c exthdrs: Rename EH files that are IPv6 specific include/net/ipv6.h | 15 + net/ipv6/Makefile | 6 +- net/ipv6/exthdrs.c | 1172 ------------------------------------------- net/ipv6/exthdrs6.c | 830 ++++++++++++++++++++++++++++++ net/ipv6/exthdrs6_offload.c | 41 ++ net/ipv6/exthdrs6_options.c | 201 ++++++++ net/ipv6/exthdrs_core.c | 138 +++++ net/ipv6/exthdrs_offload.c | 41 -- 8 files changed, 1228 insertions(+), 1216 deletions(-) delete mode 100644 net/ipv6/exthdrs.c create mode 100644 net/ipv6/exthdrs6.c create mode 100644 net/ipv6/exthdrs6_offload.c create mode 100644 net/ipv6/exthdrs6_options.c delete mode 100644 net/ipv6/exthdrs_offload.c