From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751968AbbEAUli (ORCPT ); Fri, 1 May 2015 16:41:38 -0400 Received: from mail-pa0-f44.google.com ([209.85.220.44]:34107 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750807AbbEAUlg (ORCPT ); Fri, 1 May 2015 16:41:36 -0400 Message-ID: <1430512894.3711.140.camel@edumazet-glaptop2.roam.corp.google.com> Subject: Re: [PATCH] Allow TCP connections to cache SYN packet for userspace inspection From: Eric Dumazet To: Eric B Munson Cc: Tom Herbert , "David S. Miller" , Alexey Kuznetsov , James Morris , Hideaki YOSHIFUJI , Patrick McHardy , Linux Kernel Network Developers , linux-api@vger.kernel.org, linux-kernel@vger.kernel.org Date: Fri, 01 May 2015 13:41:34 -0700 In-Reply-To: <20150501202908.GC6113@akamai.com> References: <1430502237-5619-1-git-send-email-emunson@akamai.com> <1430505777.3711.135.camel@edumazet-glaptop2.roam.corp.google.com> <20150501201417.GB6113@akamai.com> <1430511800.3711.138.camel@edumazet-glaptop2.roam.corp.google.com> <20150501202908.GC6113@akamai.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2015-05-01 at 16:29 -0400, Eric B Munson wrote: > > > As long as your implementation provides the IP and TCP headers, I would > be happy with that. I am also happy to rework my implementation to > extract and cache information when the request structure is built. If > you all have an implementation that you want to post, I will add my ack > if it meets our needs as well. Yes, I believe it will be easier we provide our implementation instead of reviewing yours ;) For example you had : + case TCP_SAVED_SYN: + if (!((1 << sk->sk_state) & TCPF_LISTEN)) + err = -EINVAL; + tp->saved_syn = !!(val); + break; But if you return an error, tp->saved_syn should be left unchanged.