Skip to content
Snippets Groups Projects
Commit 258108af authored by Tristan Matthews's avatar Tristan Matthews
Browse files

contrib: apply upstream fix for ucommon for c++11

Refs #56414

Change-Id: Ifa2e2f3988f484e0b8d342d8e1a10c93e1026d99
parent 6270d311
No related merge requests found
From 1b0fbedb16f7fa00be3e7da06e541592b0ce4819 Mon Sep 17 00:00:00 2001
From: David Sugar <dyfet@gnutelephony.org>
Date: Sat, 13 Sep 2014 05:43:35 -0700
Subject: [PATCH] any addr and overloads
---
commoncpp/socket.cpp | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/commoncpp/socket.cpp b/commoncpp/socket.cpp
index 0834aa8..9dcd975 100644
--- a/commoncpp/socket.cpp
+++ b/commoncpp/socket.cpp
@@ -868,10 +868,13 @@ ucommon::Socket::address Socket::getSender() const
IPV4Host Socket::getIPV4Sender(tpport_t *port) const
{
sockaddr_in* from = getSender();
+ struct in_addr any;
+ any.s_addr = INADDR_ANY;
+
if (from == NULL) {
if (port)
port = 0;
- return IPV4Host(INADDR_ANY);
+ return IPV4Host(any);
}
if (port)
@@ -912,10 +915,13 @@ ucommon::Socket::address Socket::getLocal() const
IPV4Host Socket::getIPV4Local(tpport_t *port) const
{
sockaddr_in* from = getLocal();
+ struct in_addr any;
+ any.s_addr = INADDR_ANY;
+
if (from == NULL) {
if (port)
port = 0;
- return IPV4Host(INADDR_ANY);
+ return IPV4Host(any);
}
if (port)
@@ -962,10 +968,13 @@ ucommon::Socket::address Socket::getPeer() const
IPV4Host Socket::getIPV4Peer(tpport_t *port) const
{
sockaddr_in* from = getPeer();
+ struct in_addr any;
+ any.s_addr = INADDR_ANY;
+
if (from == NULL) {
if (port)
port = 0;
- return IPV4Host(INADDR_ANY);
+ return IPV4Host(any);
}
if (port)
--
1.9.3
...@@ -19,6 +19,7 @@ ucommon: ucommon-$(UCOMMON_VERSION).tar.gz .sum-ucommon ...@@ -19,6 +19,7 @@ ucommon: ucommon-$(UCOMMON_VERSION).tar.gz .sum-ucommon
$(UNPACK) $(UNPACK)
$(APPLY) $(SRC)/ucommon/extended.patch $(APPLY) $(SRC)/ucommon/extended.patch
$(APPLY) $(SRC)/ucommon/usedefines.patch $(APPLY) $(SRC)/ucommon/usedefines.patch
$(APPLY) $(SRC)/ucommon/any-addr-and-overloads.patch
$(UPDATE_AUTOCONFIG) && cd $(UNPACK_DIR) && env NOCONFIGURE=1 sh autogen.sh $(UPDATE_AUTOCONFIG) && cd $(UNPACK_DIR) && env NOCONFIGURE=1 sh autogen.sh
$(MOVE) $(MOVE)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment