aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet
diff options
context:
space:
mode:
authorRuslan Ermilov <ru@FreeBSD.org>2000-09-14 14:42:04 +0000
committerRuslan Ermilov <ru@FreeBSD.org>2000-09-14 14:42:04 +0000
commite30177e024f908601b4242d6de6450986af95044 (patch)
treebc9d57f1462b60cf05e0a04e626f7d3f36891602 /sys/netinet
parent5dde620ab13ac7d9b3fb8c494a1a9d45b62cf3ac (diff)
Notes
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/ip_auth.c2
-rw-r--r--sys/netinet/ip_divert.c1
-rw-r--r--sys/netinet/ip_fil.c2
-rw-r--r--sys/netinet/ip_icmp.c1
-rw-r--r--sys/netinet/ip_input.c4
-rw-r--r--sys/netinet/ip_mroute.c3
-rw-r--r--sys/netinet/ip_output.c10
-rw-r--r--sys/netinet/raw_ip.c2
8 files changed, 6 insertions, 19 deletions
diff --git a/sys/netinet/ip_auth.c b/sys/netinet/ip_auth.c
index ff728253ea48..4ce6a69d5d77 100644
--- a/sys/netinet/ip_auth.c
+++ b/sys/netinet/ip_auth.c
@@ -250,7 +250,7 @@ ip_t *ip;
bo = ip->ip_len;
ip->ip_len = htons(bo);
-# if !SOLARIS && !defined(__NetBSD__)
+# if !SOLARIS && !defined(__NetBSD__) && !defined(__FreeBSD__)
/* 4.4BSD converts this ip_input.c, but I don't in solaris.c */
bo = ip->ip_id;
ip->ip_id = htons(bo);
diff --git a/sys/netinet/ip_divert.c b/sys/netinet/ip_divert.c
index 12acdfd7761e..b2f92b823cdf 100644
--- a/sys/netinet/ip_divert.c
+++ b/sys/netinet/ip_divert.c
@@ -293,7 +293,6 @@ div_output(so, m, addr, control)
/* Convert fields to host order for ip_output() */
NTOHS(ip->ip_len);
- NTOHS(ip->ip_id);
NTOHS(ip->ip_off);
/* Send packet to output processing */
diff --git a/sys/netinet/ip_fil.c b/sys/netinet/ip_fil.c
index bd76b39be349..d609f25f1f4a 100644
--- a/sys/netinet/ip_fil.c
+++ b/sys/netinet/ip_fil.c
@@ -1369,7 +1369,9 @@ frdest_t *fdp;
i = 1;
# endif
# ifndef sparc
+# ifndef __FreeBSD__
ip->ip_id = htons(ip->ip_id);
+# endif
ip->ip_len = htons(ip->ip_len);
ip->ip_off = htons(ip->ip_off);
# endif
diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c
index 91c0bc085db0..dc2040ea6ba1 100644
--- a/sys/netinet/ip_icmp.c
+++ b/sys/netinet/ip_icmp.c
@@ -196,7 +196,6 @@ icmp_error(n, type, code, dest, destifp)
* Convert fields to network representation.
*/
HTONS(nip->ip_len);
- HTONS(nip->ip_id);
HTONS(nip->ip_off);
/*
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c
index 5ba57505199c..bd04b01b4709 100644
--- a/sys/netinet/ip_input.c
+++ b/sys/netinet/ip_input.c
@@ -346,7 +346,6 @@ ip_input(struct mbuf *m)
ipstat.ips_badlen++;
goto bad;
}
- NTOHS(ip->ip_id);
NTOHS(ip->ip_off);
/*
@@ -692,10 +691,8 @@ found:
ip->ip_len += hlen;
HTONS(ip->ip_len);
HTONS(ip->ip_off);
- HTONS(ip->ip_id);
ip->ip_sum = 0;
ip->ip_sum = in_cksum_hdr(ip);
- NTOHS(ip->ip_id);
NTOHS(ip->ip_off);
NTOHS(ip->ip_len);
ip->ip_len -= hlen;
@@ -725,7 +722,6 @@ found:
ip->ip_len += hlen;
HTONS(ip->ip_len);
HTONS(ip->ip_off);
- HTONS(ip->ip_id);
/* Deliver packet to divert input routine */
ip_divert_cookie = divert_cookie;
diff --git a/sys/netinet/ip_mroute.c b/sys/netinet/ip_mroute.c
index 73ab0393a440..1d165f5e7983 100644
--- a/sys/netinet/ip_mroute.c
+++ b/sys/netinet/ip_mroute.c
@@ -1581,7 +1581,7 @@ encap_send(ip, vifp, m)
*/
ip_copy = mtod(mb_copy, struct ip *);
*ip_copy = multicast_encap_iphdr;
- ip_copy->ip_id = ip_id++;
+ ip_copy->ip_id = htons(ip_id++);
ip_copy->ip_len += len;
ip_copy->ip_src = vifp->v_lcl_addr;
ip_copy->ip_dst = vifp->v_rmt_addr;
@@ -1592,7 +1592,6 @@ encap_send(ip, vifp, m)
ip = (struct ip *)((caddr_t)ip_copy + sizeof(multicast_encap_iphdr));
--ip->ip_ttl;
HTONS(ip->ip_len);
- HTONS(ip->ip_id);
HTONS(ip->ip_off);
ip->ip_sum = 0;
mb_copy->m_data += sizeof(multicast_encap_iphdr);
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c
index 9fe700106add..baaf33239f61 100644
--- a/sys/netinet/ip_output.c
+++ b/sys/netinet/ip_output.c
@@ -211,7 +211,7 @@ ip_output(m0, opt, ro, flags, imo)
if ((flags & (IP_FORWARDING|IP_RAWOUTPUT)) == 0) {
ip->ip_vhl = IP_MAKE_VHL(IPVERSION, hlen >> 2);
ip->ip_off &= IP_DF;
- ip->ip_id = ip_id++;
+ ip->ip_id = htons(ip_id++);
ipstat.ips_localout++;
} else {
hlen = IP_VHL_HL(ip->ip_vhl) << 2;
@@ -520,7 +520,6 @@ sendit:
/* Restore packet header fields to original values */
HTONS(ip->ip_len);
- HTONS(ip->ip_id);
HTONS(ip->ip_off);
/* Deliver packet to divert input routine */
@@ -595,7 +594,6 @@ sendit:
m->m_pkthdr.csum_flags |=
CSUM_IP_CHECKED | CSUM_IP_VALID;
HTONS(ip->ip_len);
- HTONS(ip->ip_id);
HTONS(ip->ip_off);
ip_input(m);
goto done;
@@ -715,7 +713,6 @@ pass:
}
HTONS(ip->ip_len);
- HTONS(ip->ip_id);
HTONS(ip->ip_off);
error = ipsec4_output(&state, sp, flags);
@@ -776,7 +773,6 @@ pass:
/* make it flipped, again. */
NTOHS(ip->ip_len);
- NTOHS(ip->ip_id);
NTOHS(ip->ip_off);
skip_ipsec:
#endif /*IPSEC*/
@@ -796,7 +792,6 @@ skip_ipsec:
if ((u_short)ip->ip_len <= ifp->if_mtu ||
ifp->if_hwassist & CSUM_FRAGMENT) {
HTONS(ip->ip_len);
- HTONS(ip->ip_id);
HTONS(ip->ip_off);
ip->ip_sum = 0;
if (sw_csum & CSUM_DELAY_IP) {
@@ -892,7 +887,6 @@ skip_ipsec:
m->m_pkthdr.len = mhlen + len;
m->m_pkthdr.rcvif = (struct ifnet *)0;
m->m_pkthdr.csum_flags = m0->m_pkthdr.csum_flags;
- HTONS(mhip->ip_id);
HTONS(mhip->ip_off);
mhip->ip_sum = 0;
if (sw_csum & CSUM_DELAY_IP) {
@@ -921,7 +915,6 @@ skip_ipsec:
m_adj(m, hlen + firstlen - (u_short)ip->ip_len);
m->m_pkthdr.len = hlen + firstlen;
ip->ip_len = htons((u_short)m->m_pkthdr.len);
- HTONS(ip->ip_id);
ip->ip_off |= IP_MF;
HTONS(ip->ip_off);
ip->ip_sum = 0;
@@ -1864,7 +1857,6 @@ ip_mloopback(ifp, m, dst, hlen)
*/
ip = mtod(copym, struct ip *);
HTONS(ip->ip_len);
- HTONS(ip->ip_id);
HTONS(ip->ip_off);
ip->ip_sum = 0;
if (ip->ip_vhl == IP_VHL_BORING) {
diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c
index 94046e8a65b3..5d056cefadf6 100644
--- a/sys/netinet/raw_ip.c
+++ b/sys/netinet/raw_ip.c
@@ -221,7 +221,7 @@ rip_output(m, so, dst)
return EINVAL;
}
if (ip->ip_id == 0)
- ip->ip_id = ip_id++;
+ ip->ip_id = htons(ip_id++);
/* XXX prevent ip_output from overwriting header fields */
flags |= IP_RAWOUTPUT;
ipstat.ips_rawout++;