Skip to content

Commit

Permalink
IPv6: make more readable (nfc)
Browse files Browse the repository at this point in the history
  • Loading branch information
rsmarples committed Jun 24, 2024
1 parent 7ffa777 commit 410fae4
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/ipv6.c
Original file line number Diff line number Diff line change
Expand Up @@ -1397,18 +1397,17 @@ ipv6_addlinklocalcallback(struct interface *ifp,
state = ipv6_getstate(ifp);
TAILQ_FOREACH(cb, &state->ll_callbacks, next) {
if (cb->callback == callback && cb->arg == arg)
break;
return 0;
}

cb = malloc(sizeof(*cb));
if (cb == NULL) {
cb = malloc(sizeof(*cb));
if (cb == NULL) {
logerr(__func__);
return -1;
}
cb->callback = callback;
cb->arg = arg;
TAILQ_INSERT_TAIL(&state->ll_callbacks, cb, next);
logerr(__func__);
return -1;
}
cb->callback = callback;
cb->arg = arg;
TAILQ_INSERT_TAIL(&state->ll_callbacks, cb, next);
return 0;
}

Expand Down

0 comments on commit 410fae4

Please sign in to comment.