From 887edaf00d00d217ec5b15c678946db0ac57a07c Mon Sep 17 00:00:00 2001 From: "Marius Petrescu, YO2LOJ" Date: Sat, 22 Feb 2020 17:47:08 +0200 Subject: [PATCH] UDM Msg update Fix for sockopt on open --- src/cudpmsgsocket.cpp | 14 ++++++++++++++ src/cudpmsgsocket.h | 3 +++ 2 files changed, 17 insertions(+) diff --git a/src/cudpmsgsocket.cpp b/src/cudpmsgsocket.cpp index daadd17..45d438d 100644 --- a/src/cudpmsgsocket.cpp +++ b/src/cudpmsgsocket.cpp @@ -26,6 +26,20 @@ #include #include "cudpmsgsocket.h" +//////////////////////////////////////////////////////////////////////////////////////// +// open +bool CUdpMsgSocket::Open(uint16 uiPort) +{ + bool ret; + int on = 1; + + ret = CUdpSocket::Open(uiPort); + setsockopt(m_Socket, IPPROTO_IP, IP_PKTINFO, (char *)&on, sizeof(on)); + + return ret; +} + + //////////////////////////////////////////////////////////////////////////////////////// // read diff --git a/src/cudpmsgsocket.h b/src/cudpmsgsocket.h index 657ed21..f4245c1 100644 --- a/src/cudpmsgsocket.h +++ b/src/cudpmsgsocket.h @@ -39,6 +39,9 @@ class CUdpMsgSocket : public CUdpSocket { public: + // open + bool Open(uint16); + // read int Receive(CBuffer *, CIp *, int);