From patchwork Fri Feb 22 09:50:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenz Bauer X-Patchwork-Id: 1046700 X-Patchwork-Delegate: bpf@iogearbox.net 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=pass (p=quarantine dis=none) header.from=cloudflare.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=cloudflare.com header.i=@cloudflare.com header.b="V3N14/q9"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 445RSH12hkz9s8m for ; Fri, 22 Feb 2019 20:51:27 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726669AbfBVJvZ (ORCPT ); Fri, 22 Feb 2019 04:51:25 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:38869 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726524AbfBVJvY (ORCPT ); Fri, 22 Feb 2019 04:51:24 -0500 Received: by mail-wr1-f65.google.com with SMTP id v13so1660846wrw.5 for ; Fri, 22 Feb 2019 01:51:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloudflare.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YabdbcrSlubQ9RvGpE5tgXpCcWHKdXclbg3c5+uVJVA=; b=V3N14/q9KaRBysatSpkyXD9j38wgqWKO2neSF7EZ9GkLPvLPcH1XMogOh97iuQ0y3X 53OSJqXBH7zqtyTYJDnWUzKHash1rCU6/jEl3gRDw0D6WaNK2Az2Ig7VVXZPLaVqExqA gJd3/aThwbKzB0K4uYKQP2/fRLmSMuSTNKfys= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=YabdbcrSlubQ9RvGpE5tgXpCcWHKdXclbg3c5+uVJVA=; b=mU/ialbhAveZzQ+RqS+kI1BHYTaHF6OpyH8kFNd3WjrEOsiWAsBMNJkTVvAFUVuKK3 R3SKc9XNbI59QztObeTez5zEk8vyl5tbtYYSjfPmsSWlDNAA//k9SvMgQz2rSSoGubzl Szt266pwR+EumX9kG/8UaCEHBvdNQ4ICP0fTVlbGgH0EHAGBUF4uOE3293esfPWRxy6j MqjrgxnjNrI0v/4+08rmB+Bjm5TFym8z/i1vYUqSyavSkNtVIkKdNm8H5q15w9hVRrQd gIaen4B0HjS+rnrQlTFBTtKvWz+mgkVj7ZqKJRWLPQlAD+98LsfIx7ptFxthM3gYASq/ SLng== X-Gm-Message-State: AHQUAuYU6hgx6c1Q2CjW4hxyd6tbCD4DJQWgu26CF+CzJcuT75FYMtOo JZCayPFPvNW/GWlR8CCJVkUm3Q== X-Google-Smtp-Source: AHgI3IaLNJQ6vM0MKRoB8a7ZojQRw1xR7u3TXn/nGFD25A/y5IeIMkeE1OZLiXRv5s1AGGz1EjTcjA== X-Received: by 2002:adf:f3d0:: with SMTP id g16mr2213506wrp.29.1550829082813; Fri, 22 Feb 2019 01:51:22 -0800 (PST) Received: from localhost.localdomain (9.6.e.f.2.f.3.d.e.1.8.a.3.e.5.2.0.0.0.0.3.c.c.0.0.b.8.0.1.0.0.2.ip6.arpa. [2001:8b0:cc3:0:25e3:a81e:d3f2:fe69]) by smtp.gmail.com with ESMTPSA id f68sm2680492wmg.5.2019.02.22.01.51.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Feb 2019 01:51:22 -0800 (PST) From: Lorenz Bauer To: ast@kernel.org, daniel@iogearbox.net, netdev@vger.kernel.org Cc: linux-api@vger.kernel.org, Lorenz Bauer Subject: [PATCH 2/3] tools: sync changes to uapi/linux/bpf.h Date: Fri, 22 Feb 2019 09:50:56 +0000 Message-Id: <20190222095057.9442-3-lmb@cloudflare.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190222095057.9442-1-lmb@cloudflare.com> References: <20190222095057.9442-1-lmb@cloudflare.com> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Pull in definitions for bpf_sk_check_syncookie. Signed-off-by: Lorenz Bauer --- tools/include/uapi/linux/bpf.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h index bcdd2474eee7..bc2af87e9621 100644 --- a/tools/include/uapi/linux/bpf.h +++ b/tools/include/uapi/linux/bpf.h @@ -2359,6 +2359,21 @@ union bpf_attr { * Return * A **struct bpf_tcp_sock** pointer on success, or NULL in * case of failure. + * + * int bpf_sk_check_syncookie(struct bpf_sock *sk, void *iph, u32 iph_len, struct tcphdr *th, u32 th_len) + * Description + * Check whether iph and th contain a valid SYN cookie ACK for + * the listening socket in sk. + * + * iph points to the start of the IPv4 or IPv6 header, while + * iph_len contains sizeof(struct iphdr) or sizeof(struct ip6hdr). + * + * th points to the start of the TCP header, while th_len contains + * sizeof(struct tcphdr). + * + * Return + * 0 if iph and th are a valid SYN cookie ACK, or a negative error + * otherwise. */ #define __BPF_FUNC_MAPPER(FN) \ FN(unspec), \ @@ -2457,7 +2472,8 @@ union bpf_attr { FN(spin_lock), \ FN(spin_unlock), \ FN(sk_fullsock), \ - FN(tcp_sock), + FN(tcp_sock), \ + FN(sk_check_syncookie), /* integer value in 'imm' field of BPF_CALL instruction selects which helper * function eBPF program intends to call