commit b5843f008996990ec9bc93581f01a7176eef7a61
parent ff55f9fe87c2a61ef33aeb7ec141b2da8807df58
Author: Yersa Nordman <yersa@finwo.nl>
Date: Thu, 12 Oct 2023 00:07:24 +0200
Removed unused variables and conflicting types
Diffstat:
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/src/main.c b/src/main.c
@@ -35,14 +35,14 @@ int64_t millis() {
}
void handle_packet_bond(struct pmlag_bond *bond) {
- int i, send_len, buflen;
+ int i, buflen;
struct sockaddr_ll saddr_ll;
buflen = read(bond->sockfd, rcvbuf, RCVBUFSIZ);
// Get interface to send the packet from
struct pmlag_iface *iface = (memcmp(rcvbuf, "\xFF\xFF\xFF\xFF\xFF\xFF", ETH_ALEN) == 0)
? NULL
- : rt_find(bond->rt, &(bond->mtx_rt), rcvbuf);
+ : rt_find(bond->rt, rcvbuf);
// Prepare saddr_ll mac address
memcpy(saddr_ll.sll_addr, bond->hwaddr, ETH_ALEN);
@@ -97,7 +97,7 @@ void handle_packet_iface(struct pmlag_iface *iface) {
memcpy(ðtype, rcvbuf + (2*ETH_ALEN), sizeof(ethtype));
ethtype = ntohs(ethtype);
- printf("Read %d bytes (%d) -- rt = %d\n", buflen, ethtype, bond->rt->length);
+ printf("Read %d bytes (%d) -- rt = %ld\n", buflen, ethtype, bond->rt->length);
// Don't touch packets that don't use our described protocol
if (ethtype != 0x0666) {
@@ -169,7 +169,6 @@ void handle_packet(void *entity) {
int main(int argc, const char **argv) {
char *config_file="/etc/pmlag/pmlag.ini";
- struct epoll_event *epev;
int epfd;
struct pmlag_bond *bond;
struct pmlag_iface *iface;
diff --git a/src/util/routing-table.c b/src/util/routing-table.c
@@ -82,7 +82,6 @@ int rt_upsert(
struct pmlag_iface * rt_find(
struct mindex_t *rt,
- pthread_mutex_t *mtx,
unsigned char *mac
) {
struct pmlag_rt_entry *rt_entry;
@@ -92,6 +91,6 @@ struct pmlag_iface * rt_find(
if (!rt_entry) return NULL;
// Unlock the routing table again
- struct pmlag_iface *iface = rt_entry->interfaces[rand() % rt_entry->iface_cnt];
+ struct pmlag_iface *iface = rt_entry->iface[rand() % rt_entry->iface_count];
return iface;
}