Date: Wed, 20 Jan 1999 19:17:18 +0600 (ALMT) From: Boris Popov <bp@butya.kz> To: freebsd-net@FreeBSD.ORG Subject: Two bugs and suggestion for IPX stack Message-ID: <Pine.BSF.4.02.9901201855280.29453-300000@lion.butya.kz>
next in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
Hello,
for about a two months ago I make few changes in IPX stack related
to broadcast bug, internal net support and little bug in SPX
implementation. As they work stable I suggest them to discuss and commit
in to source tree. Here is a short explanation:
Broadcasts: local host never get broadcast packet originated by
itself. Novell implementation do that, and this simplify programming.
Internal net: it is possible to implement internal net conception
like used in Netware servers by configure loopback interface as follows:
ifconfig lo0 ipx 0x5a5a.1
After that, server programs like mars_nwe , can use only
network 0x5a5a and host 1. Of course this requires small changes to ipx
stack and IPXrouted.
SPX bug are just invalid order of operators :)
All patches are simple and attached at the end of letter.
BTW, I mostly finish work on Netware client (typical throughput
about 730Kb/s on 10Mbit network). Higher rates is possible with packet
burst mode, so does any body know the details ?
--
Boris Popov
[-- Attachment #2 --]
diff -rub ./sap_tables.c new/sap_tables.c
--- ./sap_tables.c Mon Feb 16 19:54:32 1998
+++ new/sap_tables.c Sat Dec 5 21:05:26 1998
@@ -134,6 +134,7 @@
for(sap = sh->forw; sap != (sap_entry *)sh; sap = sap->forw) {
if (ServType != sap->sap.ServType)
continue;
+#if 0
if (ifp == sap->ifp)
continue;
@@ -147,6 +148,7 @@
goto next;
csap = csap->clone;
}
+#endif
if (ntohs(sap->sap.hops) < besthops) {
best = sap;
diff -rub ./startup.c new/startup.c
--- ./startup.c Sat Feb 22 22:01:01 1997
+++ new/startup.c Wed Jan 20 18:44:31 1999
@@ -183,6 +183,9 @@
}
ifs.int_dstaddr = *brdaddr;
}
+ if (ifs.int_flags & IFF_LOOPBACK) {
+ ifs.int_dstaddr = ifs.int_addr;
+ }
/*
* already known to us?
* what makes a POINTOPOINT if unique is its dst addr,
@@ -192,9 +195,6 @@
if_ifwithdstaddr(&ifs.int_dstaddr)) ||
( ((ifs.int_flags & IFF_POINTOPOINT) == 0) &&
if_ifwithaddr(&ifs.int_addr)))
- continue;
- /* no one cares about software loopback interfaces */
- if (ifs.int_flags & IFF_LOOPBACK)
continue;
ifp = (struct interface *)
malloc(sdl->sdl_nlen + 1 + sizeof(ifs));
[-- Attachment #3 --]
diff -rub ./ipx_outputfl.c new/ipx_outputfl.c
--- ./ipx_outputfl.c Mon Feb 16 19:34:30 1998
+++ new/ipx_outputfl.c Wed Jan 20 15:38:57 1999
@@ -118,7 +118,7 @@
* such a packet.
*/
if (dst->sipx_addr.x_host.c_host[0]&1) {
- if ((ifp->if_flags & IFF_BROADCAST) == 0) {
+ if ((ifp->if_flags & (IFF_BROADCAST | IFF_LOOPBACK)) == 0) {
error = EADDRNOTAVAIL;
goto bad;
}
@@ -126,6 +126,7 @@
error = EACCES;
goto bad;
}
+ m0->m_flags |= M_BCAST;
}
if (htons(ipx->ipx_len) <= ifp->if_mtu) {
diff -rub ./spx_usrreq.c new/spx_usrreq.c
--- ./spx_usrreq.c Wed Jan 13 14:41:00 1999
+++ new/spx_usrreq.c Wed Jan 20 18:51:05 1999
@@ -1335,13 +1335,13 @@
ipxp = sotoipxpcb(so);
MALLOC(cb, struct spxpcb *, sizeof *cb, M_PCB, M_NOWAIT);
- bzero(cb, sizeof *cb);
- sb = &so->so_snd;
if (cb == NULL) {
error = ENOBUFS;
goto spx_attach_end;
}
+ bzero(cb, sizeof *cb);
+ sb = &so->so_snd;
mm = m_getclr(M_DONTWAIT, MT_HEADER);
if (mm == NULL) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.02.9901201855280.29453-300000>
