summaryrefslogtreecommitdiffstats
path: root/sys/netipx/ipx_usrreq.c
diff options
context:
space:
mode:
authorjhay <jhay@FreeBSD.org>1999-08-28 18:21:55 +0000
committerjhay <jhay@FreeBSD.org>1999-08-28 18:21:55 +0000
commitc4958328e037b668484eec86b3cdc4e41ba94e6d (patch)
treeaa08967c601106f45ce5a821832f1130dfae13d2 /sys/netipx/ipx_usrreq.c
parentf98ac3b4e9396a677f79ad70985cb246cb229470 (diff)
downloadFreeBSD-src-c4958328e037b668484eec86b3cdc4e41ba94e6d.zip
FreeBSD-src-c4958328e037b668484eec86b3cdc4e41ba94e6d.tar.gz
Get rid of the old XNS checksum code and implement it the IPX way.
PR: 13374 Submitted by: Boris Popov <bp@butya.kz>
Diffstat (limited to 'sys/netipx/ipx_usrreq.c')
-rw-r--r--sys/netipx/ipx_usrreq.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/sys/netipx/ipx_usrreq.c b/sys/netipx/ipx_usrreq.c
index 2e20f0f..b18b1fb 100644
--- a/sys/netipx/ipx_usrreq.c
+++ b/sys/netipx/ipx_usrreq.c
@@ -214,7 +214,7 @@ ipx_output(ipxp, m0)
m = mprev;
if ((m->m_flags & M_EXT) == 0 &&
(m->m_len + m->m_data < &m->m_dat[MLEN])) {
- m->m_len++;
+ mtod(m, char*)[m->m_len++] = 0;
} else {
struct mbuf *m1 = m_get(M_DONTWAIT, MT_DATA);
@@ -250,9 +250,7 @@ ipx_output(ipxp, m0)
ipx->ipx_len = htons((u_short)len);
- if (ipxcksum) {
- ipx->ipx_sum = 0;
- len = ((len - 1) | 1) + 1;
+ if (ipxp->ipxp_flags & IPXP_CHECKSUM) {
ipx->ipx_sum = ipx_cksum(m, len);
} else
ipx->ipx_sum = 0xffff;
@@ -333,6 +331,10 @@ ipx_ctloutput(so, sopt)
case SO_HEADERS_ON_INPUT:
mask = IPXP_RAWIN;
goto get_flags;
+
+ case SO_IPX_CHECKSUM:
+ mask = IPXP_CHECKSUM;
+ goto get_flags;
case SO_HEADERS_ON_OUTPUT:
mask = IPXP_RAWOUT;
@@ -372,6 +374,9 @@ ipx_ctloutput(so, sopt)
mask = IPXP_RAWIN;
goto set_head;
+ case SO_IPX_CHECKSUM:
+ mask = IPXP_CHECKSUM;
+
case SO_HEADERS_ON_OUTPUT:
mask = IPXP_RAWOUT;
set_head:
OpenPOWER on IntegriCloud