From: Pete Zaitcev Subject: Re: [PATCH 2/3] CLD: switch network proto from UDP to TCP Date: Sun, 2 Jan 2011 16:32:32 -0700 Message-ID: <20110102163232.78eec2f3@lembas.zaitcev.lan> References: <20101231105634.GA4210@havoc.gtf.org> <20101231105728.GA4239@havoc.gtf.org> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20101231105728.GA4239@havoc.gtf.org> Sender: hail-devel-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="us-ascii" To: Jeff Garzik Cc: hail-devel@vger.kernel.org On Fri, 31 Dec 2010 05:57:28 -0500 Jeff Garzik wrote: > + struct cldc_tcp *tcp = private; > + ssize_t rc; > + struct ubbp_header ubbp; > + > + memcpy(ubbp.magic, "CLD1", 4); > + ubbp.op_size = (buflen << 8) | 1; > +#ifdef WORDS_BIGENDIAN > + swab32(ubbp.op_size); > +#endif > + > + rc = write(tcp->fd, &ubbp, sizeof(ubbp)); Why not this: unsigned int n; n = (buflen << 8) | 1; ubbp.op_size = GUINT32_TO_LE(n); -- P