do not overwrite traffic class field when we write IPv6 version field.

This commit is contained in:
itojun 1999-12-15 06:28:43 +00:00
parent 0d7c5dfc5a
commit abddb5f851
9 changed files with 31 additions and 20 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: tcp_input.c,v 1.99 1999/12/13 15:17:20 itojun Exp $ */
/* $NetBSD: tcp_input.c,v 1.100 1999/12/15 06:28:43 itojun Exp $ */
/*
%%% portions-copyright-nrl-95
@ -3428,7 +3428,8 @@ syn_cache_respond(sc, m)
break;
#ifdef INET6
case AF_INET6:
ip6->ip6_vfc = IPV6_VERSION;
ip6->ip6_vfc &= ~IPV6_VERSION_MASK;
ip6->ip6_vfc |= IPV6_VERSION;
ip6->ip6_plen = htons(tlen - hlen);
/* ip6_hlim will be initialized afterwards */
/* XXX flowlabel? */

View File

@ -1,4 +1,4 @@
/* $NetBSD: tcp_subr.c,v 1.84 1999/12/13 15:17:20 itojun Exp $ */
/* $NetBSD: tcp_subr.c,v 1.85 1999/12/15 06:28:43 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@ -311,7 +311,8 @@ tcp_template(tp)
ip6->ip6_flow |=
(htonl(ip6_flow_seq++) & IPV6_FLOWLABEL_MASK);
}
ip6->ip6_vfc = IPV6_VERSION;
ip6->ip6_vfc &= ~IPV6_VERSION_MASK;
ip6->ip6_vfc |= IPV6_VERSION;
break;
}
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: ah_core.c,v 1.11 1999/09/17 12:26:04 itojun Exp $ */
/* $NetBSD: ah_core.c,v 1.12 1999/12/15 06:28:44 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@ -1105,7 +1105,8 @@ again:
bcopy(p, &ip6copy, sizeof(struct ip6_hdr));
/* RFC2402 */
ip6copy.ip6_flow = 0;
ip6copy.ip6_vfc = IPV6_VERSION;
ip6copy.ip6_vfc &= ~IPV6_VERSION_MASK;
ip6copy.ip6_vfc |= IPV6_VERSION;
ip6copy.ip6_hlim = 0;
if (IN6_IS_ADDR_LINKLOCAL(&ip6copy.ip6_src))
ip6copy.ip6_src.s6_addr16[1] = 0x0000;

View File

@ -1,4 +1,4 @@
/* $NetBSD: icmp6.c,v 1.12 1999/12/13 15:17:21 itojun Exp $ */
/* $NetBSD: icmp6.c,v 1.13 1999/12/15 06:28:44 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@ -1458,7 +1458,8 @@ icmp6_reflect(m, off)
ip6->ip6_src = *src;
ip6->ip6_flow = 0;
ip6->ip6_vfc = IPV6_VERSION;
ip6->ip6_vfc &= ~IPV6_VERSION_MASK;
ip6->ip6_vfc |= IPV6_VERSION;
ip6->ip6_nxt = IPPROTO_ICMPV6;
if (m->m_pkthdr.rcvif) {
/* XXX: This may not be the outgoing interface */
@ -1793,7 +1794,8 @@ icmp6_redirect_output(m0, rt)
/* ip6 */
ip6 = mtod(m, struct ip6_hdr *);
ip6->ip6_flow = 0;
ip6->ip6_vfc = IPV6_VERSION;
ip6->ip6_vfc &= ~IPV6_VERSION_MASK;
ip6->ip6_vfc |= IPV6_VERSION;
/* ip6->ip6_plen will be set later */
ip6->ip6_nxt = IPPROTO_ICMPV6;
ip6->ip6_hlim = 255;

View File

@ -1,4 +1,4 @@
/* $NetBSD: in6_gif.c,v 1.8 1999/12/13 15:17:22 itojun Exp $ */
/* $NetBSD: in6_gif.c,v 1.9 1999/12/15 06:28:44 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@ -145,7 +145,8 @@ in6_gif_output(ifp, family, m, rt)
ip6 = mtod(m, struct ip6_hdr *);
ip6->ip6_flow = 0;
ip6->ip6_vfc = IPV6_VERSION;
ip6->ip6_vfc &= ~IPV6_VERSION_MASK;
ip6->ip6_vfc |= IPV6_VERSION;
ip6->ip6_plen = htons((u_short)m->m_pkthdr.len);
ip6->ip6_nxt = proto;
ip6->ip6_hlim = ip6_gif_hlim;

View File

@ -1,4 +1,4 @@
/* $NetBSD: mld6.c,v 1.7 1999/12/13 15:17:23 itojun Exp $ */
/* $NetBSD: mld6.c,v 1.8 1999/12/15 06:28:44 itojun Exp $ */
/*
* Copyright (C) 1998 WIDE Project.
@ -432,7 +432,8 @@ mld6_sendpkt(in6m, type, dst)
/* fill in the ip6 header */
ip6 = mtod(mh, struct ip6_hdr *);
ip6->ip6_flow = 0;
ip6->ip6_vfc = IPV6_VERSION;
ip6->ip6_vfc &= ~IPV6_VERSION_MASK;
ip6->ip6_vfc |= IPV6_VERSION;
/* ip6_plen will be set later */
ip6->ip6_nxt = IPPROTO_ICMPV6;
/* ip6_hlim will be set by im6o.im6o_multicast_hlim */

View File

@ -1,4 +1,4 @@
/* $NetBSD: nd6_nbr.c,v 1.9 1999/12/13 15:17:23 itojun Exp $ */
/* $NetBSD: nd6_nbr.c,v 1.10 1999/12/15 06:28:44 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@ -347,7 +347,8 @@ nd6_ns_output(ifp, daddr6, taddr6, ln, dad)
/* fill neighbor solicitation packet */
ip6 = mtod(m, struct ip6_hdr *);
ip6->ip6_flow = 0;
ip6->ip6_vfc = IPV6_VERSION;
ip6->ip6_vfc &= ~IPV6_VERSION_MASK;
ip6->ip6_vfc |= IPV6_VERSION;
/* ip6->ip6_plen will be set later */
ip6->ip6_nxt = IPPROTO_ICMPV6;
ip6->ip6_hlim = 255;
@ -772,7 +773,8 @@ nd6_na_output(ifp, daddr6, taddr6, flags, tlladdr)
/* fill neighbor advertisement packet */
ip6 = mtod(m, struct ip6_hdr *);
ip6->ip6_flow = 0;
ip6->ip6_vfc = IPV6_VERSION;
ip6->ip6_vfc &= ~IPV6_VERSION_MASK;
ip6->ip6_vfc |= IPV6_VERSION;
ip6->ip6_nxt = IPPROTO_ICMPV6;
ip6->ip6_hlim = 255;
if (IN6_IS_ADDR_UNSPECIFIED(daddr6)) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: raw_ip6.c,v 1.12 1999/12/13 15:17:24 itojun Exp $ */
/* $NetBSD: raw_ip6.c,v 1.13 1999/12/15 06:28:44 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@ -351,7 +351,8 @@ rip6_output(m, va_alist)
}
ip6->ip6_flow = in6p->in6p_flowinfo & IPV6_FLOWINFO_MASK;
ip6->ip6_vfc = IPV6_VERSION;
ip6->ip6_vfc &= ~IPV6_VERSION_MASK;
ip6->ip6_vfc |= IPV6_VERSION;
#if 0 /* ip6_plen will be filled in ip6_output. */
ip6->ip6_plen = htons((u_short)plen);
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: udp6_usrreq.c,v 1.14 1999/12/13 15:17:24 itojun Exp $ */
/* $NetBSD: udp6_usrreq.c,v 1.15 1999/12/15 06:28:45 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@ -694,7 +694,8 @@ udp6_output(in6p, m, addr6, control)
case AF_INET6:
ip6 = mtod(m, struct ip6_hdr *);
ip6->ip6_flow = in6p->in6p_flowinfo & IPV6_FLOWINFO_MASK;
ip6->ip6_vfc = IPV6_VERSION;
ip6->ip6_vfc &= ~IPV6_VERSION_MASK;
ip6->ip6_vfc |= IPV6_VERSION;
#if 0 /* ip6_plen will be filled in ip6_output. */
ip6->ip6_plen = htons((u_short)plen);
#endif