From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,USER_AGENT_GIT,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AD822C169C4 for ; Tue, 12 Feb 2019 00:43:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7747620844 for ; Tue, 12 Feb 2019 00:43:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="MBmTZKob" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728042AbfBLAnK (ORCPT ); Mon, 11 Feb 2019 19:43:10 -0500 Received: from mail-pl1-f201.google.com ([209.85.214.201]:52598 "EHLO mail-pl1-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727317AbfBLAnJ (ORCPT ); Mon, 11 Feb 2019 19:43:09 -0500 Received: by mail-pl1-f201.google.com with SMTP id 71so693872plf.19 for ; Mon, 11 Feb 2019 16:43:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=Hh5BX5IanaxD3Ut3WlRRU/Ne+8rcS8h37AkErWrLUz8=; b=MBmTZKobcLqqQspq4aak+NsZrLAW8NCV9LT7lhdEJVuqj+ppoQH17Ppb2RKC2CQ6DS KpYhj+qMMsbzZg/DjFaYg5j1p2rwVCHdi1KRNw9+yANvKZ1TqQWoj9mQp3EVhSD3FnBs b3gC1Kh3Uqgs705NMb6Ck77sW2JuIUlh/4VC5Kad1YyBFNN3/U8TKAtl0gC5cgsgXEls rzayIrr6d89tmueROPZ29ce7BdW90XC/8ovTuMAAmjKU+ebw4JT2rpU8KjIUHkPPtE9a GEXkPlx7HWmA/CC3Y5pxvFvSu7tHtylkUwQdm0KKnREGifZSPj467q5fL65uKMce3ywo 9FDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=Hh5BX5IanaxD3Ut3WlRRU/Ne+8rcS8h37AkErWrLUz8=; b=oDJkk/KmSZISgZZakCZ5zlQvuOFDOvLxqPOont4WSTib/YmBwHqjQdrNzv2xDOieek sWSJ6K8URwm/U0kdtqN+vyQxEncwMQJ7QrbYLoLnXrXT5gXkfZtPjPQWV6Lq3OzzKPIq T5sWEMOdGjOBxotusMow+x6f3ZTkxzvIqCaE8CHdB0hf4Nt6CL8j3XZo6IDtt3PaJdiJ XxosJpDNTrOuDMHUc6R2Sx0gyzioHImNjgouT2u7fFJqux46dXT7dROMUy52EtMmdaoX FTfxL+Ydj3yL1Zd59Q4j3WHsMz2qvtJLtfOTHGyBJRN+eqMy4Der5AqzGxxo9N3hH46R Cueg== X-Gm-Message-State: AHQUAuZns77pOt78cyzxNurkwmWeJN/y+vN1jw1J4Q88ulnBalC4O2gm KoShwneBAbxohB6q4BguxYAXzjJb X-Google-Smtp-Source: AHgI3IYr3ieVSIpvOfCVvkc6ANNpIpL0SWseohc1khTMXhjZqbpgJAzxp3UwBXgERsZo3U4ncBEOhgyL X-Received: by 2002:a63:7:: with SMTP id 7mr434584pga.52.1549932188765; Mon, 11 Feb 2019 16:43:08 -0800 (PST) Date: Mon, 11 Feb 2019 16:42:46 -0800 In-Reply-To: <20190212004249.219268-1-posk@google.com> Message-Id: <20190212004249.219268-5-posk@google.com> Mime-Version: 1.0 References: <20190212004249.219268-1-posk@google.com> X-Mailer: git-send-email 2.20.1.791.gb4d0f1c61a-goog Subject: [PATCH bpf-next v9 4/7] ipv6_stub: add ipv6_route_input stub/proxy. From: Peter Oskolkov To: Alexei Starovoitov , Daniel Borkmann , netdev@vger.kernel.org Cc: Peter Oskolkov , David Ahern , Willem de Bruijn , Peter Oskolkov Content-Type: text/plain; charset="UTF-8" Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Proxy ip6_route_input via ipv6_stub, for later use by lwt bpf ip encap (see the next patch in the patchset). Signed-off-by: Peter Oskolkov --- include/net/addrconf.h | 1 + net/ipv6/addrconf_core.c | 6 ++++++ net/ipv6/af_inet6.c | 7 +++++++ 3 files changed, 14 insertions(+) diff --git a/include/net/addrconf.h b/include/net/addrconf.h index 20d523ee2fec..269ec27385e9 100644 --- a/include/net/addrconf.h +++ b/include/net/addrconf.h @@ -248,6 +248,7 @@ struct ipv6_stub { const struct in6_addr *addr); int (*ipv6_dst_lookup)(struct net *net, struct sock *sk, struct dst_entry **dst, struct flowi6 *fl6); + int (*ipv6_route_input)(struct sk_buff *skb); struct fib6_table *(*fib6_get_table)(struct net *net, u32 id); struct fib6_info *(*fib6_lookup)(struct net *net, int oif, diff --git a/net/ipv6/addrconf_core.c b/net/ipv6/addrconf_core.c index 5cd0029d930e..6c79af056d9b 100644 --- a/net/ipv6/addrconf_core.c +++ b/net/ipv6/addrconf_core.c @@ -134,6 +134,11 @@ static int eafnosupport_ipv6_dst_lookup(struct net *net, struct sock *u1, return -EAFNOSUPPORT; } +static int eafnosupport_ipv6_route_input(struct sk_buff *skb) +{ + return -EAFNOSUPPORT; +} + static struct fib6_table *eafnosupport_fib6_get_table(struct net *net, u32 id) { return NULL; @@ -170,6 +175,7 @@ eafnosupport_ip6_mtu_from_fib6(struct fib6_info *f6i, struct in6_addr *daddr, const struct ipv6_stub *ipv6_stub __read_mostly = &(struct ipv6_stub) { .ipv6_dst_lookup = eafnosupport_ipv6_dst_lookup, + .ipv6_route_input = eafnosupport_ipv6_route_input, .fib6_get_table = eafnosupport_fib6_get_table, .fib6_table_lookup = eafnosupport_fib6_table_lookup, .fib6_lookup = eafnosupport_fib6_lookup, diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c index d99753b5e39b..2f45d2a3e3a3 100644 --- a/net/ipv6/af_inet6.c +++ b/net/ipv6/af_inet6.c @@ -900,10 +900,17 @@ static struct pernet_operations inet6_net_ops = { .exit = inet6_net_exit, }; +static int ipv6_route_input(struct sk_buff *skb) +{ + ip6_route_input(skb); + return skb_dst(skb)->error; +} + static const struct ipv6_stub ipv6_stub_impl = { .ipv6_sock_mc_join = ipv6_sock_mc_join, .ipv6_sock_mc_drop = ipv6_sock_mc_drop, .ipv6_dst_lookup = ip6_dst_lookup, + .ipv6_route_input = ipv6_route_input, .fib6_get_table = fib6_get_table, .fib6_table_lookup = fib6_table_lookup, .fib6_lookup = fib6_lookup, -- 2.20.1.791.gb4d0f1c61a-goog