diff options
author | julian <julian@FreeBSD.org> | 2000-12-18 20:03:32 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 2000-12-18 20:03:32 +0000 |
commit | 0c949560a12dd18943b66fe09bd06d3c34e5cf7a (patch) | |
tree | 5466b04ac515e8d01f9b135b6c119744a1138d82 /sys/dev/lmc/if_lmc.c | |
parent | e6bd476191c5b338634a02b0a6de56aa7f23cf37 (diff) | |
download | FreeBSD-src-0c949560a12dd18943b66fe09bd06d3c34e5cf7a.zip FreeBSD-src-0c949560a12dd18943b66fe09bd06d3c34e5cf7a.tar.gz |
Divorce the kernel binary ABI version number from the message
format version number. (userland programs should not need to be
recompiled when the netgraph kernel internal ABI is changed.
Also fix modules that don;t handle the fact that a caller may not supply
a return message pointer. (benign at the moment because the calling code
checks, but that will change)
Diffstat (limited to 'sys/dev/lmc/if_lmc.c')
-rw-r--r-- | sys/dev/lmc/if_lmc.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/sys/dev/lmc/if_lmc.c b/sys/dev/lmc/if_lmc.c index 3bec1fa..0aa6ea6 100644 --- a/sys/dev/lmc/if_lmc.c +++ b/sys/dev/lmc/if_lmc.c @@ -174,7 +174,7 @@ static const struct ng_cmdlist ng_lmc_cmdlist[] = { }; static struct ng_type typestruct = { - NG_VERSION, + NG_ABI_VERSION, NG_LMC_NODE_TYPE, NULL, ng_lmc_constructor, @@ -1341,9 +1341,9 @@ ng_lmc_rcvmsg(node_p node, struct ng_mesg *msg, case NGM_TEXT_STATUS: { char *arg; int pos = 0; + int resplen = sizeof(struct ng_mesg) + 512; - MALLOC(resp, struct ng_mesg *, resplen, M_NETGRAPH, - M_NOWAIT | M_ZERO); + NG_MKRESPONSE(resp, msg, resplen, M_NOWAIT); if (resp == NULL) { error = ENOMEM; break; @@ -1363,15 +1363,9 @@ ng_lmc_rcvmsg(node_p node, struct ng_mesg *msg, pos += sprintf(arg + pos, "%ld input errors\n", sc->lmc_ierrors); - resp->header.version = NG_VERSION; - resp->header.arglen = strlen(arg) + 1; - resp->header.token = msg->header.token; - resp->header.typecookie = NG_LMC_COOKIE; - resp->header.cmd = msg->header.cmd; - strncpy(resp->header.cmdstr, "status", - NG_CMDSTRLEN); - } + resp->header.arglen = pos + 1; break; + } default: error = EINVAL; break; |