From owner-svn-src-head@freebsd.org Sun Aug 19 16:35:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7D07106F239; Sun, 19 Aug 2018 16:35:58 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f44.google.com (mail-it0-f44.google.com [209.85.214.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 846647E722; Sun, 19 Aug 2018 16:35:58 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f44.google.com with SMTP id h20-v6so17590688itf.2; Sun, 19 Aug 2018 09:35:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=GDqXvpkDlROCF/MH0K8NVH7U02FZKuvmsWhNsXxPXaM=; b=kvlJJKXMR2IGkGStzLM7TQ2MzgUXsePftBRPQO2CsxKU0aXKnZNvq9Uy5D0xSPnYdN 0tnZxuoeE1VBWyB4tZDCAluBvlgBD9uoyjH6Zx02oEMvukJJANtuFMfSiGdF/F12spEc n+mGqvEHUWxvTh3NUwTcvJ7RERyn7KvzOwc2UdshYGMDOUKS7Pi7AscUkg5A0khI9pDM u9BypbqCWUGy4ueF/rsZ2kxP0mUdQJx4yoEPStCBXkiXgMFDFrfl7jrURygp1YkS85vv hwNegSD44YLqJBeUDWdb29cCaqBjcd1rqkf/moZVqlse0HmeTg4YPGF3SLVWEl3iNUo8 xrDA== X-Gm-Message-State: AOUpUlELOxQSAqgQYf67gIhjRtxHL3bsg/EF+keJH9mpYT0kZKUQDlFL NF73VnJxc7mauSFCKsKQCXIr0Hrt X-Google-Smtp-Source: AA+uWPxkjMFG8LXN+Q62DJSzLRjxOQThH+nF/1wYkJniZ20SnPsO0faUjxW1MBntkRCBJPxg0J26zQ== X-Received: by 2002:a02:7808:: with SMTP id p8-v6mr1736818jac.103.1534696557438; Sun, 19 Aug 2018 09:35:57 -0700 (PDT) Received: from mail-io0-f175.google.com (mail-io0-f175.google.com. [209.85.223.175]) by smtp.gmail.com with ESMTPSA id e135-v6sm4259047ita.28.2018.08.19.09.35.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 19 Aug 2018 09:35:57 -0700 (PDT) Received: by mail-io0-f175.google.com with SMTP id y10-v6so10698485ioa.10; Sun, 19 Aug 2018 09:35:57 -0700 (PDT) X-Received: by 2002:a6b:be46:: with SMTP id o67-v6mr34975471iof.143.1534696557013; Sun, 19 Aug 2018 09:35:57 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 2002:a02:b472:0:0:0:0:0 with HTTP; Sun, 19 Aug 2018 09:35:56 -0700 (PDT) In-Reply-To: <201808191456.w7JEuAZE069780@repo.freebsd.org> References: <201808191456.w7JEuAZE069780@repo.freebsd.org> From: Conrad Meyer Date: Sun, 19 Aug 2018 09:35:56 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r338053 - head/sys/netinet To: Michael Tuexen Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2018 16:35:59 -0000 On Sun, Aug 19, 2018 at 7:56 AM, Michael Tuexen wrote: > Author: tuexen > Date: Sun Aug 19 14:56:10 2018 > New Revision: 338053 > URL: https://svnweb.freebsd.org/changeset/base/338053 > > Log: > =E2=80=A6 a keyed hash function taking > the source and destination addresses and port numbers into account. > The keyed hash function is the same a used for the initial TSN. > ... > Modified: head/sys/netinet/tcp_subr.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/netinet/tcp_subr.c Sun Aug 19 14:48:32 2018 (r338052) > +++ head/sys/netinet/tcp_subr.c Sun Aug 19 14:56:10 2018 (r338053) > @@ -233,6 +233,9 @@ VNET_DEFINE(uma_zone_t, sack_hole_zone); > ... > > +static uint32_t > +tcp_keyed_hash(struct in_conninfo *inc, u_char *key) > +{ > + MD5_CTX ctx; > + uint32_t hash[4]; > > + MD5Init(&ctx); > + MD5Update(&ctx, &inc->inc_fport, sizeof(uint16_t)); > + MD5Update(&ctx, &inc->inc_lport, sizeof(uint16_t)); > + switch (inc->inc_flags & INC_ISIPV6) { > +#ifdef INET > + case 0: > + MD5Update(&ctx, &inc->inc_faddr, sizeof(struct in_addr)); > + MD5Update(&ctx, &inc->inc_laddr, sizeof(struct in_addr)); > + break; > +#endif > +#ifdef INET6 > + case INC_ISIPV6: > + MD5Update(&ctx, &inc->inc6_faddr, sizeof(struct in6_addr)= ); > + MD5Update(&ctx, &inc->inc6_laddr, sizeof(struct in6_addr)= ); > + break; > +#endif > + } > + MD5Update(&ctx, key, 32); > + MD5Final((unsigned char *)hash, &ctx); > + > + return (hash[0]); Hi Michael, How was this particular keyed hash function construction chosen? (Yes, I see it is the same initial TSN, but how was that selected?) Thanks, Conrad