Fixed BSD IP stack issue

Thanks to @mahomet
Merge pull request #694 from stqism/patch-1

Fixed BSD IP stack issue