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

compiler warning fixes #1

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions src/wireguard.h
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ void wireguard_start_session(struct wireguard_peer *peer, bool initiator);

void keypair_update(struct wireguard_peer *peer, struct wireguard_keypair *received_keypair);
void keypair_destroy(struct wireguard_keypair *keypair);
void handshake_destroy(struct wireguard_handshake *handshake);

struct wireguard_keypair *get_peer_keypair_for_idx(struct wireguard_peer *peer, uint32_t idx);
bool wireguard_check_replay(struct wireguard_keypair *keypair, uint64_t seq);
Expand Down
8 changes: 6 additions & 2 deletions src/wireguardif.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
#include "wireguard.h"
#include "crypto.h"
#include "esp_log.h"
#include "tcpip_adapter.h"
#include "esp_netif.h"

#include "esp32-hal-log.h"

Expand All @@ -64,6 +64,10 @@ static void update_peer_addr(struct wireguard_peer *peer, const ip_addr_t *addr,

static struct wireguard_peer *peer_lookup_by_allowed_ip(struct wireguard_device *device, const ip_addr_t *ipaddr)
{
if (device == NULL) {
return NULL;
}

struct wireguard_peer *result = NULL;
struct wireguard_peer *tmp;
int x;
Expand Down Expand Up @@ -1113,7 +1117,7 @@ err_t wireguardif_init(struct netif *netif)
size_t private_key_len = sizeof(private_key);

struct netif *underlying_netif;
tcpip_adapter_get_netif(TCPIP_ADAPTER_IF_STA, &underlying_netif);
underlying_netif = netif_default;
log_i(TAG "underlying_netif = %p", underlying_netif);

LWIP_ASSERT("netif != NULL", (netif != NULL));
Expand Down