From owner-freebsd-net Thu Jun 25 16:13:29 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id QAA19343 for freebsd-net-outgoing; Thu, 25 Jun 1998 16:13:29 -0700 (PDT) (envelope-from owner-freebsd-net@FreeBSD.ORG) Received: from alpha.xerox.com (omega.Xerox.COM [13.1.64.95]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id QAA19237 for ; Thu, 25 Jun 1998 16:12:42 -0700 (PDT) (envelope-from fenner@parc.xerox.com) Received: from mango.parc.xerox.com ([13.1.102.232]) by alpha.xerox.com with SMTP id <40744(1)>; Thu, 25 Jun 1998 16:11:59 PDT Received: from mango.parc.xerox.com (localhost [127.0.0.1]) by mango.parc.xerox.com (8.8.8/8.8.8) with ESMTP id QAA15301; Thu, 25 Jun 1998 16:11:51 -0700 (PDT) (envelope-from fenner@mango.parc.xerox.com) Message-Id: <199806252311.QAA15301@mango.parc.xerox.com> To: Nate Lawson cc: fenner@parc.xerox.com (Bill Fenner), julian@whistle.com, freebsd-net@FreeBSD.ORG Subject: Re: Apparent bug in sendto() with raw sockets In-reply-to: Your message of "Thu, 25 Jun 1998 15:20:43 PDT." <199806252220.PAA28609@almond.elite.net> Date: Thu, 25 Jun 1998 16:11:51 PDT From: Bill Fenner Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org [I removed -bugs from the CC] I take it back. I think a socket option could work. As your friend suggested, byte order could be auto-determined, not just via "ip_len > 32767" but by comparing the ip_len with the length of the packet that was written and turning on the automagic byte swap socket option if ip_len == htonl(send len). This is kind of hokey magic, since if the output side set the socket option automagically, the input side would be affected too. If you output before you input, everything would be in the order you'd expect. If you input first, then output, then input, you could get awfully confused since the input behavior would change after the first output. (And if the output side didn't set the socket flag that affected input, then a program written to assume no byte swapping would end up with non-byte-swapped output but byte-swapped (and otherwise munged) input...) I'll work on a patch. Bill To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message