Go back to populating data_len in struct ngpppoe_init_data.

This commit is contained in:
Brian Somers 2000-11-16 23:15:42 +00:00
parent 27121ab1a4
commit 80e2e6b62f
2 changed files with 6 additions and 4 deletions

View File

@ -232,7 +232,8 @@ ConfigureNode(const char *prog, const char *iface, const char *provider,
data = (struct ngpppoe_init_data *)alloca(sizeof *data + plen); data = (struct ngpppoe_init_data *)alloca(sizeof *data + plen);
snprintf(data->hook, sizeof data->hook, "%s", ngc->peerhook); snprintf(data->hook, sizeof data->hook, "%s", ngc->peerhook);
strcpy(data->data, provider); memcpy(data->data, provider, plen);
data->data_len = plen;
spath = (char *)alloca(strlen(ngc->peerhook) + 3); spath = (char *)alloca(strlen(ngc->peerhook) + 3);
strcpy(spath, ".:"); strcpy(spath, ".:");
@ -324,7 +325,8 @@ Spawn(const char *prog, const char *acname, const char *exec,
slen = strlen(acname); slen = strlen(acname);
data = (struct ngpppoe_init_data *)alloca(sizeof *data + slen); data = (struct ngpppoe_init_data *)alloca(sizeof *data + slen);
snprintf(data->hook, sizeof data->hook, "%s", ngc.ourhook); snprintf(data->hook, sizeof data->hook, "%s", ngc.ourhook);
strcpy(data->data, acname); memcpy(data->data, acname, slen);
data->data_len = slen;
path = (char *)alloca(strlen(ngc.ourhook) + 3); path = (char *)alloca(strlen(ngc.ourhook) + 3);
strcpy(path, ".:"); strcpy(path, ".:");

View File

@ -585,9 +585,9 @@ ether_Create(struct physical *p)
/* And finally, request a connection to the given provider */ /* And finally, request a connection to the given provider */
data = (struct ngpppoe_init_data *)alloca(sizeof *data + providerlen); data = (struct ngpppoe_init_data *)alloca(sizeof *data + providerlen);
snprintf(data->hook, sizeof data->hook, "%s", dev->hook); snprintf(data->hook, sizeof data->hook, "%s", dev->hook);
strcpy(data->data, provider); memcpy(data->data, provider, providerlen);
data->data_len = providerlen;
snprintf(connectpath, sizeof connectpath, ".:%s", dev->hook); snprintf(connectpath, sizeof connectpath, ".:%s", dev->hook);
log_Printf(LogDEBUG, "Sending PPPOE_CONNECT to %s\n", connectpath); log_Printf(LogDEBUG, "Sending PPPOE_CONNECT to %s\n", connectpath);