From e8f88d4909c743ebf511b34ff5cb94c415988954 Mon Sep 17 00:00:00 2001 From: peter Date: Thu, 28 Feb 2002 02:56:29 +0000 Subject: Fix warnings --- sys/netkey/key.c | 14 +++++++------- sys/netkey/keysock.c | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'sys/netkey') diff --git a/sys/netkey/key.c b/sys/netkey/key.c index 12b9401..b9e51bd 100644 --- a/sys/netkey/key.c +++ b/sys/netkey/key.c @@ -334,8 +334,8 @@ do { \ (idx)->prefs = (ps); \ (idx)->prefd = (pd); \ (idx)->ul_proto = (ulp); \ - bcopy((s), &(idx)->src, ((struct sockaddr *)(s))->sa_len); \ - bcopy((d), &(idx)->dst, ((struct sockaddr *)(d))->sa_len); \ + bcopy((s), &(idx)->src, ((const struct sockaddr *)(s))->sa_len); \ + bcopy((d), &(idx)->dst, ((const struct sockaddr *)(d))->sa_len); \ } while (0) /* @@ -348,8 +348,8 @@ do { \ (idx)->proto = (p); \ (idx)->mode = (m); \ (idx)->reqid = (r); \ - bcopy((s), &(idx)->src, ((struct sockaddr *)(s))->sa_len); \ - bcopy((d), &(idx)->dst, ((struct sockaddr *)(d))->sa_len); \ + bcopy((s), &(idx)->src, ((const struct sockaddr *)(s))->sa_len); \ + bcopy((d), &(idx)->dst, ((const struct sockaddr *)(d))->sa_len); \ } while (0) /* key statistics */ @@ -7139,7 +7139,7 @@ key_validate_ext(ext, len) const struct sadb_ext *ext; int len; { - struct sockaddr *sa; + const struct sockaddr *sa; enum { NONE, ADDR } checktype = NONE; int baselen; const int sal = offsetof(struct sockaddr, sa_len) + sizeof(sa->sa_len); @@ -7166,7 +7166,7 @@ key_validate_ext(ext, len) break; case SADB_EXT_IDENTITY_SRC: case SADB_EXT_IDENTITY_DST: - if (((struct sadb_ident *)ext)->sadb_ident_type == + if (((const struct sadb_ident *)ext)->sadb_ident_type == SADB_X_IDENTTYPE_ADDR) { baselen = PFKEY_ALIGN8(sizeof(struct sadb_ident)); checktype = ADDR; @@ -7182,7 +7182,7 @@ key_validate_ext(ext, len) case NONE: break; case ADDR: - sa = (struct sockaddr *)((caddr_t)ext + baselen); + sa = (struct sockaddr *)((uintptr_t)ext + baselen); if (len < baselen + sal) return EINVAL; if (baselen + PFKEY_ALIGN8(sa->sa_len) != len) diff --git a/sys/netkey/keysock.c b/sys/netkey/keysock.c index db074be..8467b87 100644 --- a/sys/netkey/keysock.c +++ b/sys/netkey/keysock.c @@ -579,7 +579,7 @@ extern struct domain keydomain; struct protosw keysw[] = { { SOCK_RAW, &keydomain, PF_KEY_V2, PR_ATOMIC|PR_ADDR, - 0, key_output, raw_ctlinput, 0, + 0, (pr_output_t *)key_output, raw_ctlinput, 0, 0, raw_init, 0, 0, 0, &key_usrreqs -- cgit v1.1