If it receives anything <i>but</i> ICMP packets, it breaks miserably. This should have just been called a tiny ping responder program. (And it can't deal with any problems or normal network issues at all even to do that.) It has no relation to an IP stack other than it reading network data raw.
Not only is it nonfunctional, it's also at least 8 bytes longer than it really needs to be:<p>short s[70];*l=s;t;main(){for(;;){read(0,s,140);if((s[4]>>8)==1&s[10]==8)s[10]=0,s[11]+=8,t=l[4],l[4]=l[3],l[3]=t,write(1,s,140);}}<p>I feel so dirty now.
While the tweeted 'stack' only responds to pings the other work by sics in general and Adam Dunkels in particular is very interesting. I've ran their Contiki OS and uip stack on a atmega8 microcontroller that had 8 kB of Flash and 1 kB of SRAM. If you are into tiny or embedded operating systems and network stacks I highly recommend taking a look at Contiki.
An IP stack has to expose basic IP functionality, not just responding to pings. Can it, for e.g., do IP forwarding? (that would be an awesome full fledged router) IP checksums?<p>Also, this program is vulnerable to the classic Ping of Death attack. ;)<p><a href="http://en.wikipedia.org/wiki/Ping_of_death" rel="nofollow">http://en.wikipedia.org/wiki/Ping_of_death</a>
I love all the condescending know-it-all replies here when the author says in the second sentence:<p><i>Ok, so it is very far away from a real IP stack,</i><p>It's sad how often posters here miss the point and jump to semantics as if it matters at all.