August 31, 2008

Linux + netfilter FTW!

I have a Motorola WPS870G 802.11g print server that's served me well for several years. Unlike most wireless print servers available, it's got a parallel port, which means it talks to my trusty old HP LaserJet 1100A.

Trouble is, when we got our NAS a while back, I enabled Jumbo Frames for better perf and discovered that the network stack on said print server barfs in the face of jumbo frames. This afternoon, wanting to print something, I decided I was going to fix this.

A bit of goggling later, and I found another reason to love and respect iptables (I first learned to fear it when Titus and I wrote a netfilter plugin to do TCP socket migration whist in grad school):

$ sudo /sbin/iptables -t mangle -A OUTPUT -p tcp --tcp-flags SYN,RST SYN -d 192.168.0.5 -j TCPMSS --set-mss 1460

Viola.

Now if only someone could tell me how to do that under OS X I could enable Jumbo Frames on Nise's mac, and make Time Machine backups way lots faster...

Posted by dberger at 2:29 PM | Comments (0)

August 30, 2008

An evening gone sideways

Last night I decided, somewhat on a whim, to shuffle around some furniture. We have two sets of sofas - one set that in the game room, and one in the front room - and I wanted to swap them; both to change up the look of the room, and because we use the ones in the front room more often, so spreading wear more evenly seemed like a good idea.

Continue reading "An evening gone sideways"

Posted by dberger at 5:46 PM | Comments (0)

August 26, 2008

So frustrating...

I've been working on porting a sizable body of existing code to OS X of late, and the last week has been incredibly frustrating.

I've discovered that OS X (10.5.4) doesn't correctly support poll(2) on fifo's, and also doesn't support aio_read/aio_write to sockets, and doesn't document either limitation anywhere aside from the kernel source.

The poll issue was easy enough to work around, once I wasted time figuring out it didn't work, but the aio one looks to be harder.

And to add insult to injury, the misbehavior in poll goes against the POSIX spec, which says "The poll() function shall support regular files, terminal and pseudo-terminal devices, FIFOs, pipes, sockets and...") and the Apple man page is just plain wrong about aio_write/aio_read - the enqueue call for aio operations against a socket return EINVAL - but none of the three conditions listed on the man page are the cause.

Posted by dberger at 6:11 PM | Comments (0)