From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cjT58-0004sO-EH for barebox@lists.infradead.org; Thu, 02 Mar 2017 15:55:59 +0000 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Thu, 2 Mar 2017 16:55:28 +0100 Message-Id: <20170302155528.20781-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH] tftp: implement forward seeking To: barebox@lists.infradead.org SnVzdCBhYnVzZSB0ZnRwX3JlYWQgdG8gc3RlcCBmb3J3YXJkLgoKU2lnbmVkLW9mZi1ieTogVXdl IEtsZWluZS1Lw7ZuaWcgPHUua2xlaW5lLWtvZW5pZ0BwZW5ndXRyb25peC5kZT4KLS0tCiBmcy90 ZnRwLmMgfCAyNSArKysrKysrKysrKysrKysrKysrKysrKy0tCiAxIGZpbGUgY2hhbmdlZCwgMjMg aW5zZXJ0aW9ucygrKSwgMiBkZWxldGlvbnMoLSkKCmRpZmYgLS1naXQgYS9mcy90ZnRwLmMgYi9m cy90ZnRwLmMKaW5kZXggNTZkNDM2NWQ3NzNhLi4yNzJhNzEwNmViNTEgMTAwNjQ0Ci0tLSBhL2Zz L3RmdHAuYworKysgYi9mcy90ZnRwLmMKQEAgLTU5MSw4ICs1OTEsMjkgQEAgc3RhdGljIGludCB0 ZnRwX3JlYWQoc3RydWN0IGRldmljZV9kICpkZXYsIEZJTEUgKmYsIHZvaWQgKmJ1Ziwgc2l6ZV90 IGluc2l6ZSkKIAogc3RhdGljIGxvZmZfdCB0ZnRwX2xzZWVrKHN0cnVjdCBkZXZpY2VfZ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