summaryrefslogtreecommitdiffstats
path: root/cpukit/libnetworking/netinet/ip_output.c
diff options
context:
space:
mode:
authorRalf Corsepius <ralf.corsepius@rtems.org>2007-03-29 07:50:03 +0000
committerRalf Corsepius <ralf.corsepius@rtems.org>2007-03-29 07:50:03 +0000
commitf94e799ee9f78fee0dd559fea6fd3b1717fb6956 (patch)
tree6837d08408650c7ec07ea2e65d912bc8207f4078 /cpukit/libnetworking/netinet/ip_output.c
parent2007-03-29 Ralf Corsépius <ralf.corsepius@rtems.org> (diff)
downloadrtems-f94e799ee9f78fee0dd559fea6fd3b1717fb6956.tar.bz2
Preps to eliminate _IP_VHL (Abandoned in FreeBSD). Misc mergers from upstream FreeBSD.
Diffstat (limited to 'cpukit/libnetworking/netinet/ip_output.c')
-rw-r--r--cpukit/libnetworking/netinet/ip_output.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/cpukit/libnetworking/netinet/ip_output.c b/cpukit/libnetworking/netinet/ip_output.c
index 158cc85915..6621ec5e67 100644
--- a/cpukit/libnetworking/netinet/ip_output.c
+++ b/cpukit/libnetworking/netinet/ip_output.c
@@ -118,7 +118,12 @@ ip_output(m0, opt, ro, flags, imo)
* Fill in IP header.
*/
if ((flags & (IP_FORWARDING|IP_RAWOUTPUT)) == 0) {
+#ifdef _IP_VHL
ip->ip_vhl = IP_MAKE_VHL(IPVERSION, hlen >> 2);
+#else
+ ip->ip_v = IPVERSION;
+ ip->ip_hl = hlen >> 2;
+#endif
ip->ip_off &= IP_DF;
ip->ip_id = htons(ip_id++);
ipstat.ips_localout++;
@@ -318,7 +323,7 @@ ip_output(m0, opt, ro, flags, imo)
goto bad;
}
/* don't allow broadcast messages to be fragmented */
- if ((u_short)ip->ip_len > ifp->if_mtu) {
+ if (ip->ip_len > ifp->if_mtu) {
error = EMSGSIZE;
goto bad;
}
@@ -1280,11 +1285,15 @@ ip_mloopback(ifp, m, dst, hlen)
ip->ip_len = htons(ip->ip_len);
ip->ip_off = htons(ip->ip_off);
ip->ip_sum = 0;
+#ifdef _IP_VHL
if (ip->ip_vhl == IP_VHL_BORING) {
ip->ip_sum = in_cksum_hdr(ip);
} else {
ip->ip_sum = in_cksum(copym, hlen);
}
+#else
+ ip->ip_sum = in_cksum(copym, hlen);
+#endif
/*
* NB:
* It's not clear whether there are any lingering
@@ -1298,7 +1307,7 @@ ip_mloopback(ifp, m, dst, hlen)
*/
#ifdef notdef
copym->m_pkthdr.rcvif = ifp;
- ip_input(copym)
+ ip_input(copym);
#else
(void) looutput(ifp, copym, (struct sockaddr *)dst, NULL);
#endif