Let this code handle const qualifiers correctly enough to compile.

This commit is contained in:
cube 2007-01-13 18:54:43 +00:00
parent d239f85ecf
commit 74166b9a93
3 changed files with 14 additions and 12 deletions

View File

@ -1,8 +1,8 @@
# $NetBSD: files.ipkdb,v 1.2 2002/10/11 00:50:30 thorpej Exp $
# $NetBSD: files.ipkdb,v 1.3 2007/01/13 18:54:43 cube Exp $
defflag opt_ipkdb.h IPKDB
defflag opt_ipkdb.h IPKDBSECURE
defparam opt_ipkdb.h IPKDBKEY
defparam opt_ipkdb.h IPKDBKEY := "\"lint\""
file ipkdb/ipkdb_ipkdb.c ipkdb
file ipkdb/ipkdb_if.c ipkdb

View File

@ -1,4 +1,4 @@
/* $NetBSD: ipkdb.h,v 1.4 2000/03/22 20:58:29 ws Exp $ */
/* $NetBSD: ipkdb.h,v 1.5 2007/01/13 18:54:43 cube Exp $ */
/*
* Copyright (C) 1993-2000 Wolfgang Solfrank.
@ -54,7 +54,7 @@ struct ipkdb_if {
u_int16_t asslen;
u_int8_t flags; /* driver marks IPKDB_MYHW here */
/* Data from here on is to be filled by the driver */
char *name;
const char *name;
void *port;
void (*start) __P((struct ipkdb_if *));
void (*leave) __P((struct ipkdb_if *));
@ -95,7 +95,7 @@ extern int ipkdbifinit __P((struct ipkdb_if *));
/*
* Utilities (used to avoid calling system routines during debugging).
*/
extern void ipkdbcopy __P((void *, void *, int));
extern void ipkdbcopy __P((const void *, void *, int));
extern void ipkdbzero __P((void *, int));
extern int ipkdbcmp __P((void *, void *, int));

View File

@ -1,4 +1,4 @@
/* $NetBSD: ipkdb_ipkdb.c,v 1.17 2006/09/13 10:07:42 elad Exp $ */
/* $NetBSD: ipkdb_ipkdb.c,v 1.18 2007/01/13 18:54:43 cube Exp $ */
/*
* Copyright (C) 1993-2000 Wolfgang Solfrank.
@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ipkdb_ipkdb.c,v 1.17 2006/09/13 10:07:42 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: ipkdb_ipkdb.c,v 1.18 2007/01/13 18:54:43 cube Exp $");
#include "opt_ipkdb.h"
@ -66,7 +66,7 @@ int ipkdbpanic = 0;
#ifndef IPKDBKEY
#error You must specify the IPKDBKEY option to use IPKDB.
#else
static char *ipkdbkey = IPKDBKEY;
static char ipkdbkey[] = IPKDBKEY;
#endif
static struct ipkdb_if ipkdb_if;
@ -85,7 +85,7 @@ static void outpkt __P((struct ipkdb_if *, char *, int, int, int));
static void init __P((struct ipkdb_if *));
static void *chksum __P((void *, int));
static void getpkt __P((struct ipkdb_if *, char *, int *));
static void putpkt __P((struct ipkdb_if *, char *, int));
static void putpkt __P((struct ipkdb_if *, const char *, int));
static int check_ipkdb __P((struct ipkdb_if *, struct in_addr *, char *, int));
static int connectipkdb __P((struct ipkdb_if *, char *, int));
static int hmac_init __P((void));
@ -125,10 +125,12 @@ ipkdb_panic()
*/
void
ipkdbcopy(s, d, n)
void *s, *d;
const void *s;
void *d;
int n;
{
char *sp = s, *dp = d;
const char *sp = s;
char *dp = d;
while (--n >= 0)
*dp++ = *sp++;
@ -1112,7 +1114,7 @@ getpkt(ifp, buf, lp)
static void
putpkt(ifp, buf, l)
struct ipkdb_if *ifp;
char *buf;
const char *buf;
int l;
{
setnl(ifp->pkt, ifp->seq++);