summaryrefslogtreecommitdiff
path: root/sys/netinet/ip_ipsp.c
diff options
context:
space:
mode:
authorAngelos D. Keromytis <angelos@cvs.openbsd.org>1999-12-25 07:09:44 +0000
committerAngelos D. Keromytis <angelos@cvs.openbsd.org>1999-12-25 07:09:44 +0000
commit3a07de35f8cbb40c0d89df12d80bfbc4de0bcb6a (patch)
treebce79d979890ed81a8b555a6e5eddff5ccf0022b /sys/netinet/ip_ipsp.c
parent094791be4d235c40b2f3721658af000361b03dac (diff)
Change some function prototypes, dont unnecessarily initialize some
variables.
Diffstat (limited to 'sys/netinet/ip_ipsp.c')
-rw-r--r--sys/netinet/ip_ipsp.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/sys/netinet/ip_ipsp.c b/sys/netinet/ip_ipsp.c
index 8f6b4a6bcc7..80c36fbb6af 100644
--- a/sys/netinet/ip_ipsp.c
+++ b/sys/netinet/ip_ipsp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_ipsp.c,v 1.60 1999/12/25 04:48:16 angelos Exp $ */
+/* $OpenBSD: ip_ipsp.c,v 1.61 1999/12/25 07:09:42 angelos Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
@@ -1619,29 +1619,26 @@ ipsp_process_packet(struct mbuf *m, struct mbuf **mp, struct tdb *tdb, int *af,
{
ip->ip_len = htons(m->m_pkthdr.len);
ip->ip_sum = in_cksum(m, ip->ip_hl << 2);
- i = ip->ip_hl << 2;
- off = offsetof(struct ip, ip_p);
}
#endif /* INET */
#ifdef INET6
/* Fix IPv6 header payload length */
if ((*af) == AF_INET6)
- {
- ip6->ip6_plen = htons(m->m_pkthdr.len);
- i = sizeof(struct ip6_hdr);
- off = offsetof(struct ip6_hdr, ip6_nxt);
- }
+ ip6->ip6_plen = htons(m->m_pkthdr.len);
#endif /* INET6 */
- /* Encapsulate */
- error = ipe4_output(m, tdb, mp, i, off);
- if ((*mp) == NULL)
+ /* Encapsulate -- the last two arguments are unused */
+ error = ipe4_output(m, tdb, mp, 0, 0);
+ if (((*mp) == NULL) && (!error))
error = EFAULT;
if (error)
{
if (*mp)
- m_freem(*mp);
+ {
+ m_freem(*mp);
+ *mp = NULL;
+ }
return error;
}