diff --git a/Network/Socket/Msg.hs b/Network/Socket/Msg.hs
--- a/Network/Socket/Msg.hs
+++ b/Network/Socket/Msg.hs
@@ -45,7 +45,6 @@
 -- The last argument is a list of control parameters (see cmsg(3) for details).
 sendMsg :: Socket -> B.ByteString -> SockAddr -> [CMsg] -> IO ()
 sendMsg sock@(MkSocket sockfd _ _ _ _) bytes sa cmsgs = void $ allocaBytes bufSz $ \bufPtr -> do
-        zeroBytes bufPtr bufSz
         let saPtr = castPtr bufPtr
         let iovPtr = plusPtr saPtr $ sizeOfSockAddr sa
         let msgPtr = plusPtr iovPtr $ sizeOf (undefined :: IOVec)
diff --git a/Network/Socket/Msg/CMsgHdr.hsc b/Network/Socket/Msg/CMsgHdr.hsc
--- a/Network/Socket/Msg/CMsgHdr.hsc
+++ b/Network/Socket/Msg/CMsgHdr.hsc
@@ -41,14 +41,29 @@
     sizeOf _ = (#const sizeof(struct cmsghdr))
     alignment _ = alignment (undefined :: CInt)
 
+    -- XXX: The following ifdefs are needed because on Linux
+    -- cmsg_len has type size_t which is twice as large as
+    -- socklen_t.
+    -- And as always I thank linux developers for both excellent
+    -- documentation and standard compliance. Motherfuckers.
+
     peek p = do
+# if linux_HOST_OS == 1
+        len <- fmap fromIntegral
+            ( ((#peek struct cmsghdr, cmsg_len) $ castPtr p) :: IO CSize )
+# else
         len <- (#peek struct cmsghdr, cmsg_len) p
+# endif
         level <- (#peek struct cmsghdr, cmsg_level) p
         t <- (#peek struct cmsghdr, cmsg_type) p
-        return $ CMsgHdr len level t
+        return $! CMsgHdr len level t
 
     poke p cmh = do
+# if linux_HOST_OS == 1
+        (#poke struct cmsghdr, cmsg_len) (castPtr p) (fromIntegral $ cmsghdrLen cmh :: CSize)
+# else
         (#poke struct cmsghdr, cmsg_len) p (cmsghdrLen cmh)
+# endif
         (#poke struct cmsghdr, cmsg_level) p (cmsghdrLevel cmh)
         (#poke struct cmsghdr, cmsg_type) p (cmsghdrType cmh)
 
diff --git a/Network/Socket/Msg/Internal.hs b/Network/Socket/Msg/Internal.hs
--- a/Network/Socket/Msg/Internal.hs
+++ b/Network/Socket/Msg/Internal.hs
@@ -3,13 +3,11 @@
 module Network.Socket.Msg.Internal
     ( c_sendmsg
     , c_recvmsg
-    , zeroBytes
     ) where
 
 import Network.Socket.Msg.MsgHdr (MsgHdr)
 
-import Control.Monad (void)
-import Foreign.C.Types (CInt(..),CSize(..))
+import Foreign.C.Types (CInt(..))
 import Foreign.Ptr (Ptr)
 import System.Posix.Types (CSsize(..))
 
@@ -18,9 +16,3 @@
 
 foreign import ccall unsafe "recvmsg"
   c_recvmsg :: CInt -> Ptr MsgHdr -> CInt -> IO CSsize
-
-foreign import ccall unsafe "memset"
-  c_memset :: Ptr a -> CInt -> CSize -> IO CSize
-
-zeroBytes :: Ptr a -> Int -> IO ()
-zeroBytes p s = void $ c_memset p 0 $ fromIntegral s
diff --git a/network-msg.cabal b/network-msg.cabal
--- a/network-msg.cabal
+++ b/network-msg.cabal
@@ -1,5 +1,5 @@
 name: network-msg
-version: 0.4
+version: 0.5
 category: Network
 build-type: Simple 
 cabal-version: >= 1.6
@@ -23,13 +23,13 @@
 
   build-depends:
     base >= 4 && < 5,
-    binary,
+    binary >= 0.7.0.0,
     bytestring,
     network,
     unix
 
   extensions: CPP, ForeignFunctionInterface
-  ghc-options: -Wall -fwarn-tabs -O2
+  ghc-options: -Wall -fwarn-tabs
 
 source-repository head
   type: git
