summaryrefslogtreecommitdiffstats
path: root/src/peer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/peer.c')
-rw-r--r--src/peer.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/peer.c b/src/peer.c
index 96463a9..82d5fa4 100644
--- a/src/peer.c
+++ b/src/peer.c
@@ -674,6 +674,9 @@ static inline fastd_peer_eth_addr_t* peer_get_by_addr(fastd_context_t *ctx, fast
void fastd_peer_eth_addr_add(fastd_context_t *ctx, fastd_peer_t *peer, fastd_eth_addr_t addr) {
int min = 0, max = ctx->n_eth_addr;
+ if (!fastd_peer_is_established(peer))
+ exit_bug(ctx, "tried to learn ethernet address on non-established peer");
+
while (max > min) {
int cur = (min+max)/2;
int cmp = fastd_eth_addr_cmp(&addr, &ctx->eth_addr[cur].addr);