/* $FreeBSD: src/sys/netinet6/dest6.c,v 1.1.2.4 2002/04/28 05:40:26 suz Exp $ */
-/* $DragonFly: src/sys/netinet6/dest6.c,v 1.4 2006/10/24 06:18:42 hsu Exp $ */
/* $KAME: dest6.c,v 1.34 2002/01/08 02:40:55 k-sugyou Exp $ */
/*
int off = *offp, dstoptlen, optlen;
struct ip6_dest *dstopts;
u_int8_t *opt;
- struct ip6_hdr *ip6;
-
- ip6 = mtod(m, struct ip6_hdr *);
/* validation of the length of the header */
#ifndef PULLDOWN_TEST
union cblock cblock;
u_int8_t keystream[AES_BLOCKSIZE], *nonce;
u_int32_t ctr;
- u_int8_t *ivp;
u_int8_t sbuf[AES_BLOCKSIZE], *sp, *dst;
struct mbuf *scut;
int scutoff;
s = m;
d = d0 = dp = NULL;
soff = doff = sn = dn = 0;
- ivp = sp = NULL;
+ sp = NULL;
/* skip bodyoff */
while (soff < bodyoff) {
int scutoff;
int i;
int blocklen;
- int derived;
if (ivlen != sav->ivlen || ivlen > sizeof(iv)) {
ipseclog((LOG_ERR, "esp_cbc_decrypt %s: "
/* RFC 1827 */
ivoff = off + sizeof(struct esp);
bodyoff = off + sizeof(struct esp) + ivlen;
- derived = 0;
} else {
/* RFC 2406 */
if (sav->flags & SADB_X_EXT_DERIV) {
ivoff = off + sizeof(struct esp);
bodyoff = off + sizeof(struct esp) + sizeof(u_int32_t);
ivlen = sizeof(u_int32_t);
- derived = 1;
} else {
ivoff = off + sizeof(struct newesp);
bodyoff = off + sizeof(struct newesp) + ivlen;
- derived = 0;
}
}
u_int16_t nxt;
const struct esp_algorithm *algo;
int ivlen;
- size_t hlen;
size_t esplen;
off = *offp;
ip = mtod(m, struct ip *);
esp = (struct esp *)(((u_int8_t *)ip) + off);
-#ifdef _IP_VHL
- hlen = IP_VHL_HL(ip->ip_vhl) << 2;
-#else
- hlen = ip->ip_hl << 2;
-#endif
/* find the sassoc. */
spi = esp->esp_spi;
/* $FreeBSD: src/sys/netinet6/esp_output.c,v 1.1.2.4 2003/05/06 06:46:58 suz Exp $ */
-/* $DragonFly: src/sys/netinet6/esp_output.c,v 1.9 2006/10/24 06:18:42 hsu Exp $ */
/* $KAME: esp_output.c,v 1.44 2001/07/26 06:53:15 jinmei Exp $ */
/*
#ifdef INET
struct ip *ip = NULL;
#endif
-#ifdef INET6
- struct ip6_hdr *ip6 = NULL;
-#endif
size_t esplen; /* sizeof(struct esp/newesp) */
size_t esphlen; /* sizeof(struct esp/newesp) + ivlen */
- size_t hlen = 0; /* ip header len */
if (sav->flags & SADB_X_EXT_OLD) {
/* RFC 1827 */
#ifdef INET
case AF_INET:
ip = mtod(m, struct ip *);
-#ifdef _IP_VHL
- hlen = IP_VHL_HL(ip->ip_vhl) << 2;
-#else
- hlen = ip->ip_hl << 2;
-#endif
break;
#endif
#ifdef INET6
case AF_INET6:
- ip6 = mtod(m, struct ip6_hdr *);
- hlen = sizeof(*ip6);
break;
#endif
}
int icmp6len = ntohs(ip6->ip6_plen);
char *lladdr = NULL;
int lladdrlen = 0;
+#if 0
u_char *redirhdr = NULL;
int redirhdrlen = 0;
+#endif
struct rtentry *rt = NULL;
int is_router;
int is_onlink;
lladdrlen = ndopts.nd_opts_tgt_lladdr->nd_opt_len << 3;
}
+#if 0
if (ndopts.nd_opts_rh) {
redirhdrlen = ndopts.nd_opts_rh->nd_opt_rh_len;
redirhdr = (u_char *)(ndopts.nd_opts_rh + 1); /* xxx */
}
+#endif
if (lladdr && ((ifp->if_addrlen + 2 + 7) & ~7) != lladdrlen) {
nd6log((LOG_INFO,
struct mbuf *m = *mp;
int off = *offp, hbhlen;
struct ip6_hbh *hbh;
- u_int8_t *opt;
/* validation of the length of the header */
#ifndef PULLDOWN_TEST
#endif
off += hbhlen;
hbhlen -= sizeof(struct ip6_hbh);
- opt = (u_int8_t *)hbh + sizeof(struct ip6_hbh);
if (ip6_process_hopopts(m, (u_int8_t *)hbh + sizeof(struct ip6_hbh),
hbhlen, rtalertp, plenp) < 0)
#define IS2292(x, y) ((in6p->in6p_flags & IN6P_RFC2292) ? (x) : (y))
struct thread *td = curthread; /* XXX */
int privileged = 0;
- int rthdr_exist = 0;
if (priv_check(td, PRIV_ROOT) == 0)
break;
if (newoff < off) /* invalid, check for safety */
break;
- if ((proto = nxt) == IPPROTO_ROUTING) {
- rthdr_exist = 1;
+ if ((proto = nxt) == IPPROTO_ROUTING)
break;
- }
off = newoff;
}
}
/* $FreeBSD: src/sys/netinet6/ipcomp_input.c,v 1.1.2.3 2002/04/28 05:40:27 suz Exp $ */
-/* $DragonFly: src/sys/netinet6/ipcomp_input.c,v 1.9 2007/11/22 20:19:43 hasso Exp $ */
/* $KAME: ipcomp_input.c,v 1.25 2001/03/01 09:12:09 itojun Exp $ */
/*
const struct ipcomp_algorithm *algo;
u_int16_t cpi; /* host order */
u_int16_t nxt;
- size_t hlen;
int error;
size_t newlen, olen;
struct secasvar *sav = NULL;
ipcomp = mtod(md, struct ipcomp *);
ip = mtod(m, struct ip *);
nxt = ipcomp->comp_nxt;
-#ifdef _IP_VHL
- hlen = IP_VHL_HL(ip->ip_vhl) << 2;
-#else
- hlen = ip->ip_hl << 2;
-#endif
cpi = ntohs(ipcomp->comp_cpi);
/* $FreeBSD: src/sys/netinet6/ipcomp_output.c,v 1.1.2.4 2003/04/29 08:33:50 suz Exp $ */
-/* $DragonFly: src/sys/netinet6/ipcomp_output.c,v 1.7 2004/06/02 14:43:01 eirikn Exp $ */
/* $KAME: ipcomp_output.c,v 1.25 2002/06/09 14:44:00 itojun Exp $ */
/*
#ifdef INET
struct ip *ip = NULL;
#endif
-#ifdef INET6
- struct ip6_hdr *ip6 = NULL;
-#endif
- size_t hlen = 0; /* ip header len */
size_t complen = sizeof(struct ipcomp);
switch (af) {
#ifdef INET
case AF_INET:
ip = mtod(m, struct ip *);
-#ifdef _IP_VHL
- hlen = IP_VHL_HL(ip->ip_vhl) << 2;
-#else
- hlen = ip->ip_hl << 2;
-#endif
break;
#endif
#ifdef INET6
case AF_INET6:
- ip6 = mtod(m, struct ip6_hdr *);
- hlen = sizeof(*ip6);
break;
#endif
}
struct nd_prefix *pr;
struct ifnet *ifp;
struct in6_ifaddr *ia6, *nia6;
- struct in6_addrlifetime *lt6;
mtx_lock(&nd6_mtx);
callout_reset(&nd6_timer_ch, nd6_prune * hz,
for (ia6 = in6_ifaddr; ia6; ia6 = nia6) {
nia6 = ia6->ia_next;
/* check address lifetime */
- lt6 = &ia6->ia6_lifetime;
if (IFA6_IS_INVALID(ia6)) {
int regen = 0;
nd6_dad_ns_input(struct ifaddr *ifa)
{
struct in6_ifaddr *ia;
- struct ifnet *ifp;
const struct in6_addr *taddr6;
struct dadq *dp;
int duplicate;
panic("ifa == NULL in nd6_dad_ns_input");
ia = (struct in6_ifaddr *)ifa;
- ifp = ifa->ifa_ifp;
taddr6 = &ia->ia_addr.sin6_addr;
duplicate = 0;
dp = nd6_dad_find(ifa);
struct ifnet *ifp = new->ndpr_ifp;
struct nd_prefix *pr;
int error = 0;
- int newprefix = 0;
int auth;
struct in6_addrlifetime lt6_tmp;
} else {
struct nd_prefix *newpr = NULL;
- newprefix = 1;
-
if (new->ndpr_vltime == 0)
goto end;
if (new->ndpr_raf_onlink == 0 && new->ndpr_raf_auto == 0)
int cmd = msg->ctlinput.nm_cmd;
struct sockaddr *sa = msg->ctlinput.nm_arg;
void *d = msg->ctlinput.nm_extra;
- struct ip6_hdr *ip6;
- struct mbuf *m;
- int off = 0;
struct ip6ctlparam *ip6cp = NULL;
const struct sockaddr_in6 *sa6_src = NULL;
void (*notify) (struct inpcb *, int) = in6_rtchange;
/* if the parameter is from icmp6, decode it. */
if (d != NULL) {
ip6cp = (struct ip6ctlparam *)d;
- m = ip6cp->ip6c_m;
- ip6 = ip6cp->ip6c_ip6;
- off = ip6cp->ip6c_off;
sa6_src = ip6cp->ip6c_src;
} else {
- m = NULL;
- ip6 = NULL;
sa6_src = &sa6_any;
}
struct mbuf *control = msg->send.nm_control;
struct sockaddr *addr = msg->send.nm_addr;
struct sctp_inpcb *inp;
- struct inpcb *in_inp;
struct in6pcb *inp6;
int flags = msg->send.nm_flags;
#ifdef INET
error = EINVAL;
goto out;
}
- in_inp = (struct inpcb *)inp;
inp6 = (struct in6pcb *)inp;
/* For the TCP model we may get a NULL addr, if we
* are a connected socket thats ok.