ports/net/xorp/files/patch-io__ip__socket.cc
Kurt Jaeger aed832b2a9 net/xorp: fix build
PR:		217152
Submitted by:	Walter Schwarzenfeld <w.schwarzenfeld@utanet.at>
Reported by:	O. Hartmann <ohartmann@walstatt.org>
Approved by:	hrs (maintainer timeout)
2018-07-14 14:10:29 +00:00

16 lines
616 B
C++

--- fea/data_plane/io/io_ip_socket.cc.orig 2018-07-10 15:49:50 UTC
+++ fea/data_plane/io/io_ip_socket.cc
@@ -2293,10 +2293,10 @@ IoIpSocket::send_packet(const string& if
//
struct sockaddr_in sin;
src_address.copy_out(sin);
- if (bind(_proto_socket_out,
+ bind(_proto_socket_out,
reinterpret_cast<struct sockaddr*>(&sin),
- sizeof(sin))
- < 0) {
+ sizeof(sin));
+ if ( reinterpret_cast<struct sockaddr*>(&sin) < ((void*)0)) {
error_msg = c_format("raw socket bind(%s) failed: %s",
cstring(src_address), XSTRERROR);
XLOG_ERROR("%s", error_msg.c_str());