summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet/ip_ah_new.c8
-rw-r--r--sys/netinet6/icmp6.c8
-rw-r--r--sys/netinet6/in6_gif.c5
-rw-r--r--sys/netinet6/mld6.c5
-rw-r--r--sys/netinet6/nd6_nbr.c8
-rw-r--r--sys/netinet6/raw_ipv6.c7
6 files changed, 25 insertions, 16 deletions
diff --git a/sys/netinet/ip_ah_new.c b/sys/netinet/ip_ah_new.c
index 449d0eba5fe..09e8d71eadb 100644
--- a/sys/netinet/ip_ah_new.c
+++ b/sys/netinet/ip_ah_new.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_ah_new.c,v 1.34 1999/12/09 20:22:03 angelos Exp $ */
+/* $OpenBSD: ip_ah_new.c,v 1.35 1999/12/15 07:07:59 itojun Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
@@ -383,7 +383,8 @@ ah_new_input(struct mbuf *m, struct tdb *tdb, int skip, int protoff)
ip6.ip6_flow = 0;
ip6.ip6_hlim = 0;
- ip6.ip6_vfc = IPV6_VERSION; /* This resets some bitfields */
+ ip6.ip6_vfc &= ~IPV6_VERSION_MASK;
+ ip6.ip6_vfc |= IPV6_VERSION;
/* Include IPv6 header in authenticator computation */
ahx->Update(&ctx, (unsigned char *) &ip6, sizeof(ip6));
@@ -924,7 +925,8 @@ ah_new_output(struct mbuf *m, struct tdb *tdb, struct mbuf **mp, int skip,
ip6.ip6_flow = 0;
ip6.ip6_hlim = 0;
- ip6.ip6_vfc = IPV6_VERSION; /* This resets some bitfields */
+ ip6.ip6_vfc &= ~IPV6_VERSION_MASK;
+ ip6.ip6_vfc |= IPV6_VERSION;
/*
* Note that here we assume that on output, the IPv6 header
diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c
index 7bee3516f95..7e3c6b2a123 100644
--- a/sys/netinet6/icmp6.c
+++ b/sys/netinet6/icmp6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: icmp6.c,v 1.2 1999/12/10 10:04:27 angelos Exp $ */
+/* $OpenBSD: icmp6.c,v 1.3 1999/12/15 07:08:00 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -1261,7 +1261,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 */
@@ -1580,7 +1581,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;
diff --git a/sys/netinet6/in6_gif.c b/sys/netinet6/in6_gif.c
index 8a77519b032..5bce9ee0b80 100644
--- a/sys/netinet6/in6_gif.c
+++ b/sys/netinet6/in6_gif.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in6_gif.c,v 1.2 1999/12/10 10:04:27 angelos Exp $ */
+/* $OpenBSD: in6_gif.c,v 1.3 1999/12/15 07:08:00 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -136,7 +136,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;
diff --git a/sys/netinet6/mld6.c b/sys/netinet6/mld6.c
index d9066563b6e..cbeb979eaa9 100644
--- a/sys/netinet6/mld6.c
+++ b/sys/netinet6/mld6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mld6.c,v 1.2 1999/12/10 10:04:28 angelos Exp $ */
+/* $OpenBSD: mld6.c,v 1.3 1999/12/15 07:08:00 itojun Exp $ */
/*
* Copyright (C) 1998 WIDE Project.
@@ -395,7 +395,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 */
diff --git a/sys/netinet6/nd6_nbr.c b/sys/netinet6/nd6_nbr.c
index a6ae910d6cf..d525fb37702 100644
--- a/sys/netinet6/nd6_nbr.c
+++ b/sys/netinet6/nd6_nbr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nd6_nbr.c,v 1.4 1999/12/10 10:04:28 angelos Exp $ */
+/* $OpenBSD: nd6_nbr.c,v 1.5 1999/12/15 07:08:00 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -334,7 +334,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;
@@ -744,7 +745,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)) {
diff --git a/sys/netinet6/raw_ipv6.c b/sys/netinet6/raw_ipv6.c
index 732f5b698c4..fa3a45ba5bf 100644
--- a/sys/netinet6/raw_ipv6.c
+++ b/sys/netinet6/raw_ipv6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: raw_ipv6.c,v 1.8 1999/12/14 14:28:23 angelos Exp $ */
+/* $OpenBSD: raw_ipv6.c,v 1.9 1999/12/15 07:08:00 itojun Exp $ */
/*
%%% copyright-nrl-95
This software is Copyright 1995-1998 by Randall Atkinson, Ronald Lee,
@@ -43,7 +43,7 @@ didn't get a copy, you may request one from <license@ipv6.nrl.navy.mil>.
* SUCH DAMAGE.
*
* @(#)raw_ip.c 8.7 (Berkeley) 5/15/95
- * $Id: raw_ipv6.c,v 1.8 1999/12/14 14:28:23 angelos Exp $
+ * $Id: raw_ipv6.c,v 1.9 1999/12/15 07:08:00 itojun Exp $
*/
#include <sys/param.h>
@@ -389,7 +389,8 @@ int rip6_output(struct mbuf *m, ...)
M_PREPEND(m, sizeof(struct ip6_hdr), M_WAIT);
ip6 = mtod(m, struct ip6_hdr *);
ip6->ip6_flow = 0; /* Or possibly user flow label, in host order. */
- ip6->ip6_vfc = IPV6_VERSION;
+ ip6->ip6_vfc &= ~IPV6_VERSION_MASK;
+ ip6->ip6_vfc |= IPV6_VERSION;
ip6->ip6_nxt = inp->inp_ipv6.ip6_nxt;
bcopy(in6a, &ip6->ip6_src, sizeof(*in6a));
ip6->ip6_dst = dst->sin6_addr;