Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/netinet6/ip6_input.c,v rcsdiff: /ftp/cvs/cvsroot/src/sys/netinet6/ip6_input.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.82.2.3 retrieving revision 1.86 diff -u -p -r1.82.2.3 -r1.86 --- src/sys/netinet6/ip6_input.c 2006/09/09 02:58:55 1.82.2.3 +++ src/sys/netinet6/ip6_input.c 2006/05/07 16:02:40 1.86 @@ -1,4 +1,4 @@ -/* $NetBSD: ip6_input.c,v 1.82.2.3 2006/09/09 02:58:55 rpaulo Exp $ */ +/* $NetBSD: ip6_input.c,v 1.86 2006/05/07 16:02:40 rpaulo Exp $ */ /* $KAME: ip6_input.c,v 1.188 2001/03/29 05:34:31 itojun Exp $ */ /* @@ -62,7 +62,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ip6_input.c,v 1.82.2.3 2006/09/09 02:58:55 rpaulo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ip6_input.c,v 1.86 2006/05/07 16:02:40 rpaulo Exp $"); #include "opt_inet.h" #include "opt_inet6.h" @@ -95,7 +95,6 @@ __KERNEL_RCSID(0, "$NetBSD: ip6_input.c, #include #include -#include #ifdef INET #include #include @@ -103,6 +102,7 @@ __KERNEL_RCSID(0, "$NetBSD: ip6_input.c, #include #include #include +#include #include #include #include @@ -410,10 +410,6 @@ ip6_input(m) * dst are the loopback address and the receiving interface * is not loopback. */ - if (__predict_false( - m_makewritable(&m, 0, sizeof(struct ip6_hdr), M_DONTWAIT))) - goto bad; - ip6 = mtod(m, struct ip6_hdr *); if (in6_clearscope(&ip6->ip6_src) || in6_clearscope(&ip6->ip6_dst)) { ip6stat.ip6s_badscope++; /* XXX */ goto bad; @@ -1029,8 +1025,8 @@ ip6_unknown_opt(optp, m, off) * you are using IP6_EXTHDR_CHECK() not m_pulldown()) */ void -ip6_savecontrol(inp, mp, ip6, m) - struct inpcb *inp; +ip6_savecontrol(in6p, mp, ip6, m) + struct in6pcb *in6p; struct mbuf **mp; struct ip6_hdr *ip6; struct mbuf *m; @@ -1042,7 +1038,7 @@ ip6_savecontrol(inp, mp, ip6, m) #endif #ifdef SO_TIMESTAMP - if (inp->inp_socket->so_options & SO_TIMESTAMP) { + if (in6p->in6p_socket->so_options & SO_TIMESTAMP) { struct timeval tv; microtime(&tv); @@ -1052,13 +1048,8 @@ ip6_savecontrol(inp, mp, ip6, m) mp = &(*mp)->m_next; } #endif - - /* some OSes call this logic with IPv4 packet, for SO_TIMESTAMP */ - if ((ip6->ip6_vfc & IPV6_VERSION_MASK) != IPV6_VERSION) - return; - /* RFC 2292 sec. 5 */ - if ((inp->inp_flags & IN6P_PKTINFO) != 0) { + if ((in6p->in6p_flags & IN6P_PKTINFO) != 0) { struct in6_pktinfo pi6; bcopy(&ip6->ip6_dst, &pi6.ipi6_addr, sizeof(struct in6_addr)); @@ -1071,7 +1062,8 @@ ip6_savecontrol(inp, mp, ip6, m) if (*mp) mp = &(*mp)->m_next; } - if (inp->inp_flags & IN6P_HOPLIMIT) { + + if (in6p->in6p_flags & IN6P_HOPLIMIT) { int hlim = ip6->ip6_hlim & 0xff; *mp = sbcreatecontrol((caddr_t) &hlim, sizeof(int), @@ -1102,7 +1094,7 @@ ip6_savecontrol(inp, mp, ip6, m) * returned to normal user. * See also RFC3542 section 8 (or RFC2292 section 6). */ - if ((inp->inp_flags & IN6P_HOPOPTS) != 0) { + if ((in6p->in6p_flags & IN6P_HOPOPTS) != 0) { /* * Check if a hop-by-hop options header is contatined in the * received packet, and if so, store the options as ancillary @@ -1146,7 +1138,7 @@ ip6_savecontrol(inp, mp, ip6, m) } /* IPV6_DSTOPTS and IPV6_RTHDR socket options */ - if (inp->inp_flags & (IN6P_DSTOPTS | IN6P_RTHDR)) { + if (in6p->in6p_flags & (IN6P_DSTOPTS | IN6P_RTHDR)) { struct ip6_hdr *xip6 = mtod(m, struct ip6_hdr *); int nxt = xip6->ip6_nxt, off = sizeof(struct ip6_hdr); @@ -1195,7 +1187,7 @@ ip6_savecontrol(inp, mp, ip6, m) switch (nxt) { case IPPROTO_DSTOPTS: - if (!inp->inp_flags & IN6P_DSTOPTS) + if (!in6p->in6p_flags & IN6P_DSTOPTS) break; *mp = sbcreatecontrol((caddr_t)ip6e, elen, @@ -1206,7 +1198,7 @@ ip6_savecontrol(inp, mp, ip6, m) break; case IPPROTO_ROUTING: - if (!inp->inp_flags & IN6P_RTHDR) + if (!in6p->in6p_flags & IN6P_RTHDR) break; *mp = sbcreatecontrol((caddr_t)ip6e, elen,