Fix fallout from caddr_t changes
This commit is contained in:
parent
06a8516672
commit
c252f603d0
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ipsec_mbuf.c,v 1.8 2007/03/04 06:03:29 christos Exp $ */
|
||||
/* $NetBSD: ipsec_mbuf.c,v 1.9 2007/03/04 19:54:48 degroote Exp $ */
|
||||
/*-
|
||||
* Copyright (c) 2002, 2003 Sam Leffler, Errno Consulting
|
||||
* All rights reserved.
|
||||
@ -28,7 +28,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: ipsec_mbuf.c,v 1.8 2007/03/04 06:03:29 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: ipsec_mbuf.c,v 1.9 2007/03/04 19:54:48 degroote Exp $");
|
||||
|
||||
/*
|
||||
* IPsec-specific mbuf routines.
|
||||
@ -90,8 +90,8 @@ m_clone(struct mbuf *m0)
|
||||
if (mprev && (mprev->m_flags & M_EXT) &&
|
||||
m->m_len <= M_TRAILINGSPACE(mprev)) {
|
||||
/* XXX: this ignores mbuf types */
|
||||
memcpy(mtod(mprev, void *) + mprev->m_len,
|
||||
mtod(m, void *), m->m_len);
|
||||
memcpy(mtod(mprev, char *) + mprev->m_len,
|
||||
mtod(m, char *), m->m_len);
|
||||
mprev->m_len += m->m_len;
|
||||
mprev->m_next = m->m_next; /* unlink from chain */
|
||||
m_free(m); /* reclaim mbuf */
|
||||
@ -124,8 +124,8 @@ m_clone(struct mbuf *m0)
|
||||
if (mprev != NULL && (mprev->m_flags & M_EXT) &&
|
||||
m->m_len <= M_TRAILINGSPACE(mprev)) {
|
||||
/* XXX: this ignores mbuf types */
|
||||
memcpy(mtod(mprev, void *) + mprev->m_len,
|
||||
mtod(m, void *), m->m_len);
|
||||
memcpy(mtod(mprev, char *) + mprev->m_len,
|
||||
mtod(m, char *), m->m_len);
|
||||
mprev->m_len += m->m_len;
|
||||
mprev->m_next = m->m_next; /* unlink from chain */
|
||||
m_free(m); /* reclaim mbuf */
|
||||
@ -177,7 +177,7 @@ m_clone(struct mbuf *m0)
|
||||
mlast = NULL;
|
||||
for (;;) {
|
||||
int cc = min(len, MCLBYTES);
|
||||
memcpy(mtod(n, void *), mtod(m, void *) + off, cc);
|
||||
memcpy(mtod(n, char *), mtod(m, char *) + off, cc);
|
||||
n->m_len = cc;
|
||||
if (mlast != NULL)
|
||||
mlast->m_next = n;
|
||||
@ -261,8 +261,8 @@ m_makespace(struct mbuf *m0, int skip, int hlen, int *off)
|
||||
* the remainder; just do the copy to the new
|
||||
* mbuf and we're good to go.
|
||||
*/
|
||||
memcpy(mtod(n, void *),
|
||||
mtod(m, void *) + skip, remain);
|
||||
memcpy(mtod(n, char *),
|
||||
mtod(m, char *) + skip, remain);
|
||||
n->m_len = remain;
|
||||
m->m_len = skip + hlen;
|
||||
*off = skip;
|
||||
@ -282,16 +282,16 @@ m_makespace(struct mbuf *m0, int skip, int hlen, int *off)
|
||||
if (n2 == NULL)
|
||||
return (NULL);
|
||||
n2->m_len = 0;
|
||||
memcpy(mtod(n2, void *),
|
||||
mtod(m, void *) + skip, remain);
|
||||
memcpy(mtod(n2, char *),
|
||||
mtod(m, char *) + skip, remain);
|
||||
n2->m_len = remain;
|
||||
/* splice in second mbuf */
|
||||
n2->m_next = n->m_next;
|
||||
n->m_next = n2;
|
||||
newipsecstat.ips_mbinserted++;
|
||||
} else {
|
||||
memcpy(mtod(n, void *) + hlen,
|
||||
mtod(m, void *) + skip, remain);
|
||||
memcpy(mtod(n, char *) + hlen,
|
||||
mtod(m, char *) + skip, remain);
|
||||
n->m_len += remain;
|
||||
}
|
||||
m->m_len -= remain;
|
||||
@ -305,8 +305,8 @@ m_makespace(struct mbuf *m0, int skip, int hlen, int *off)
|
||||
* so there's space to write the new header.
|
||||
*/
|
||||
/* XXX can this be memcpy? does it handle overlap? */
|
||||
ovbcopy(mtod(m, void *) + skip,
|
||||
mtod(m, void *) + skip + hlen, remain);
|
||||
ovbcopy(mtod(m, char *) + skip,
|
||||
mtod(m, char *) + skip + hlen, remain);
|
||||
m->m_len += hlen;
|
||||
*off = skip;
|
||||
}
|
||||
@ -466,7 +466,7 @@ m_checkalignment(const char* where, struct mbuf *m0, int off, int len)
|
||||
if (m == NULL)
|
||||
return;
|
||||
printf("%s (off %u len %u): ", where, off, len);
|
||||
addr = mtod(m, void *) + roff;
|
||||
addr = mtod(m, char *) + roff;
|
||||
do {
|
||||
int mlen;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ipsec_netbsd.c,v 1.22 2007/03/04 06:03:29 christos Exp $ */
|
||||
/* $NetBSD: ipsec_netbsd.c,v 1.23 2007/03/04 19:54:48 degroote Exp $ */
|
||||
/* $KAME: esp_input.c,v 1.60 2001/09/04 08:43:19 itojun Exp $ */
|
||||
/* $KAME: ah_input.c,v 1.64 2001/09/04 08:43:19 itojun Exp $ */
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: ipsec_netbsd.c,v 1.22 2007/03/04 06:03:29 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: ipsec_netbsd.c,v 1.23 2007/03/04 19:54:48 degroote Exp $");
|
||||
|
||||
#include "opt_inet.h"
|
||||
#include "opt_ipsec.h"
|
||||
@ -110,7 +110,7 @@ ah4_ctlinput(cmd, sa, v)
|
||||
* Check to see if we have a valid SA corresponding to
|
||||
* the address in the ICMP message payload.
|
||||
*/
|
||||
ah = (struct ah *)((void *)ip + (ip->ip_hl << 2));
|
||||
ah = (struct ah *)((char *)ip + (ip->ip_hl << 2));
|
||||
sav = KEY_ALLOCSA((const union sockaddr_union *)sa,
|
||||
IPPROTO_AH, ah->ah_spi);
|
||||
|
||||
@ -125,7 +125,7 @@ ah4_ctlinput(cmd, sa, v)
|
||||
* recalculate the new MTU, and create the
|
||||
* corresponding routing entry.
|
||||
*/
|
||||
icp = (struct icmp *)((void *)ip -
|
||||
icp = (struct icmp *)((char *)ip -
|
||||
offsetof(struct icmp, icmp_ip));
|
||||
icmp_mtudisc(icp, ip->ip_dst);
|
||||
|
||||
@ -161,7 +161,7 @@ esp4_ctlinput(cmd, sa, v)
|
||||
* Check to see if we have a valid SA corresponding to
|
||||
* the address in the ICMP message payload.
|
||||
*/
|
||||
esp = (struct esp *)((void *)ip + (ip->ip_hl << 2));
|
||||
esp = (struct esp *)((char *)ip + (ip->ip_hl << 2));
|
||||
sav = KEY_ALLOCSA((const union sockaddr_union *)sa,
|
||||
IPPROTO_ESP, esp->esp_spi);
|
||||
|
||||
@ -177,7 +177,7 @@ esp4_ctlinput(cmd, sa, v)
|
||||
* corresponding routing entry.
|
||||
*/
|
||||
|
||||
icp = (struct icmp *)((void *)ip -
|
||||
icp = (struct icmp *)((char *)ip -
|
||||
offsetof(struct icmp, icmp_ip));
|
||||
icmp_mtudisc(icp, ip->ip_dst);
|
||||
|
||||
@ -239,7 +239,7 @@ ah6_ctlinput(cmd, sa, d)
|
||||
m_copydata(m, off, sizeof(ah), (void *)&ah);
|
||||
ahp = &ah;
|
||||
} else
|
||||
ahp = (struct newah *)(mtod(m, void *) + off);
|
||||
ahp = (struct newah *)(mtod(m, char *) + off);
|
||||
|
||||
if (cmd == PRC_MSGSIZE) {
|
||||
int valid = 0;
|
||||
@ -346,7 +346,7 @@ esp6_ctlinput(cmd, sa, d)
|
||||
m_copydata(m, off, sizeof(esp), (void *)&esp);
|
||||
espp = &esp;
|
||||
} else
|
||||
espp = (struct newesp*)(mtod(m, void *) + off);
|
||||
espp = (struct newesp*)(mtod(m, char *) + off);
|
||||
|
||||
if (cmd == PRC_MSGSIZE) {
|
||||
int valid = 0;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: key.c,v 1.38 2007/03/04 06:03:29 christos Exp $ */
|
||||
/* $NetBSD: key.c,v 1.39 2007/03/04 19:54:49 degroote Exp $ */
|
||||
/* $FreeBSD: src/sys/netipsec/key.c,v 1.3.2.3 2004/02/14 22:23:23 bms Exp $ */
|
||||
/* $KAME: key.c,v 1.191 2001/06/27 10:46:49 sakane Exp $ */
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.38 2007/03/04 06:03:29 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.39 2007/03/04 19:54:49 degroote Exp $");
|
||||
|
||||
/*
|
||||
* This code is referd to RFC 2367
|
||||
@ -1535,7 +1535,7 @@ key_msg2sp(xpl0, len, error)
|
||||
bcopy(paddr, &(*p_isr)->saidx.src,
|
||||
paddr->sa_len);
|
||||
|
||||
paddr = (struct sockaddr *)((void *)paddr
|
||||
paddr = (struct sockaddr *)((char *)paddr
|
||||
+ paddr->sa_len);
|
||||
|
||||
/* validity check */
|
||||
@ -1566,7 +1566,7 @@ key_msg2sp(xpl0, len, error)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
xisr = (struct sadb_x_ipsecrequest *)((void *)xisr
|
||||
xisr = (struct sadb_x_ipsecrequest *)((char *)xisr
|
||||
+ xisr->sadb_x_ipsecrequest_len);
|
||||
}
|
||||
}
|
||||
@ -1604,7 +1604,7 @@ key_sp2msg(sp)
|
||||
{
|
||||
struct sadb_x_policy *xpl;
|
||||
int tlen;
|
||||
void *p;
|
||||
char *p;
|
||||
struct mbuf *m;
|
||||
|
||||
/* sanity check. */
|
||||
@ -1630,7 +1630,7 @@ key_sp2msg(sp)
|
||||
xpl->sadb_x_policy_type = sp->policy;
|
||||
xpl->sadb_x_policy_dir = sp->spidx.dir;
|
||||
xpl->sadb_x_policy_id = sp->id;
|
||||
p = (void *)xpl + sizeof(*xpl);
|
||||
p = (char *)xpl + sizeof(*xpl);
|
||||
|
||||
/* if is the policy for ipsec ? */
|
||||
if (sp->policy == IPSEC_POLICY_IPSEC) {
|
||||
@ -1968,7 +1968,7 @@ key_spdadd(so, m, mhp)
|
||||
/* n is already freed */
|
||||
return key_senderror(so, m, ENOBUFS);
|
||||
}
|
||||
xpl = (struct sadb_x_policy *)(mtod(mpolicy, void *) + off);
|
||||
xpl = (struct sadb_x_policy *)(mtod(mpolicy, char *) + off);
|
||||
if (xpl->sadb_x_policy_exttype != SADB_X_EXT_POLICY) {
|
||||
m_freem(n);
|
||||
return key_senderror(so, m, EINVAL);
|
||||
@ -2191,7 +2191,7 @@ key_spddelete2(so, m, mhp)
|
||||
n->m_next = NULL;
|
||||
off = 0;
|
||||
|
||||
m_copydata(m, 0, sizeof(struct sadb_msg), mtod(n, void *) + off);
|
||||
m_copydata(m, 0, sizeof(struct sadb_msg), mtod(n, char *) + off);
|
||||
off += PFKEY_ALIGN8(sizeof(struct sadb_msg));
|
||||
|
||||
#ifdef DIAGNOSTIC
|
||||
@ -2680,7 +2680,7 @@ key_spdexpire(sp)
|
||||
lt->sadb_lifetime_bytes = 0;
|
||||
lt->sadb_lifetime_addtime = sp->created;
|
||||
lt->sadb_lifetime_usetime = sp->lastused;
|
||||
lt = (struct sadb_lifetime *)(mtod(m, void *) + len / 2);
|
||||
lt = (struct sadb_lifetime *)(mtod(m, char *) + len / 2);
|
||||
lt->sadb_lifetime_len = PFKEY_UNIT64(sizeof(struct sadb_lifetime));
|
||||
lt->sadb_lifetime_exttype = SADB_EXT_LIFETIME_HARD;
|
||||
lt->sadb_lifetime_allocations = 0;
|
||||
@ -3712,7 +3712,7 @@ key_setsadbaddr(exttype, saddr, prefixlen, ul_proto)
|
||||
p->sadb_address_reserved = 0;
|
||||
|
||||
bcopy(saddr,
|
||||
mtod(m, void *) + PFKEY_ALIGN8(sizeof(struct sadb_address)),
|
||||
mtod(m, char *) + PFKEY_ALIGN8(sizeof(struct sadb_address)),
|
||||
saddr->sa_len);
|
||||
|
||||
return m;
|
||||
@ -4754,10 +4754,10 @@ key_getspi(so, m, mhp)
|
||||
n->m_next = NULL;
|
||||
off = 0;
|
||||
|
||||
m_copydata(m, 0, sizeof(struct sadb_msg), mtod(n, void *) + off);
|
||||
m_copydata(m, 0, sizeof(struct sadb_msg), mtod(n, char *) + off);
|
||||
off += PFKEY_ALIGN8(sizeof(struct sadb_msg));
|
||||
|
||||
m_sa = (struct sadb_sa *)(mtod(n, void *) + off);
|
||||
m_sa = (struct sadb_sa *)(mtod(n, char *) + off);
|
||||
m_sa->sadb_sa_len = PFKEY_UNIT64(sizeof(struct sadb_sa));
|
||||
m_sa->sadb_sa_exttype = SADB_EXT_SA;
|
||||
m_sa->sadb_sa_spi = htonl(spi);
|
||||
@ -5651,7 +5651,7 @@ key_getcomb_esp()
|
||||
/* m is already freed */
|
||||
goto fail;
|
||||
}
|
||||
comb = (struct sadb_comb *)(mtod(n, void *) + o);
|
||||
comb = (struct sadb_comb *)(mtod(n, char *) + o);
|
||||
bzero(comb, sizeof(*comb));
|
||||
key_getcomb_setlifetime(comb);
|
||||
comb->sadb_comb_encrypt = i;
|
||||
@ -6346,7 +6346,7 @@ key_register(so, m, mhp)
|
||||
n->m_next = NULL;
|
||||
off = 0;
|
||||
|
||||
m_copydata(m, 0, sizeof(struct sadb_msg), mtod(n, void *) + off);
|
||||
m_copydata(m, 0, sizeof(struct sadb_msg), mtod(n, char *) + off);
|
||||
newmsg = mtod(n, struct sadb_msg *);
|
||||
newmsg->sadb_msg_errno = 0;
|
||||
newmsg->sadb_msg_len = PFKEY_UNIT64(len);
|
||||
@ -6354,7 +6354,7 @@ key_register(so, m, mhp)
|
||||
|
||||
/* for authentication algorithm */
|
||||
if (alen) {
|
||||
sup = (struct sadb_supported *)(mtod(n, void *) + off);
|
||||
sup = (struct sadb_supported *)(mtod(n, char *) + off);
|
||||
sup->sadb_supported_len = PFKEY_UNIT64(alen);
|
||||
sup->sadb_supported_exttype = SADB_EXT_SUPPORTED_AUTH;
|
||||
off += PFKEY_ALIGN8(sizeof(*sup));
|
||||
@ -6366,7 +6366,7 @@ key_register(so, m, mhp)
|
||||
aalgo = ah_algorithm_lookup(i);
|
||||
if (!aalgo)
|
||||
continue;
|
||||
alg = (struct sadb_alg *)(mtod(n, void *) + off);
|
||||
alg = (struct sadb_alg *)(mtod(n, char *) + off);
|
||||
alg->sadb_alg_id = i;
|
||||
alg->sadb_alg_ivlen = 0;
|
||||
key_getsizes_ah(aalgo, i, &minkeysize, &maxkeysize);
|
||||
@ -6378,7 +6378,7 @@ key_register(so, m, mhp)
|
||||
|
||||
/* for encryption algorithm */
|
||||
if (elen) {
|
||||
sup = (struct sadb_supported *)(mtod(n, void *) + off);
|
||||
sup = (struct sadb_supported *)(mtod(n, char *) + off);
|
||||
sup->sadb_supported_len = PFKEY_UNIT64(elen);
|
||||
sup->sadb_supported_exttype = SADB_EXT_SUPPORTED_ENCRYPT;
|
||||
off += PFKEY_ALIGN8(sizeof(*sup));
|
||||
@ -6389,7 +6389,7 @@ key_register(so, m, mhp)
|
||||
ealgo = esp_algorithm_lookup(i);
|
||||
if (!ealgo)
|
||||
continue;
|
||||
alg = (struct sadb_alg *)(mtod(n, void *) + off);
|
||||
alg = (struct sadb_alg *)(mtod(n, char *) + off);
|
||||
alg->sadb_alg_id = i;
|
||||
alg->sadb_alg_ivlen = ealgo->blocksize;
|
||||
alg->sadb_alg_minbits = _BITS(ealgo->minkey);
|
||||
@ -6517,7 +6517,7 @@ key_expire(sav)
|
||||
lt->sadb_lifetime_bytes = sav->lft_c->sadb_lifetime_bytes;
|
||||
lt->sadb_lifetime_addtime = sav->lft_c->sadb_lifetime_addtime;
|
||||
lt->sadb_lifetime_usetime = sav->lft_c->sadb_lifetime_usetime;
|
||||
lt = (struct sadb_lifetime *)(mtod(m, void *) + len / 2);
|
||||
lt = (struct sadb_lifetime *)(mtod(m, char *) + len / 2);
|
||||
bcopy(sav->lft_s, lt, sizeof(*lt));
|
||||
m_cat(result, m);
|
||||
|
||||
@ -7228,7 +7228,7 @@ key_align(m, mhp)
|
||||
/* m is already freed */
|
||||
return ENOBUFS;
|
||||
}
|
||||
ext = (struct sadb_ext *)(mtod(n, void *) + toff);
|
||||
ext = (struct sadb_ext *)(mtod(n, char *) + toff);
|
||||
|
||||
/* set pointer */
|
||||
switch (ext->sadb_ext_type) {
|
||||
@ -7286,7 +7286,7 @@ key_align(m, mhp)
|
||||
/* m is already freed */
|
||||
return ENOBUFS;
|
||||
}
|
||||
ext = (struct sadb_ext *)(mtod(n, void *) + toff);
|
||||
ext = (struct sadb_ext *)(mtod(n, char *) + toff);
|
||||
|
||||
mhp->ext[ext->sadb_ext_type] = ext;
|
||||
mhp->extoff[ext->sadb_ext_type] = off;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: key_debug.c,v 1.6 2007/03/04 06:03:29 christos Exp $ */
|
||||
/* $NetBSD: key_debug.c,v 1.7 2007/03/04 19:54:49 degroote Exp $ */
|
||||
/* $FreeBSD: src/sys/netipsec/key_debug.c,v 1.1.4.1 2003/01/24 05:11:36 sam Exp $ */
|
||||
/* $KAME: key_debug.c,v 1.26 2001/06/27 10:46:50 sakane Exp $ */
|
||||
|
||||
@ -33,7 +33,7 @@
|
||||
|
||||
#ifdef _KERNEL
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: key_debug.c,v 1.6 2007/03/04 06:03:29 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: key_debug.c,v 1.7 2007/03/04 19:54:49 degroote Exp $");
|
||||
#endif
|
||||
|
||||
#include "opt_inet.h"
|
||||
@ -104,7 +104,7 @@ kdebug_sadb(base)
|
||||
base->sadb_msg_seq, base->sadb_msg_pid);
|
||||
|
||||
tlen = PFKEY_UNUNIT64(base->sadb_msg_len) - sizeof(struct sadb_msg);
|
||||
ext = (struct sadb_ext *)((void *)base + sizeof(struct sadb_msg));
|
||||
ext = (struct sadb_ext *)((char *)base + sizeof(struct sadb_msg));
|
||||
|
||||
while (tlen > 0) {
|
||||
printf("sadb_ext{ len=%u type=%u }\n",
|
||||
@ -167,7 +167,7 @@ kdebug_sadb(base)
|
||||
|
||||
extlen = PFKEY_UNUNIT64(ext->sadb_ext_len);
|
||||
tlen -= extlen;
|
||||
ext = (struct sadb_ext *)((void *)ext + extlen);
|
||||
ext = (struct sadb_ext *)((char *)ext + extlen);
|
||||
}
|
||||
|
||||
return;
|
||||
@ -243,7 +243,7 @@ kdebug_sadb_identity(ext)
|
||||
id->sadb_ident_type, (u_long)id->sadb_ident_id);
|
||||
if (len) {
|
||||
#ifdef _KERNEL
|
||||
ipsec_hexdump((void *)(id + 1), len); /*XXX cast ?*/
|
||||
ipsec_hexdump((char *)(id + 1), len); /*XXX cast ?*/
|
||||
#else
|
||||
char *p, *ep;
|
||||
printf("\n str=\"");
|
||||
@ -347,7 +347,7 @@ kdebug_sadb_address(ext)
|
||||
((u_char *)&addr->sadb_address_reserved)[0],
|
||||
((u_char *)&addr->sadb_address_reserved)[1]);
|
||||
|
||||
kdebug_sockaddr((struct sockaddr *)((void *)ext + sizeof(*addr)));
|
||||
kdebug_sockaddr((struct sockaddr *)((char *)ext + sizeof(*addr)));
|
||||
|
||||
return;
|
||||
}
|
||||
@ -374,7 +374,7 @@ kdebug_sadb_key(ext)
|
||||
(long)PFKEY_UNUNIT64(key->sadb_key_len) - sizeof(struct sadb_key));
|
||||
}
|
||||
|
||||
ipsec_hexdump((void *)key + sizeof(struct sadb_key),
|
||||
ipsec_hexdump((char *)key + sizeof(struct sadb_key),
|
||||
key->sadb_key_bits >> 3);
|
||||
printf(" }\n");
|
||||
return;
|
||||
@ -432,7 +432,7 @@ kdebug_sadb_x_policy(ext)
|
||||
if (xisr->sadb_x_ipsecrequest_len > sizeof(*xisr)) {
|
||||
addr = (struct sockaddr *)(xisr + 1);
|
||||
kdebug_sockaddr(addr);
|
||||
addr = (struct sockaddr *)((void *)addr
|
||||
addr = (struct sockaddr *)((char *)addr
|
||||
+ addr->sa_len);
|
||||
kdebug_sockaddr(addr);
|
||||
}
|
||||
@ -452,7 +452,7 @@ kdebug_sadb_x_policy(ext)
|
||||
|
||||
tlen -= xisr->sadb_x_ipsecrequest_len;
|
||||
|
||||
xisr = (struct sadb_x_ipsecrequest *)((void *)xisr
|
||||
xisr = (struct sadb_x_ipsecrequest *)((char *)xisr
|
||||
+ xisr->sadb_x_ipsecrequest_len);
|
||||
}
|
||||
|
||||
@ -723,7 +723,7 @@ kdebug_sockaddr(addr)
|
||||
|
||||
void
|
||||
ipsec_bindump(buf, len)
|
||||
void *buf;
|
||||
char *buf;
|
||||
int len;
|
||||
{
|
||||
int i;
|
||||
@ -737,7 +737,7 @@ ipsec_bindump(buf, len)
|
||||
|
||||
void
|
||||
ipsec_hexdump(buf, len)
|
||||
void *buf;
|
||||
char *buf;
|
||||
int len;
|
||||
{
|
||||
int i;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: key_debug.h,v 1.3 2007/03/04 06:03:29 christos Exp $ */
|
||||
/* $NetBSD: key_debug.h,v 1.4 2007/03/04 19:54:49 degroote Exp $ */
|
||||
/* $FreeBSD: src/sys/netipsec/key_debug.h,v 1.1.4.1 2003/01/24 05:11:36 sam Exp $ */
|
||||
/* $KAME: key_debug.h,v 1.10 2001/08/05 08:37:52 itojun Exp $ */
|
||||
|
||||
@ -83,7 +83,7 @@ extern void kdebug_mbuf __P((struct mbuf *));
|
||||
struct sockaddr;
|
||||
extern void kdebug_sockaddr __P((struct sockaddr *));
|
||||
|
||||
extern void ipsec_hexdump __P((void *, int));
|
||||
extern void ipsec_bindump __P((void *, int));
|
||||
extern void ipsec_hexdump __P((char *, int));
|
||||
extern void ipsec_bindump __P((char *, int));
|
||||
|
||||
#endif /* !_NETIPSEC_KEY_DEBUG_H_ */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: keydb.h,v 1.3 2007/03/04 06:03:30 christos Exp $ */
|
||||
/* $NetBSD: keydb.h,v 1.4 2007/03/04 19:54:49 degroote Exp $ */
|
||||
/* $FreeBSD: src/sys/netipsec/keydb.h,v 1.1.4.1 2003/01/24 05:11:36 sam Exp $ */
|
||||
/* $KAME: keydb.h,v 1.14 2000/08/02 17:58:26 sakane Exp $ */
|
||||
|
||||
@ -133,7 +133,7 @@ struct secreplay {
|
||||
u_int wsize; /* window size, i.g. 4 bytes */
|
||||
u_int32_t seq; /* used by sender */
|
||||
u_int32_t lastseq; /* used by receiver */
|
||||
void *bitmap; /* used by receiver */
|
||||
char *bitmap; /* used by receiver */
|
||||
int overflow; /* overflow flag */
|
||||
};
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: xform_ah.c,v 1.13 2007/03/04 06:03:30 christos Exp $ */
|
||||
/* $NetBSD: xform_ah.c,v 1.14 2007/03/04 19:54:49 degroote Exp $ */
|
||||
/* $FreeBSD: src/sys/netipsec/xform_ah.c,v 1.1.4.1 2003/01/24 05:11:36 sam Exp $ */
|
||||
/* $OpenBSD: ip_ah.c,v 1.63 2001/06/26 06:18:58 angelos Exp $ */
|
||||
/*
|
||||
@ -39,7 +39,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: xform_ah.c,v 1.13 2007/03/04 06:03:30 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: xform_ah.c,v 1.14 2007/03/04 19:54:49 degroote Exp $");
|
||||
|
||||
#include "opt_inet.h"
|
||||
#ifdef __FreeBSD__
|
||||
@ -707,10 +707,10 @@ ah_input(struct mbuf *m, struct secasvar *sav, int skip, int protoff)
|
||||
* Save the authenticator, the skipped portion of the packet,
|
||||
* and the AH header.
|
||||
*/
|
||||
m_copydata(m, 0, skip + rplen + authsize, (void *)(tc+1));
|
||||
m_copydata(m, 0, skip + rplen + authsize, (char *)(tc+1));
|
||||
|
||||
{
|
||||
u_int8_t *pppp = ((void *)(tc+1))+skip+rplen;
|
||||
u_int8_t *pppp = ((char *)(tc+1))+skip+rplen;
|
||||
DPRINTF(("ah_input: zeroing %d bytes of authent " \
|
||||
"%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x\n",
|
||||
authsize,
|
||||
@ -791,7 +791,7 @@ ah_input_cb(struct cryptop *crp)
|
||||
struct secasvar *sav;
|
||||
struct secasindex *saidx;
|
||||
u_int8_t nxt;
|
||||
void *ptr;
|
||||
char *ptr;
|
||||
int s, authsize;
|
||||
|
||||
crd = crp->crp_desc;
|
||||
@ -863,7 +863,7 @@ ah_input_cb(struct cryptop *crp)
|
||||
* it has been verified by an IPsec-aware NIC.
|
||||
*/
|
||||
if (mtag == NULL) {
|
||||
ptr = (void *) (tc + 1);
|
||||
ptr = (char *) (tc + 1);
|
||||
|
||||
/* Verify authenticator. */
|
||||
if (bcmp(ptr + skip + rplen, calc, authsize)) {
|
||||
@ -1049,10 +1049,10 @@ ah_output(
|
||||
* The AH header is guaranteed by m_makespace() to be in
|
||||
* contiguous memory, at roff bytes offset into the returned mbuf.
|
||||
*/
|
||||
ah = (struct newah *)(mtod(mi, void *) + roff);
|
||||
ah = (struct newah *)(mtod(mi, char *) + roff);
|
||||
|
||||
/* Initialize the AH header. */
|
||||
m_copydata(m, protoff, sizeof(u_int8_t), (void *) &ah->ah_nxt);
|
||||
m_copydata(m, protoff, sizeof(u_int8_t), (char *) &ah->ah_nxt);
|
||||
ah->ah_len = (rplen + authsize - sizeof(struct ah)) / sizeof(u_int32_t);
|
||||
ah->ah_reserve = 0;
|
||||
ah->ah_spi = sav->spi;
|
||||
@ -1122,7 +1122,7 @@ ah_output(
|
||||
switch (sav->sah->saidx.dst.sa.sa_family) {
|
||||
#ifdef INET
|
||||
case AF_INET:
|
||||
bcopy(((void *)(tc + 1)) +
|
||||
bcopy(((char *)(tc + 1)) +
|
||||
offsetof(struct ip, ip_len),
|
||||
(void *) &iplen, sizeof(u_int16_t));
|
||||
iplen = htons(ntohs(iplen) + rplen + authsize);
|
||||
@ -1133,7 +1133,7 @@ ah_output(
|
||||
|
||||
#ifdef INET6
|
||||
case AF_INET6:
|
||||
bcopy(((void *)(tc + 1)) +
|
||||
bcopy(((char *)(tc + 1)) +
|
||||
offsetof(struct ip6_hdr, ip6_plen),
|
||||
(void *) &iplen, sizeof(u_int16_t));
|
||||
iplen = htons(ntohs(iplen) + rplen + authsize);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: xform_esp.c,v 1.13 2007/03/04 06:03:30 christos Exp $ */
|
||||
/* $NetBSD: xform_esp.c,v 1.14 2007/03/04 19:54:49 degroote Exp $ */
|
||||
/* $FreeBSD: src/sys/netipsec/xform_esp.c,v 1.2.2.1 2003/01/24 05:11:36 sam Exp $ */
|
||||
/* $OpenBSD: ip_esp.c,v 1.69 2001/06/26 06:18:59 angelos Exp $ */
|
||||
|
||||
@ -39,7 +39,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: xform_esp.c,v 1.13 2007/03/04 06:03:30 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: xform_esp.c,v 1.14 2007/03/04 19:54:49 degroote Exp $");
|
||||
|
||||
#include "opt_inet.h"
|
||||
#ifdef __FreeBSD__
|
||||
@ -776,7 +776,7 @@ esp_output(
|
||||
}
|
||||
|
||||
/* Initialize ESP header. */
|
||||
bcopy((void *) &sav->spi, mtod(mo, void *) + roff, sizeof(u_int32_t));
|
||||
bcopy((void *) &sav->spi, mtod(mo, char *) + roff, sizeof(u_int32_t));
|
||||
if (sav->replay) {
|
||||
u_int32_t replay;
|
||||
|
||||
@ -788,7 +788,7 @@ esp_output(
|
||||
|
||||
replay = htonl(sav->replay->count);
|
||||
bcopy((void *) &replay,
|
||||
mtod(mo, void *) + roff + sizeof(u_int32_t),
|
||||
mtod(mo,char *) + roff + sizeof(u_int32_t),
|
||||
sizeof(u_int32_t));
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: xform_ipcomp.c,v 1.11 2007/03/04 06:03:30 christos Exp $ */
|
||||
/* $NetBSD: xform_ipcomp.c,v 1.12 2007/03/04 19:54:49 degroote Exp $ */
|
||||
/* $FreeBSD: src/sys/netipsec/xform_ipcomp.c,v 1.1.4.1 2003/01/24 05:11:36 sam Exp $ */
|
||||
/* $OpenBSD: ip_ipcomp.c,v 1.1 2001/07/05 12:08:52 jjbg Exp $ */
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: xform_ipcomp.c,v 1.11 2007/03/04 06:03:30 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: xform_ipcomp.c,v 1.12 2007/03/04 19:54:49 degroote Exp $");
|
||||
|
||||
/* IP payload compression protocol (IPComp), see RFC 2393 */
|
||||
#include "opt_inet.h"
|
||||
@ -295,7 +295,7 @@ ipcomp_input_cb(struct cryptop *crp)
|
||||
}
|
||||
|
||||
/* Keep the next protocol field */
|
||||
addr = (void *) mtod(m, struct ip *) + skip;
|
||||
addr = mtod(m, struct ip *) + skip;
|
||||
nproto = ((struct ipcomp *) addr)->comp_nxt;
|
||||
|
||||
/* Remove the IPCOMP header */
|
||||
@ -537,7 +537,7 @@ ipcomp_output_cb(struct cryptop *crp)
|
||||
error = ENOBUFS;
|
||||
goto bad;
|
||||
}
|
||||
ipcomp = (struct ipcomp *)(mtod(mo, void *) + roff);
|
||||
ipcomp = (struct ipcomp *)(mtod(mo, char *) + roff);
|
||||
|
||||
/* Initialize the IPCOMP header */
|
||||
/* XXX alignment always correct? */
|
||||
|
Loading…
Reference in New Issue
Block a user