OS X compilation fixes

These somewhat ugly commits allow a somewhat successful compilation on OS X (after commenting out PPPOE support which is left as an exercise to the reader).