Don't use "NULL" when "0" is really meant.
This commit is contained in:
parent
fb6cc33daf
commit
facfd88935
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=102244
@ -847,7 +847,7 @@ _ngi_hook(item_p item, char *file, int line)
|
||||
#define NG_FWD_ITEM_HOOK(error, item, hook) \
|
||||
do { \
|
||||
(error) = \
|
||||
ng_address_hook(NULL, (item), (hook), NULL); \
|
||||
ng_address_hook(NULL, (item), (hook), 0); \
|
||||
if (error == 0) { \
|
||||
SAVE_LINE(item); \
|
||||
(error) = ng_snd_item((item), 0); \
|
||||
@ -994,10 +994,10 @@ _ngi_hook(item_p item, char *file, int line)
|
||||
do { \
|
||||
if (resp) { \
|
||||
ng_ID_t _dest = NGI_RETADDR(item); \
|
||||
NGI_RETADDR(item) = NULL; \
|
||||
NGI_RETADDR(item) = 0; \
|
||||
NGI_MSG(item) = resp; \
|
||||
if ((ng_address_ID((here), (item), \
|
||||
_dest, NULL )) == 0) { \
|
||||
_dest, 0)) == 0) { \
|
||||
SAVE_LINE(item); \
|
||||
(error) = ng_snd_item((item), 1); \
|
||||
} else { \
|
||||
|
@ -3124,7 +3124,7 @@ ng_free_item(item_p item)
|
||||
NG_FREE_META(_NGI_META(item));
|
||||
break;
|
||||
case NGQF_MESG:
|
||||
_NGI_RETADDR(item) = NULL;
|
||||
_NGI_RETADDR(item) = 0;
|
||||
NG_FREE_MSG(_NGI_MSG(item));
|
||||
break;
|
||||
case NGQF_FN:
|
||||
@ -3453,7 +3453,7 @@ ng_package_msg(struct ng_mesg *msg)
|
||||
* Set the current lasthook into the queue item
|
||||
*/
|
||||
NGI_MSG(item) = msg;
|
||||
NGI_RETADDR(item) = NULL;
|
||||
NGI_RETADDR(item) = 0;
|
||||
return (item);
|
||||
}
|
||||
|
||||
|
@ -525,8 +525,8 @@ cisco_input(sc_p sc, item_p item)
|
||||
NGM_CISCO_GET_IPADDR, 0, M_NOWAIT);
|
||||
if (msg == NULL)
|
||||
goto nomsg;
|
||||
NG_SEND_MSG_HOOK(dummy_error, sc->node, msg,
|
||||
sc->inet.hook, NULL);
|
||||
NG_SEND_MSG_HOOK(dummy_error,
|
||||
sc->node, msg, sc->inet.hook, 0);
|
||||
/*
|
||||
* XXX Now maybe we should set a flag telling
|
||||
* our receiver to send this message when the response comes in
|
||||
|
@ -1061,8 +1061,8 @@ ng_ksocket_incoming2(node_p node, hook_p hook, void *arg1, int waitflag)
|
||||
* to the node that set us up
|
||||
* (if it still exists)
|
||||
*/
|
||||
NG_SEND_MSG_ID(error, node, response,
|
||||
priv->response_addr, NULL);
|
||||
NG_SEND_MSG_ID(error, node,
|
||||
response, priv->response_addr, 0);
|
||||
}
|
||||
priv->flags &= ~KSF_CONNECTING;
|
||||
}
|
||||
@ -1259,7 +1259,7 @@ ng_ksocket_finish_accept(priv_p priv)
|
||||
resp_data->nodeid = NG_NODE_ID(node);
|
||||
if (sa != NULL)
|
||||
bcopy(sa, &resp_data->addr, sa->sa_len);
|
||||
NG_SEND_MSG_ID(error, node, resp, priv->response_addr, NULL);
|
||||
NG_SEND_MSG_ID(error, node, resp, priv->response_addr, 0);
|
||||
|
||||
out:
|
||||
if (sa != NULL)
|
||||
|
@ -1029,7 +1029,7 @@ ng_l2tp_seq_failure(priv_p priv)
|
||||
NG_MKMESSAGE(msg, NGM_L2TP_COOKIE, NGM_L2TP_ACK_FAILURE, 0, M_NOWAIT);
|
||||
if (msg == NULL)
|
||||
return;
|
||||
NG_SEND_MSG_ID(error, priv->node, msg, priv->ftarget, NULL);
|
||||
NG_SEND_MSG_ID(error, priv->node, msg, priv->ftarget, 0);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
|
@ -368,7 +368,7 @@ ng_mppc_rcvdata(hook_p hook, item_p item)
|
||||
if ((error = ng_mppc_decompress(node, m, &out)) != 0) {
|
||||
NG_FREE_M(m);
|
||||
NG_FREE_ITEM(item);
|
||||
if (error == EINVAL && priv->ctrlnode != NULL) {
|
||||
if (error == EINVAL && priv->ctrlnode != 0) {
|
||||
struct ng_mesg *msg;
|
||||
|
||||
/* Need to send a reset-request */
|
||||
@ -377,7 +377,7 @@ ng_mppc_rcvdata(hook_p hook, item_p item)
|
||||
if (msg == NULL)
|
||||
return (error);
|
||||
NG_SEND_MSG_ID(error, node, msg,
|
||||
priv->ctrlnode, NULL);
|
||||
priv->ctrlnode, 0);
|
||||
}
|
||||
return (error);
|
||||
}
|
||||
|
@ -906,7 +906,7 @@ send_acname(sessp sp, const struct pppoe_tag *tag)
|
||||
tlen = min(NG_HOOKLEN, ntohs(tag->tag_len));
|
||||
strncpy(sts->hook, tag->tag_data, tlen);
|
||||
sts->hook[tlen] = '\0';
|
||||
NG_SEND_MSG_ID(error, NG_HOOK_NODE(sp->hook), msg, sp->creator, NULL);
|
||||
NG_SEND_MSG_ID(error, NG_HOOK_NODE(sp->hook), msg, sp->creator, 0);
|
||||
|
||||
return (error);
|
||||
}
|
||||
@ -923,7 +923,7 @@ send_sessionid(sessp sp)
|
||||
return (ENOMEM);
|
||||
|
||||
*(u_int16_t *)msg->data = sp->Session_ID;
|
||||
NG_SEND_MSG_ID(error, NG_HOOK_NODE(sp->hook), msg, sp->creator, NULL);
|
||||
NG_SEND_MSG_ID(error, NG_HOOK_NODE(sp->hook), msg, sp->creator, 0);
|
||||
|
||||
return (error);
|
||||
}
|
||||
@ -1737,6 +1737,6 @@ AAA
|
||||
return (ENOMEM);
|
||||
sts = (struct ngpppoe_sts *)msg->data;
|
||||
strncpy(sts->hook, NG_HOOK_NAME(sp->hook), NG_HOOKLEN + 1);
|
||||
NG_SEND_MSG_ID(error, NG_HOOK_NODE(sp->hook), msg, sp->creator, NULL);
|
||||
NG_SEND_MSG_ID(error, NG_HOOK_NODE(sp->hook), msg, sp->creator, 0);
|
||||
return (error);
|
||||
}
|
||||
|
@ -276,7 +276,7 @@ printf("errx=%d\n",error);
|
||||
|
||||
#else
|
||||
/* The callee will free the msg when done. The path is our business. */
|
||||
NG_SEND_MSG_PATH(error, pcbp->sockdata->node, msg, path, NULL);
|
||||
NG_SEND_MSG_PATH(error, pcbp->sockdata->node, msg, path, 0);
|
||||
#endif
|
||||
release:
|
||||
if (path != NULL)
|
||||
@ -650,7 +650,7 @@ ng_connect_data(struct sockaddr *nam, struct ngpcb *pcbp)
|
||||
if (item == NULL) {
|
||||
return (ENOMEM);
|
||||
}
|
||||
if ((error = ng_address_path(NULL, item, sap->sg_data, NULL)))
|
||||
if ((error = ng_address_path(NULL, item, sap->sg_data, 0)))
|
||||
return (error); /* item is freed on failure */
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user