}
struct addrchange_state {
+ struct tevent_context *ev;
+ struct addrchange_context *ctx;
uint8_t buf[8192];
struct sockaddr_storage fromaddr;
socklen_t fromaddr_len;
if (req == NULL) {
return NULL;
}
+ state->ev = ev;
+ state->ctx = ctx;
state->fromaddr_len = sizeof(state->fromaddr);
-
- subreq = recvfrom_send(state, ev, ctx->sock,
+ subreq = recvfrom_send(state, state->ev, state->ctx->sock,
state->buf, sizeof(state->buf), 0,
&state->fromaddr, &state->fromaddr_len);
if (tevent_req_nomem(subreq, req)) {
- return tevent_req_post(req, ev);
+ return tevent_req_post(req, state->ev);
}
tevent_req_set_callback(subreq, addrchange_done, req);
return req;
state->type = ADDRCHANGE_DEL;
break;
default:
- DEBUG(10, ("Got unexpected type %d\n", h->nlmsg_type));
- tevent_req_nterror(req, NT_STATUS_INVALID_ADDRESS);
+ DEBUG(10, ("Got unexpected type %d - ignoring\n", h->nlmsg_type));
+
+ state->fromaddr_len = sizeof(state->fromaddr);
+ subreq = recvfrom_send(state, state->ev, state->ctx->sock,
+ state->buf, sizeof(state->buf), 0,
+ &state->fromaddr, &state->fromaddr_len);
+ if (tevent_req_nomem(subreq, req)) {
+ return;
+ }
+ tevent_req_set_callback(subreq, addrchange_done, req);
return;
}