From: Ted Lemon Date: Thu, 5 Apr 2001 20:53:01 +0000 (+0000) Subject: Apply a patch supplied by Tuan Uong for a buffer offset error. X-Git-Tag: V3-BETA-2-PATCH-24~14 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b089b9af9e941706ec9debc7326664b2c138d2f9;p=thirdparty%2Fdhcp.git Apply a patch supplied by Tuan Uong for a buffer offset error. --- diff --git a/common/dlpi.c b/common/dlpi.c index 1421dee7a..4cbc332ac 100644 --- a/common/dlpi.c +++ b/common/dlpi.c @@ -3,7 +3,7 @@ Data Link Provider Interface (DLPI) network interface code. */ /* - * Copyright (c) 1996-2000 Internet Software Consortium. + * Copyright (c) 1996-2001 Internet Software Consortium. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -36,6 +36,10 @@ * This software was written for the Internet Software Consortium * by Eric James Negaard, . To learn more about * the Internet Software Consortium, see ``http://www.isc.org''. + * + * Joost Mulders has also done considerable work in debugging the DLPI API + * support on Solaris and getting this code to work properly on a variety + * of different Solaris platforms. */ /* @@ -84,7 +88,7 @@ #ifndef lint static char copyright[] = -"$Id: dlpi.c,v 1.27 2001/03/16 22:12:18 tamino Exp $ Copyright (c) 1996-2000 The Internet Software Consortium. All rights reserved.\n"; +"$Id: dlpi.c,v 1.28 2001/04/05 20:53:01 mellon Exp $ Copyright (c) 1996-2000 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -1153,7 +1157,8 @@ static int dlpiunitdataind (fd, daddr, daddrlen, /* Copy sender info */ if (saddr) { - memcpy (saddr, &buf [dlp -> unitdata_ind.dl_src_addr_offset], + memcpy (saddr, + (char *)buf + dlp -> unitdata_ind.dl_src_addr_offset, dlp -> unitdata_ind.dl_src_addr_length); } if (saddrlen) { @@ -1162,7 +1167,8 @@ static int dlpiunitdataind (fd, daddr, daddrlen, /* Copy destination info */ if (daddr) { - memcpy (daddr, &buf [dlp -> unitdata_ind.dl_dest_addr_offset], + memcpy (daddr, + (char *)buf + dlp -> unitdata_ind.dl_dest_addr_offset, dlp -> unitdata_ind.dl_dest_addr_length); } if (daddrlen) {