diff options
| author | Andrey A. Chernov <ache@FreeBSD.org> | 2007-04-30 12:27:58 +0000 |
|---|---|---|
| committer | Andrey A. Chernov <ache@FreeBSD.org> | 2007-04-30 12:27:58 +0000 |
| commit | f03351ff2ac55299461848eab773d98f96523fc8 (patch) | |
| tree | 95d3ee3c46b1e2284da79c93b500be12007c44fb /libexec | |
| parent | 4063583a62a4b8a4c602f29b11c85659d7941572 (diff) | |
Notes
Diffstat (limited to 'libexec')
| -rw-r--r-- | libexec/pppoed/pppoed.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libexec/pppoed/pppoed.c b/libexec/pppoed/pppoed.c index 8dfebb70ff27..dc87896e7ace 100644 --- a/libexec/pppoed/pppoed.c +++ b/libexec/pppoed/pppoed.c @@ -258,7 +258,7 @@ Spawn(const char *prog, const char *acname, const char *provider, struct ng_mesg *rep = (struct ng_mesg *)msgbuf; struct ngpppoe_sts *sts = (struct ngpppoe_sts *)(msgbuf + sizeof *rep); struct ngpppoe_init_data *data; - char env[sizeof(HISMACADDR)+18], unknown[14], sessionid[5], *path; + char env[18], unknown[14], sessionid[5], *path; unsigned char *macaddr; const char *msg; int ret, slen; @@ -352,11 +352,11 @@ Spawn(const char *prog, const char *acname, const char *provider, /* Put the peer's MAC address in the environment */ if (sz >= sizeof(struct ether_header)) { macaddr = ((struct ether_header *)request)->ether_shost; - snprintf(env, sizeof(env), "%s=%x:%x:%x:%x:%x:%x", HISMACADDR, + snprintf(env, sizeof(env), "%x:%x:%x:%x:%x:%x", macaddr[0], macaddr[1], macaddr[2], macaddr[3], macaddr[4], macaddr[5]); - if (putenv(env) != 0) - syslog(LOG_INFO, "putenv: cannot set %s: %m", env); + if (setenv(HISMACADDR, env, 1) != 0) + syslog(LOG_INFO, "setenv: cannot set %s: %m", HISMACADDR); } /* And send our request data to the waiting node */ |
