Skip to content

Commit

Permalink
libnetmap: nmreq_remove_option: use the correct pointer type
Browse files Browse the repository at this point in the history
  • Loading branch information
jhk098 committed Aug 27, 2020
1 parent bb351c2 commit dbf4b73
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions libnetmap/nmreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -585,13 +585,13 @@ nmreq_find_option(struct nmreq_header *h, uint32_t t)
void
nmreq_remove_option(struct nmreq_header *h, struct nmreq_option *o)
{
uintptr_t *scan;
struct nmreq_option **nmo;

for (scan = &h->nr_options; *scan;
scan = &((struct nmreq_option *)*scan)->nro_next) {
if (*scan == (uintptr_t)o) {
*scan = o->nro_next;
o->nro_next = 0;
for (nmo = (struct nmreq_option **)&h->nr_options; *nmo != NULL;
nmo = (struct nmreq_option **)&(*nmo)->nro_next) {
if (*nmo == o) {
*((uint64_t *)(*nmo)) = o->nro_next;
o->nro_next = (uint64_t)(uintptr_t)NULL;
break;
}
}
Expand Down

0 comments on commit dbf4b73

Please sign in to comment.