From 05f47d9d5b6c6c4c36b1f34292ed976a8d398eda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ege=20=C3=87etin?= Date: Mon, 30 Sep 2024 15:34:01 +0300 Subject: [PATCH] remove shadowing variable --- include/connection/RawSocket.hpp | 2 +- src/connection/RawSocket.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/connection/RawSocket.hpp b/include/connection/RawSocket.hpp index e057fe838..be10931a1 100644 --- a/include/connection/RawSocket.hpp +++ b/include/connection/RawSocket.hpp @@ -35,7 +35,7 @@ class RawSocket { /// Internal structure for statistics RawSocketStats _stats{}; - void init(int domain, int type, int protocol, sockaddr_ll &_addr); + void init(int domain, int type, int protocol); public: /** diff --git a/src/connection/RawSocket.cpp b/src/connection/RawSocket.cpp index f8a5d3d37..3231391a0 100644 --- a/src/connection/RawSocket.cpp +++ b/src/connection/RawSocket.cpp @@ -14,7 +14,7 @@ #include #include -void RawSocket::init(int domain, int type, int protocol, sockaddr_ll &_addr) +void RawSocket::init(int domain, int type, int protocol) { _sockFd = socket(domain, type, protocol); // Init socket if (_sockFd < 0) @@ -47,7 +47,7 @@ RawSocket::RawSocket(std::string iface, bool isWrite) : _writeMode(isWrite), _iF if (isWrite) { - init(PF_PACKET, SOCK_RAW, IPPROTO_RAW, _addr); + init(PF_PACKET, SOCK_RAW, IPPROTO_RAW); if (setsockopt(_sockFd, SOL_SOCKET, SO_BINDTODEVICE, static_cast(&ifr), sizeof(ifr)) < 0) { throw std::ios_base::failure(std::string("Can't set socket options: ") + getErrnoString(errno)); @@ -55,7 +55,7 @@ RawSocket::RawSocket(std::string iface, bool isWrite) : _writeMode(isWrite), _iF } else { - init(AF_PACKET, SOCK_RAW, htons(ETH_P_ALL), _addr); + init(AF_PACKET, SOCK_RAW, htons(ETH_P_ALL)); } _isReady = true; }