From 30bade88120e5bba2ca5d115490ecc3c0481d12e Mon Sep 17 00:00:00 2001 From: Tommaso Pecorella Date: Wed, 5 Oct 2022 01:35:35 +0200 Subject: [PATCH] internet: add NotifyConnection[Succeeded,Failed] to Ipv[4,6]RawScocket --- src/internet/model/ipv4-raw-socket-impl.cc | 2 ++ src/internet/model/ipv6-raw-socket-impl.cc | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/internet/model/ipv4-raw-socket-impl.cc b/src/internet/model/ipv4-raw-socket-impl.cc index c41c56e1f..77c6c4e8e 100644 --- a/src/internet/model/ipv4-raw-socket-impl.cc +++ b/src/internet/model/ipv4-raw-socket-impl.cc @@ -178,11 +178,13 @@ Ipv4RawSocketImpl::Connect (const Address &address) if (!InetSocketAddress::IsMatchingType (address)) { m_err = Socket::ERROR_INVAL; + NotifyConnectionFailed (); return -1; } InetSocketAddress ad = InetSocketAddress::ConvertFrom (address); m_dst = ad.GetIpv4 (); SetIpTos (ad.GetTos ()); + NotifyConnectionSucceeded (); return 0; } diff --git a/src/internet/model/ipv6-raw-socket-impl.cc b/src/internet/model/ipv6-raw-socket-impl.cc index f645d8578..2b1d4f90b 100644 --- a/src/internet/model/ipv6-raw-socket-impl.cc +++ b/src/internet/model/ipv6-raw-socket-impl.cc @@ -184,10 +184,12 @@ int Ipv6RawSocketImpl::Connect (const Address& address) if (!Inet6SocketAddress::IsMatchingType (address)) { m_err = Socket::ERROR_INVAL; + NotifyConnectionFailed (); return -1; } Inet6SocketAddress ad = Inet6SocketAddress::ConvertFrom (address); m_dst = ad.GetIpv6 (); + NotifyConnectionSucceeded (); return 0; }