summaryrefslogtreecommitdiff
path: root/common/tr.c
diff options
context:
space:
mode:
authorTed Lemon <source@isc.org>2000-01-25 01:15:05 +0000
committerTed Lemon <source@isc.org>2000-01-25 01:15:05 +0000
commitd98be47beaee7044e637f12676738bee88143e15 (patch)
treeb2fc6137204817cbab305ef8aef82ac43b2b948b /common/tr.c
parente89b6557e8944830b39b5b87599da96eb1f1db93 (diff)
downloadisc-dhcp-d98be47beaee7044e637f12676738bee88143e15.tar.gz
Use debugging malloc. htype+haddr->hbuf fixes
Diffstat (limited to 'common/tr.c')
-rw-r--r--common/tr.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/common/tr.c b/common/tr.c
index 91037165..f9707816 100644
--- a/common/tr.c
+++ b/common/tr.c
@@ -72,14 +72,14 @@ void assemble_tr_header (interface, buf, bufix, to)
/* set up the token header */
trh = (struct trh_hdr *) &buf[*bufix];
- if (interface -> hw_address.hlen == sizeof (trh->saddr))
- memcpy (trh->saddr, interface -> hw_address.haddr,
+ if (interface -> hw_address.hlen - 1 == sizeof (trh->saddr))
+ memcpy (trh->saddr, &interface -> hw_address.hbuf [1],
sizeof (trh->saddr));
else
memset (trh->saddr, 0x00, sizeof (trh->saddr));
- if (to && to -> hlen == 6) /* XXX */
- memcpy (trh->daddr, to -> haddr, sizeof trh->daddr);
+ if (to && to -> hlen == 7) /* XXX */
+ memcpy (trh->daddr, &to -> hbuf [1], sizeof trh->daddr);
else
memset (trh->daddr, 0xff, sizeof (trh->daddr));
@@ -271,7 +271,7 @@ static void save_source_routing(trh, interface)
}
/* no entry found, so create one */
- rover = malloc(sizeof(struct routing_entry));
+ rover = dmalloc (sizeof (struct routing_entry), MDL);
if (rover == NULL) {
fprintf(stderr,
"%s: unable to save source routing information\n",
@@ -312,7 +312,7 @@ static void expire_routes()
while((rover = *prover) != NULL) {
if ((now.tv_sec - rover->access_time) > routing_timeout) {
*prover = rover->next;
- free(rover);
+ dfree (rover, MDL);
} else
prover = &rover->next;
}