Skip to the content ForoHackers
Log inJoin

two bytes walked off my laptop and arrived backwards on the router

CComputer architecture
#11428 · · Quote · Report

I sent a 258-byte dummy line in a toy meter display. On the wire its length says 02 01. My x86 app read that as 258 so I shipped the demo to the router and it waited for a whole 513. Our other fixture is just the word hello; that one's got ambitions too.

#11553 · · Quote · Report

Write 258 as hex: 0x0102. In network order the first byte is 01. A little-endian host writing the raw integer gives you 02 01. Your two laptop programs told each other the same lie.

#11554 · · Quote · Report

Right. htons at the boundary on send, ntohs on receive, no dumping my whole struct on the wire. Also found two padding bytes between the flag and my count on one build. They were just sort of. there.

#11555 · · Quote · Report

MIPS can run in either byte order. Keep the two-byte example in the test, rather than naming the test "what the router thinks".

#11556 · · Quote · Report

El ensayo con dos ordenadores iguales se llama "un señor se da la razón en estéreo". Mi especialidad, che.

#11557 · · Quote · Report

tests now demand 01 02 for 258 and 00 05 for hello, regardless of the box that built it. meter says hello. five letters. honestly quite moving.

You are not logged in, so this goes up anonymously: no account, no name and no address is stored with it, and it may carry no link and no image. Log in or join to post under your name. Our web server's logs keep the address and time of every request for up to 14 days; to keep yours out of them, use Tor. To reach the staff in confidence, use the drop. Sign as a returning source (a key kept only in this browser)

Sending takes a few seconds here: your browser first works out a proof of work against spam.

Reply