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 3A7DCC282C4 for ; Tue, 12 Feb 2019 17:33:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0C4F420821 for ; Tue, 12 Feb 2019 17:33:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="ua4DIp+c" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731003AbfBLRdI (ORCPT ); Tue, 12 Feb 2019 12:33:08 -0500 Received: from mail-pl1-f202.google.com ([209.85.214.202]:47499 "EHLO mail-pl1-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730979AbfBLRdH (ORCPT ); Tue, 12 Feb 2019 12:33:07 -0500 Received: by mail-pl1-f202.google.com with SMTP id a10so2686591plp.14 for ; Tue, 12 Feb 2019 09:33:07 -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=ua4DIp+cF93pl/eNajPGNSG+MNK8T0qrZ5FDgg4XlC2qcxryudjoLT1ixW03Ld6zN4 Ld5KQSPY3j8aaydAk4TYq/yNnlwmlW1JIG244bW/nI5bzabJ/oP8VJwCyCg6dzh25r8P iFZVNQH+Ej+NZ8mciAsdrwjH9eaRJDBs6V8cIF/re3ticl5f0Xy4TR1Nef2Di7QCQLsl uczhVHyWAqQ8VzEfzvvdrJMLiydGw/mDzOCU6Oa7wH2977fH82wiTf7uzfBTiUTLg0Dw WtYeaWcRQDkWqr577ioRtO0GYetD8S3BLpWS4a2hGrtmezFzhypOSfqz+nrl3AMaOOPX CFWg== 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=n/pFpD5VIHNwOhgIbWwv62amaYSquyVOv4lz75nuRxsj9ejppncrPdSDSRbCjI14NB rowXarmpiEDKw7xGOYn896pqwnlMe7xHIFNcTIv+RlD46mIWIruXXObkgI4PBftVl2mu pTopDAq3Fxe1rZjr35BzuTbu8b0s2K+jndjuqC7r9gMJWcJmREHgs+wuJptNNRMHZWM1 6QrFzAB6c1vqrPeFO8su/XP0D61kwmhGVIpy7UkpgBpGHc1cTE6zl51ReGy2OXyQyqZv 9zgHaNvapGKpfDRyg7fVF5LiiK8n3XOJCcfLcF3wcVV243SloOQDi8MDVRjbcPrL76KK LPNg== X-Gm-Message-State: AHQUAuZ+qsAxgzaeDylm5tnmAjKVEIO8iuym2QsYFjjazFPG3DuQAM/r z0UjK/ONTH0SySvUH3xMDOnaisqx X-Google-Smtp-Source: AHgI3IZYMzAZ2plp0vkDtf83XU/nh8ZK/sgkVV+ZEoszFnA1vWwLDIUPqFNgP3IOxBFkAIm1T41qJOI9 X-Received: by 2002:a65:478b:: with SMTP id e11mr1790068pgs.62.1549992786892; Tue, 12 Feb 2019 09:33:06 -0800 (PST) Date: Tue, 12 Feb 2019 09:32:44 -0800 In-Reply-To: <20190212173247.121342-1-posk@google.com> Message-Id: <20190212173247.121342-5-posk@google.com> Mime-Version: 1.0 References: <20190212173247.121342-1-posk@google.com> X-Mailer: git-send-email 2.20.1.791.gb4d0f1c61a-goog Subject: [PATCH bpf-next v10 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