diff options
author | John-Mark Gurney <jmg@FreeBSD.org> | 2014-01-07 23:01:05 +0000 |
---|---|---|
committer | John-Mark Gurney <jmg@FreeBSD.org> | 2014-01-07 23:01:05 +0000 |
commit | 4e5422a9e6b9bccde5531e1ce2b0692ab4245902 (patch) | |
tree | d0ab07a0d17bd01682ceae8279624a67eb5c2e82 /lib/libnetgraph | |
parent | 0f25d857e0e9c43c351130421644f9564e09f1f4 (diff) | |
download | src-test2-4e5422a9e6b9bccde5531e1ce2b0692ab4245902.tar.gz src-test2-4e5422a9e6b9bccde5531e1ce2b0692ab4245902.zip |
Notes
Diffstat (limited to 'lib/libnetgraph')
-rw-r--r-- | lib/libnetgraph/sock.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/libnetgraph/sock.c b/lib/libnetgraph/sock.c index 5f9f563fe50c..12603d3b10ab 100644 --- a/lib/libnetgraph/sock.c +++ b/lib/libnetgraph/sock.c @@ -111,9 +111,12 @@ gotNode: /* Save node name */ strlcpy(namebuf, name, sizeof(namebuf)); } else if (dsp != NULL) { - u_char rbuf[sizeof(struct ng_mesg) + sizeof(struct nodeinfo)]; - struct ng_mesg *const resp = (struct ng_mesg *) rbuf; - struct nodeinfo *const ni = (struct nodeinfo *) resp->data; + union { + u_char rbuf[sizeof(struct ng_mesg) + + sizeof(struct nodeinfo)]; + struct ng_mesg res; + } res; + struct nodeinfo *const ni = (struct nodeinfo *) res.res.data; /* Find out the node ID */ if (NgSendMsg(cs, ".", NGM_GENERIC_COOKIE, @@ -123,7 +126,7 @@ gotNode: NGLOG("send nodeinfo"); goto errout; } - if (NgRecvMsg(cs, resp, sizeof(rbuf), NULL) < 0) { + if (NgRecvMsg(cs, &res.res, sizeof(res.rbuf), NULL) < 0) { errnosv = errno; if (_gNgDebugLevel >= 1) NGLOG("recv nodeinfo"); |