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 727B6C282CA for ; Wed, 13 Feb 2019 19:53:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4722F20675 for ; Wed, 13 Feb 2019 19:53:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="MErC0Hr2" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2436574AbfBMTx6 (ORCPT ); Wed, 13 Feb 2019 14:53:58 -0500 Received: from mail-it1-f201.google.com ([209.85.166.201]:51358 "EHLO mail-it1-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726291AbfBMTx5 (ORCPT ); Wed, 13 Feb 2019 14:53:57 -0500 Received: by mail-it1-f201.google.com with SMTP id r85so5949733itc.1 for ; Wed, 13 Feb 2019 11:53:57 -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=MErC0Hr293lkgQQgy8TLpDpq4WumHBLQIai/33pjtlCvAKg/qQ1kVAVqSpX3JGyLFv DnUmbGu7yWdi+3hF3tZMYMeAiPz7nYj/9po1YQExUAPlMf0TumL7R6PAGzAaKTXqSYVa ojg1XIT1rruQN/cbW2sC7t1T2FPNaVgIn1liFc/g8gV21Yr1p5b2TKpN2BRWBJkzrnxD M8lro53bxk3Wxq4gOBUefXq8G4iand0V6NNgwgCOwsZ13Mwpp4S9njgyPF7LCO1ISt+v G5+xck3DTU5YvCmVIANICLk6+nFiYF7HJG5syrLHini59yOVJ2a7ElHRu/5MhU5dR6vF SBIw== 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=MSpBDHTd8LgLieEd71d+8xBqx1wMjBGURpOqIefr0e3Rx5G78ruuAzvyiGp5/WU+so 79r4cJLEU9vUyKPvfntbc7yt+d/hy/Spu6CQ8wFhtTzlfzCDGJQ4278WXtli/Ts+Iezj hOHw7SfFvOt/C+LwNwcLzjTKYuPPokCkbJbEsDr2jlDi6N9Zm3aGMRNUX6J/51CCpCjs s1LxgNiJg5+SABTl0RH0jk9xaPbXEzMOE24/B21lsTW9RTWB1YUjof9/fZlXXET/NqH0 a0nP4qHLHWYwJlimiVKVUUegPIL94wi5Kq0P945yURbR24TNyJ4y7rfptylhuQfGqFCM YuvQ== X-Gm-Message-State: AHQUAuZoVSj4Po6zbrqoidmo9DKmlUB/uoL4hQTNhE6foJyj3/TzMOHD TQ/e5QMEYYnVASlk04f5H8scwbWp X-Google-Smtp-Source: AHgI3IY6VzPgi+bZw9cgdZgnVZXKE8qPZRbw24EpsyyN+iSsIjYaSrR7GftTXxWttQapafsBQnVGquAW X-Received: by 2002:a24:ed8c:: with SMTP id r134mr1346260ith.30.1550087636718; Wed, 13 Feb 2019 11:53:56 -0800 (PST) Date: Wed, 13 Feb 2019 11:53:38 -0800 In-Reply-To: <20190213195341.184969-1-posk@google.com> Message-Id: <20190213195341.184969-5-posk@google.com> Mime-Version: 1.0 References: <20190213195341.184969-1-posk@google.com> X-Mailer: git-send-email 2.20.1.791.gb4d0f1c61a-goog Subject: [PATCH bpf-next v11 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