X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Socket%2FProtocols%2FRaw%2FPacketSocketHandle.cc;h=ca9a07a51beb85833ec4aa9e6b905f94900453c5;hb=34378cabd0ef59515f60b8e535d50fd5488c84e2;hp=8027f528854d905609953c9c92e2fa93c427c676;hpb=90ba247d06107cff657ad3e6310f8dde7c808c95;p=senf.git diff --git a/Socket/Protocols/Raw/PacketSocketHandle.cc b/Socket/Protocols/Raw/PacketSocketHandle.cc index 8027f52..ca9a07a 100644 --- a/Socket/Protocols/Raw/PacketSocketHandle.cc +++ b/Socket/Protocols/Raw/PacketSocketHandle.cc @@ -50,7 +50,7 @@ prefix_ void senf::PacketProtocol::init_client(SocketType type, int protocol) protocol = ETH_P_ALL; int sock = ::socket(PF_PACKET, socktype, htons(protocol)); if (sock < 0) - throw SystemException(errno); + throwErrno(); body().fd(sock); } @@ -67,7 +67,7 @@ prefix_ unsigned senf::PacketProtocol::available() return 0; ssize_t l = ::recv(body().fd(),0,0,MSG_PEEK | MSG_TRUNC); if (l < 0) - throw SystemException(errno); + throwErrno(); return l; } @@ -84,14 +84,14 @@ namespace { struct packet_mreq mreq; mreq.mr_ifindex = ::if_nametoindex(interface.c_str()); if (mreq.mr_ifindex == 0) - throw senf::SystemException(EINVAL); + senf::throwErrno(EINVAL); mreq.mr_type = PACKET_MR_MULTICAST; mreq.mr_alen = 6; std::copy(address.begin(), address.end(), &mreq.mr_address[0]); if (::setsockopt(fd, SOL_PACKET, add ? PACKET_ADD_MEMBERSHIP : PACKET_DROP_MEMBERSHIP, &mreq, sizeof(mreq)) < 0) - throw senf::SystemException(errno); + senf::throwErrno(); } }