From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by passt.top (Postfix, from userid 1000) id 2A6A65A0319; Tue, 23 Jul 2024 00:09:37 +0200 (CEST) From: Stefano Brivio To: passt-dev@passt.top Subject: [PATCH v2] tcp: probe for SO_PEEK_OFF both in tcpv4 and tcp6 Date: Tue, 23 Jul 2024 00:09:37 +0200 Message-ID: <20240722220937.3663437-1-sbrivio@redhat.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Message-ID-Hash: XENI45JSXWX3B7B3BPTN3A2L5XWPLHG7 X-Message-ID-Hash: XENI45JSXWX3B7B3BPTN3A2L5XWPLHG7 X-MailFrom: sbrivio@passt.top X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Jon Maloy X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: RnJvbTogSm9uIE1hbG95IDxqbWFsb3lAcmVkaGF0LmNvbT4NCg0KQmFzZWQgb24gYW4gb3JpZ2lu YWwgcGF0Y2ggYnkgSm9uIE1hbG95Og0KDQotLQ0KVGhlIHJlY2VudGx5IGFkZGVkIHNvY2tldCBv cHRpb24gU09fUEVFS19PRkYgaXMgbm90IHN1cHBvcnRlZCBmb3INClRDUC9JUHY2IHNvY2tldHMu IFVudGlsIHdlIGdldCB0aGF0IHN1cHBvcnQgaW50byB0aGUga2VybmVsIHdlIG5lZWQgdG8NCnRl c3QgZm9yIHN1cHBvcnQgaW4gYm90aCBwcm90b2NvbHMgdG8gc2V0IHRoZSBnbG9iYWwgJ3BlZWtf b2Zmc2V0X2NhcMK0DQp0byB0cnVlLg0KLS0NCg0KQ29tcGFyZWQgdG8gdGhlIG9yaWdpbmFsIH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