summaryrefslogtreecommitdiffstats
path: root/usr.sbin/IPXrouted/output.c
diff options
context:
space:
mode:
authorjhay <jhay@FreeBSD.org>1997-07-06 07:38:36 +0000
committerjhay <jhay@FreeBSD.org>1997-07-06 07:38:36 +0000
commit18fa8ff2b470b736a50fb803e1e891bc2f4d247b (patch)
tree99ed7bad5d7b247fd7423644806e43dc4dc3a8dc /usr.sbin/IPXrouted/output.c
parent60f787e21f64c5425b302b242c9a638f55ebb6ad (diff)
downloadFreeBSD-src-18fa8ff2b470b736a50fb803e1e891bc2f4d247b.zip
FreeBSD-src-18fa8ff2b470b736a50fb803e1e891bc2f4d247b.tar.gz
Major IPXrouted rework.
In rt_change() remember to update the interface pointer otherwise we will send the RIP packets to the wrong interface(s) in future. Update the hash generator and increase the size of the hash tables. Only use the network and host parts when comparing IPX interface addresses. Immediately broadscast RIP and SAP changes. Change the alarm code to use the setitimer() call and only set a flag in the alarm signal handler. This gets rid of possible race conditions. Remove the host routing table. IPX RIP cannot do host routes, only net routes. Make the delay between broadcast packets 50ms. It seems that some Netware 4.x servers is very slow and don't have much input buffering. Handle received messages about networks and services that go down, better. Add tracing of RIP and SAP changes. It gets sysloged with a level of LOG_DEBUG.
Diffstat (limited to 'usr.sbin/IPXrouted/output.c')
-rw-r--r--usr.sbin/IPXrouted/output.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/usr.sbin/IPXrouted/output.c b/usr.sbin/IPXrouted/output.c
index 06b9a16..f824ecd 100644
--- a/usr.sbin/IPXrouted/output.c
+++ b/usr.sbin/IPXrouted/output.c
@@ -35,7 +35,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id$
+ * $Id: output.c,v 1.6 1997/02/22 16:00:58 peter Exp $
*/
#ifndef lint
@@ -55,9 +55,10 @@ static char sccsid[] = "@(#)output.c 8.1 (Berkeley) 6/5/93";
* the output to the known router.
*/
void
-toall(f, except)
- void (*f)(struct sockaddr *, int, struct interface *);
+toall(f, except, changesonly)
+ void (*f)(struct sockaddr *, int, struct interface *, int);
struct rt_entry *except;
+ int changesonly;
{
register struct interface *ifp;
register struct sockaddr *dst;
@@ -89,7 +90,7 @@ toall(f, except)
ifp->int_flags & IFF_POINTOPOINT ? &ifp->int_dstaddr :
&ifp->int_addr;
flags = ifp->int_flags & IFF_INTERFACE ? MSG_DONTROUTE : 0;
- (*f)(dst, flags, ifp);
+ (*f)(dst, flags, ifp, changesonly);
}
}
@@ -97,10 +98,11 @@ toall(f, except)
* Output a preformed packet.
*/
void
-sndmsg(dst, flags, ifp)
+sndmsg(dst, flags, ifp, changesonly)
struct sockaddr *dst;
int flags;
struct interface *ifp;
+ int changesonly;
{
(*afswitch[dst->sa_family].af_output)
@@ -120,20 +122,20 @@ sndmsg(dst, flags, ifp)
* clones.
*/
void
-supply(dst, flags, ifp)
+supply(dst, flags, ifp, changesonly)
struct sockaddr *dst;
int flags;
struct interface *ifp;
+ int changesonly;
{
register struct rt_entry *rt;
register struct rt_entry *crt; /* Clone route */
register struct rthash *rh;
register struct netinfo *nn;
register struct netinfo *n = msg->rip_nets;
- struct rthash *base = hosthash;
struct sockaddr_ipx *sipx = (struct sockaddr_ipx *) dst;
af_output_t *output = afswitch[dst->sa_family].af_output;
- int doinghost = 1, size, metric, ticks;
+ int size, metric, ticks;
union ipx_net net;
int delay = 0;
@@ -141,8 +143,7 @@ supply(dst, flags, ifp)
sipx->sipx_port = htons(IPXPORT_RIP);
msg->rip_cmd = ntohs(RIPCMD_RESPONSE);
-again:
- for (rh = base; rh < &base[ROUTEHASHSIZ]; rh++)
+ for (rh = nethash; rh < &nethash[ROUTEHASHSIZ]; rh++)
for (rt = rh->rt_forw; rt != (struct rt_entry *)rh; rt = rt->rt_forw) {
size = (char *)n - (char *)msg;
if (size >= ((MAXRIPNETS * sizeof (struct netinfo)) +
@@ -152,11 +153,14 @@ again:
n = msg->rip_nets;
delay++;
if(delay == 2) {
- usleep(20000);
+ usleep(50000);
delay = 0;
}
}
+ if (changesonly && !(rt->rt_state & RTS_CHANGED))
+ continue;
+
/*
* This should do rule one and two of the split horizon
* algorithm.
@@ -219,11 +223,6 @@ again:
n++;
next:;
}
- if (doinghost) {
- doinghost = 0;
- base = nethash;
- goto again;
- }
if (n != msg->rip_nets) {
size = (char *)n - (char *)msg;
(*output)(ripsock, flags, dst, size);
OpenPOWER on IntegriCloud