Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove shadowing variable #326

Merged
merged 1 commit into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/connection/RawSocket.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
/**
Expand Down
6 changes: 3 additions & 3 deletions src/connection/RawSocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <sys/socket.h>
#include <unistd.h>

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)
Expand Down Expand Up @@ -47,15 +47,15 @@ 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<void *>(&ifr), sizeof(ifr)) < 0)
{
throw std::ios_base::failure(std::string("Can't set socket options: ") + getErrnoString(errno));
}
}
else
{
init(AF_PACKET, SOCK_RAW, htons(ETH_P_ALL), _addr);
init(AF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
}
_isReady = true;
}
Expand Down