From owner-freebsd-net@freebsd.org Sat Jan 21 08:12:46 2017 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2D35CBB745 for ; Sat, 21 Jan 2017 08:12:46 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: from reviews.nyi.freebsd.org (reviews.nyi.freebsd.org [IPv6:2610:1c1:1:607c::16:b]) by mx1.freebsd.org (Postfix) with ESMTP id 9F36315B3 for ; Sat, 21 Jan 2017 08:12:46 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: by reviews.nyi.freebsd.org (Postfix, from userid 1346) id 99500304C7; Sat, 21 Jan 2017 08:12:45 +0000 (UTC) Date: Sat, 21 Jan 2017 08:12:45 +0000 To: freebsd-net@freebsd.org From: "ale (Alex Dupre)" Reply-to: D9270+325+bbd470fd257eef1b@reviews.freebsd.org Subject: [Differential] D9270: Add support for user-supplied Host-Uniq tag in Netgraph PPPoE Message-ID: X-Priority: 3 X-Phabricator-Sent-This-Message: Yes X-Mail-Transport-Agent: MetaMTA X-Auto-Response-Suppress: All X-Phabricator-Mail-Tags: , , , Thread-Topic: D9270: Add support for user-supplied Host-Uniq tag in Netgraph PPPoE X-Herald-Rules: <28>, <8> X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-Cc: X-Phabricator-Cc: X-Phabricator-Cc: Precedence: bulk Thread-Index: NTZkNjQzYWQxOGQ3MGJlZTIzOGZhZmQ4NGNm MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="b1_ef54bcc72775c6f9b6c4c9e9af2c7489" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.23 List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2017 08:12:47 -0000 --b1_ef54bcc72775c6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YyByZXBvc2l0b3J5CgpSRVZJU0lPTiBERVRBSUwKICBodHRwczovL3Jldmll d3MuZnJlZWJzZC5vcmcvRDkyNzAKCkFGRkVDVEVEIEZJTEVTCiAgc2hhcmUvbWFuL21hbjQvbmdf cHBwb2UuNAogIHN5cy9uZXRncmFwaC9uZ19wcHBvZS5jCgpFTUFJTCBQUkVGRVJFTkNFUwogIGh0 dHBzOi8vcmV2aWV3cy5mcmVlYnNkLm9yZy9zZXR0aW5ncy9wYW5lbC9lbWFpbHByZWZlcmVuY2Vz LwoKVG86IGFsZSwgI25ldHdvcmssICNtYW5wYWdlcywganVsaWFuCkNjOiBtYW5kcmVlLCBpbXAs IGZyZWVic2QtbmV0LWxpc3QK --b1_ef54bcc72775c6f9b6c4c9e9af2c7489 Content-Type: text/x-patch; charset=utf-8; name="D9270.24264.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="D9270.24264.patch" ZGlmZiAtLWdpdCBhL3N5cy9uZXRncmFwaC9uZ19wcHBvZS5jIGIvc3lzL25ldGdyYXBoL25nX3Bw cG9lLmMKLS0tIGEvc3lzL25ldGdyYXBoL25nX3BwcG9lLmMKKysrIGIvc3lzL25ldGdyYXBoL25n X3BwcG9lLmMKQEAgLTIyNiw5ICsyMjYsMTEgQEAKIAljb25zdCBzdHJ1Y3QgcHBwb2VfdGFnCSp0 YWdzW05VTVRBR1NdOwogCXVfaW50CQkJc2VydmljZV9sZW47CiAJdV9pbnQJCQlhY19uYW1lX2xl bjsKKwl1X2ludAkJCWhvc3RfdW5pcV9sZW47CiAKIAlzdHJ1Y3QgZGF0YXRhZwkJc2VydmljZTsK IAlzdHJ1Y3QgZGF0YXRhZwkJYWNfbmFtZTsKKwlzdHJ1Y3QgZGF0YXRhZwkJaG9zdF91bmlxOwog fTsKIHR5cGVkZWYgc3RydWN0IHNlc3NfbmVnICpuZWdwOwogCkBAIC01ODksMTggKzU5MSwyMCBA QAogcHBwb2VfZmluZHVuaXEobm9kZV9wIG5vZGU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