From: Shawn Landden Subject: Re: AF_ALG buggy with sendfile Date: Sun, 24 Nov 2013 14:00:12 -0800 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=047d7b41402e263c8804ebf35f1d To: Linux Kernel Mailing List , netdev@vger.kernel.org, herbert@gondor.apana.org.au, linux-crypto@vger.kernel.org Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-crypto.vger.kernel.org --047d7b41402e263c8804ebf35f1d Content-Type: text/plain; charset=ISO-8859-1 heres a version of the test case that builds..... Sorry about that. On Sun, Nov 24, 2013 at 9:21 AM, Shawn Landden wrote: > If I use sendfile() to send to a accept()ed AF_ALG socket set up for > "hash", I get the wrong > answer, if I read() and then write() I get the right answer. None of > the system calls return an error. > > test case attached. > > -- > > --- > Shawn Landden > +1 360 389 3001 (SMS preferred) -- --- Shawn Landden +1 360 389 3001 (SMS preferred) --047d7b41402e263c8804ebf35f1d Content-Type: text/x-csrc; charset=US-ASCII; name="af_alg.c" Content-Disposition: attachment; filename="af_alg.c" Content-Transfer-Encoding: base64 X-Attachment-Id: f_hoetxq0r1 CiNpbmNsdWRlIDxzeXMvc2VuZGZpbGUuaD4KI2luY2x1ZGUgPHN5cy9zb2NrZXQuaD4KI2luY2x1 ZGUgPGxpbnV4L2lmX2FsZy5oPgojaW5jbHVkZSA8c3RkaW8uaD4KI2luY2x1ZGUgPHN5cy9zdGF0 Lmg+CiNpbmNsdWRlIDxmY250bC5oPgojaW5jbHVkZSA8c3RkbGliLmg+CiNpbmNsdWRlIDx1bmlz dGQuaD4KaW50IG1haW4odm9pZCkKewoJaW50IG9wZmQ7CglpbnQgdGZtZmQ7CglzdHJ1Y3Qgc29j a2FkZHJfYWxnIHNhID0gewoJCS5zYWxnX2ZhbWlseSA9IEFGX0FMRywKCQkuc2FsZ190eXBlID0g Imhhc2giLAoJCS5zYWxnX25hbWUgPSAic2hhMSIKCX07CgljaGFyICpidWYyOwoJY2hhciBidWZb MjBdOwoJaW50I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