From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mx1.emlix.com ([188.40.240.192]) by casper.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jpznv-0005ps-EE for barebox@lists.infradead.org; Mon, 29 Jun 2020 19:51:02 +0000 References: <20200619074427.17289-1-s.hauer@pengutronix.de> <20200619074427.17289-18-s.hauer@pengutronix.de> From: =?UTF-8?Q?Daniel_Gl=c3=b6ckner?= Message-ID: <70810c58-b4f1-945d-fffa-c79083a03c48@emlix.com> Date: Mon, 29 Jun 2020 21:50:51 +0200 MIME-Version: 1.0 In-Reply-To: <20200619074427.17289-18-s.hauer@pengutronix.de> Content-Language: de-DE 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: Re: [PATCH 17/21] fastboot net: implement fastboot over UDP To: Sascha Hauer , Barebox List Cc: Edmund Henniges SGVsbG8gU2FzY2hhLAoKQW0gMTkuMDYuMjAgdW0gMDk6NDQgc2NocmllYiBTYXNjaGEgSGF1ZXI6 Cj4gK3N0cnVjdCBmYXN0Ym9vdF9uZXQgewo+ICsJc3RydWN0IGZhc3Rib290IGZhc3Rib290Owo+ ICsKPiArCXN0cnVjdCBuZXRfY29ubmVjdGlvbiAqbmV0X2NvbjsKPiArCXN0cnVjdCBmYXN0Ym9v dF9oZWFkZXIgcmVzcG9uc2VfaGVhZGVyOwo+ICsJc3RydWN0IHBvbGxlcl9zdHJ1Y3QgcG9sbGVy Owo+ICsJc3RydWN0IHdvcmtfcXVldWUgd3E7Cj4gKwl1NjQgaG9zdF93YWl0c19zaW5jZTsKPiAr CXU2NCBsYXN0X2Rvd25sb2FkX3BrdDsKPiArCWJvb2wgc2VxdWVuY2VfbnVtYmVyX3NlZW47Cj4g Kwlib29sIGFjdGl2ZV9kb3dubG9hZDsKPiArCW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