diff options
author | Hakan Olsson <ho@cvs.openbsd.org> | 2001-06-29 18:45:30 +0000 |
---|---|---|
committer | Hakan Olsson <ho@cvs.openbsd.org> | 2001-06-29 18:45:30 +0000 |
commit | 3d6be290c7eacaeaa47182b99ba881001085d78e (patch) | |
tree | 0848597d679e5892cba645537341da316d8d0d82 /sbin | |
parent | ad52629aefaceae3b6d9ef8b4bb563c1a63155b0 (diff) |
More sa_len usage.
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/isakmpd/sysdep/bsdi/sysdep.c | 5 | ||||
-rw-r--r-- | sbin/isakmpd/sysdep/freebsd/sysdep.c | 5 | ||||
-rw-r--r-- | sbin/isakmpd/sysdep/linux/klips.c | 21 | ||||
-rw-r--r-- | sbin/isakmpd/sysdep/netbsd/sysdep.c | 5 | ||||
-rw-r--r-- | sbin/isakmpd/sysdep/openbsd-encap/sysdep.c | 5 | ||||
-rw-r--r-- | sbin/isakmpd/sysdep/openbsd/sysdep.c | 5 |
6 files changed, 24 insertions, 22 deletions
diff --git a/sbin/isakmpd/sysdep/bsdi/sysdep.c b/sbin/isakmpd/sysdep/bsdi/sysdep.c index 825f29c5ab6..50d926ce9ef 100644 --- a/sbin/isakmpd/sysdep/bsdi/sysdep.c +++ b/sbin/isakmpd/sysdep/bsdi/sysdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sysdep.c,v 1.2 2001/05/05 00:51:46 angelos Exp $ */ +/* $OpenBSD: sysdep.c,v 1.3 2001/06/29 18:45:27 ho Exp $ */ /* * Copyright (c) 1998, 1999 Niklas Hallqvist. All rights reserved. @@ -118,7 +118,8 @@ sysdep_ipsec_get_spi (size_t *sz, u_int8_t proto, struct sockaddr *src, /* XXX should be random instead I think. */ return strdup ("\x12\x34\x56\x78"); } - return KEY_API (get_spi) (sz, proto, src, srclen, dst, dstlen, seq); + return KEY_API (get_spi) (sz, proto, src, src->sa_len, dst, dst->sa_len, + seq); } /* Force communication on socket FD to go in the clear. */ diff --git a/sbin/isakmpd/sysdep/freebsd/sysdep.c b/sbin/isakmpd/sysdep/freebsd/sysdep.c index 9f4a5eaf568..fd399485c74 100644 --- a/sbin/isakmpd/sysdep/freebsd/sysdep.c +++ b/sbin/isakmpd/sysdep/freebsd/sysdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sysdep.c,v 1.4 2001/05/05 00:51:47 angelos Exp $ */ +/* $OpenBSD: sysdep.c,v 1.5 2001/06/29 18:45:28 ho Exp $ */ /* * Copyright (c) 1998, 1999 Niklas Hallqvist. All rights reserved. @@ -124,7 +124,8 @@ sysdep_ipsec_get_spi (size_t *sz, u_int8_t proto, struct sockaddr *src, /* XXX should be random instead I think. */ return strdup ("\x12\x34\x56\x78"); } - return KEY_API (get_spi) (sz, proto, src, srclen, dst, dstlen, seq); + return KEY_API (get_spi) (sz, proto, src, src->sa_len, dst, dst->sa_len, + seq); } /* Force communication on socket FD to go in the clear. */ diff --git a/sbin/isakmpd/sysdep/linux/klips.c b/sbin/isakmpd/sysdep/linux/klips.c index a1e76efda61..b307ff0c2ba 100644 --- a/sbin/isakmpd/sysdep/linux/klips.c +++ b/sbin/isakmpd/sysdep/linux/klips.c @@ -1,4 +1,4 @@ -/* $OpenBSD: klips.c,v 1.6 2001/06/27 03:31:44 angelos Exp $ */ +/* $OpenBSD: klips.c,v 1.7 2001/06/29 18:45:29 ho Exp $ */ /* * Copyright (c) 1999 Niklas Hallqvist. All rights reserved. @@ -163,7 +163,6 @@ klips_group_spis (struct sa *sa, struct proto *proto1, struct proto *proto2, { struct encap_msghdr *emsg = 0; struct sockaddr *dst; - int dstlen; emsg = calloc (1, EMT_GRPSPIS_FLEN + 2 * EMT_GRPSPIS_COMPLEN); if (!emsg) @@ -182,9 +181,9 @@ klips_group_spis (struct sa *sa, struct proto *proto1, struct proto *proto2, memcpy (&emsg->em_rel[1].emr_spi, proto2->spi[incoming], sizeof emsg->em_rel[1].emr_spi); if (incoming) - sa->transport->vtbl->get_src (sa->transport, &dst, &dstlen); + sa->transport->vtbl->get_src (sa->transport, &dst); else - sa->transport->vtbl->get_dst (sa->transport, &dst, &dstlen); + sa->transport->vtbl->get_dst (sa->transport, &dst); emsg->em_rel[0].emr_dst = emsg->em_rel[1].emr_dst = ((struct sockaddr_in *)dst)->sin_addr; /* XXX What if IPCOMP etc. comes along? */ @@ -215,7 +214,7 @@ klips_set_spi (struct sa *sa, struct proto *proto, int incoming, struct encap_msghdr *emsg = 0; struct ipsec_proto *iproto = proto->data; struct sockaddr *dst, *src; - int dstlen, srclen, keylen, hashlen; + int keylen, hashlen; size_t len; struct ipe4_xdata *ip4x; @@ -333,8 +332,8 @@ klips_set_spi (struct sa *sa, struct proto *proto, int incoming, /* * XXX Addresses has to be thought through. Assumes IPv4. */ - sa->transport->vtbl->get_dst (sa->transport, &dst, &dstlen); - sa->transport->vtbl->get_src (sa->transport, &src, &srclen); + sa->transport->vtbl->get_dst (sa->transport, &dst); + sa->transport->vtbl->get_src (sa->transport, &src); emsg->em_dst = ((struct sockaddr_in *)(incoming ? src : dst))->sin_addr; @@ -435,7 +434,6 @@ klips_delete_spi (struct sa *sa, struct proto *proto, int incoming) { struct encap_msghdr *emsg = 0; struct sockaddr *dst; - int dstlen; struct ipsec_proto *iproto = proto->data; emsg = calloc (1, EMT_SETSPI_FLEN); @@ -447,9 +445,9 @@ klips_delete_spi (struct sa *sa, struct proto *proto, int incoming) memcpy (&emsg->em_spi, proto->spi[incoming], sizeof emsg->em_spi); if (incoming) - sa->transport->vtbl->get_src (sa->transport, &dst, &dstlen); + sa->transport->vtbl->get_src (sa->transport, &dst); else - sa->transport->vtbl->get_dst (sa->transport, &dst, &dstlen); + sa->transport->vtbl->get_dst (sa->transport, &dst); emsg->em_dst = ((struct sockaddr_in *)dst)->sin_addr; /* XXX What if IPCOMP etc. comes along? */ emsg->em_proto @@ -552,14 +550,13 @@ klips_enable_sa (struct sa *sa, struct sa *isakmp_sa) { struct ipsec_sa *isa = sa->data; struct sockaddr *dst; - int dstlen; struct proto *proto = TAILQ_FIRST (&sa->protos); struct ipsec_proto *iproto = proto->data; struct encap_msghdr emsg; int s = -1; struct rtentry rt; - sa->transport->vtbl->get_dst (sa->transport, &dst, &dstlen); + sa->transport->vtbl->get_dst (sa->transport, &dst); /* XXX Is this needed? */ memset (&emsg, '\0', sizeof emsg); diff --git a/sbin/isakmpd/sysdep/netbsd/sysdep.c b/sbin/isakmpd/sysdep/netbsd/sysdep.c index f534da21042..0c97976695c 100644 --- a/sbin/isakmpd/sysdep/netbsd/sysdep.c +++ b/sbin/isakmpd/sysdep/netbsd/sysdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sysdep.c,v 1.4 2001/05/05 00:51:48 angelos Exp $ */ +/* $OpenBSD: sysdep.c,v 1.5 2001/06/29 18:45:28 ho Exp $ */ /* * Copyright (c) 1998, 1999 Niklas Hallqvist. All rights reserved. @@ -118,7 +118,8 @@ sysdep_ipsec_get_spi (size_t *sz, u_int8_t proto, struct sockaddr *src, /* XXX should be random instead I think. */ return strdup ("\x12\x34\x56\x78"); } - return KEY_API (get_spi) (sz, proto, src, srclen, dst, dstlen, seq); + return KEY_API (get_spi) (sz, proto, src, src->sa_len, dst, dst->sa_len, + seq); } /* Force communication on socket FD to go in the clear. */ diff --git a/sbin/isakmpd/sysdep/openbsd-encap/sysdep.c b/sbin/isakmpd/sysdep/openbsd-encap/sysdep.c index eef756f5d08..b4b823cc4a3 100644 --- a/sbin/isakmpd/sysdep/openbsd-encap/sysdep.c +++ b/sbin/isakmpd/sysdep/openbsd-encap/sysdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sysdep.c,v 1.4 2001/05/05 00:51:49 angelos Exp $ */ +/* $OpenBSD: sysdep.c,v 1.5 2001/06/29 18:45:27 ho Exp $ */ /* * Copyright (c) 1998, 1999 Niklas Hallqvist. All rights reserved. @@ -127,7 +127,8 @@ sysdep_ipsec_get_spi (size_t *sz, u_int8_t proto, struct sockaddr *src, /* XXX should be random instead I think. */ return strdup ("\x12\x34\x56\x78"); } - return KEY_API (get_spi) (sz, proto, src, srclen, dst, dstlen, seq); + return KEY_API (get_spi) (sz, proto, src, src->sa_len, dst, dst->sa_len, + seq); } /* Force communication on socket FD to go in the clear. */ diff --git a/sbin/isakmpd/sysdep/openbsd/sysdep.c b/sbin/isakmpd/sysdep/openbsd/sysdep.c index 8b722a20c23..bfc3890389a 100644 --- a/sbin/isakmpd/sysdep/openbsd/sysdep.c +++ b/sbin/isakmpd/sysdep/openbsd/sysdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sysdep.c,v 1.9 2001/05/05 00:51:49 angelos Exp $ */ +/* $OpenBSD: sysdep.c,v 1.10 2001/06/29 18:45:27 ho Exp $ */ /* $EOM: sysdep.c,v 1.9 2000/12/04 04:46:35 angelos Exp $ */ /* @@ -128,7 +128,8 @@ sysdep_ipsec_get_spi (size_t *sz, u_int8_t proto, struct sockaddr *src, /* XXX should be random instead I think. */ return strdup ("\x12\x34\x56\x78"); } - return KEY_API (get_spi) (sz, proto, src, srclen, dst, dstlen, seq); + return KEY_API (get_spi) (sz, proto, src, src->sa_len, dst, dst->sa_len, + seq); } /* Force communication on socket FD to go in the clear. */ |