Article View: comp.sys.ibm.pc.misc
Article #12217Re: Using two Ethernet cards under SCO Unix ?
From: Steve Alexander
Date: Thu, 09 Jan 1992 15:49
Date: Thu, 09 Jan 1992 15:49
118 lines
4122 bytes
4122 bytes
In article <bhqpxa.ane@wang.com> fitz@wang.com (Tom Fitzgerald) writes:
>SCO works ok as a router, though it isn't a very fast one. In fact, I
>don't know of any way to turn off routing in the kernel (though you can
>disable the routing daemon). Even if the machine only has a single
>interface, if it gets a mis-addressed packet, SCO will attempt to route it.
In the next SCO TCP/IP release this will be controlled by kernel tunable
parameters. In the meantime the following program can be used to turn routing
off.
At TCP startup time, as root, run
kpatch ipforwarding 0
kpatch ipsendredirects 0
This will disable forwarding of datagrams on systems that you don't want
to act as routers.
-- Steve
#--------------------------------CUT HERE-------------------------------------
#! /bin/sh
#
# This is a shell archive. Save this into a file, edit it
# and delete all lines above this comment. Then give this
# file to sh by executing the command "sh file". The files
# will be extracted into the current directory owned by
# you with default permissions.
#
# The files contained herein are:
#
# -rw-r--r-- 1 stevea 1297 Jan 9 09:46 kpatch.c
#
echo 'x - kpatch.c'
if test -f kpatch.c; then echo 'shar: not overwriting kpatch.c'; else
sed 's/^X//' << '________This_Is_The_END________' > kpatch.c
X/*
X * Kpatch -- poke values in the kernel address space
X * Only works for 32-bit values
X */
X#include <sys/types.h>
X#include <sys/fcntl.h>
X#include <sys/unistd.h>
X#include <stdio.h>
X#include <nlist.h>
X#include <errno.h>
X
Xmain(argc, argv)
X int argc;
X char **argv;
X{
X struct nlist nl[2];
X
X int r;
X unsigned val;
X unsigned oval;
X int k;
X
X if (argc < 3) {
X fprintf(stderr, "usage: kpatch addr val\n");
X exit(1);
X }
X k = open("/dev/kmem", O_RDWR);
X if (k < 0)
X error("kmem");
X
X val = atoi(argv[2]);
X
X nl[0].n_name = argv[1];
X
X nl[1].n_name = "";
X
X nlist("/unix", nl);
X
X r = lseek(k, nl[0].n_value, 0);
X if (r == -1)
X error("read seek");
X r = read(k, &oval, sizeof(oval));
X if (r < sizeof(oval))
X error("read");
X
X r = lseek(k, nl[0].n_value, 0);
X if (r == -1)
X error("write seek");
X printf("addr of %s = %lx, old value = %d\n", nl[0].n_name,
X nl[0].n_value, oval);
X
X r = write(k, &val, sizeof(val));
X
X if (r < 0)
X error("write");
X
X r = lseek(k, nl[0].n_value, 0);
X if (r == -1)
X error("read seek 2");
X r = read(k, &oval, sizeof(oval));
X if (r < sizeof(oval))
X error("read 2");
X
X printf("addr of %s = %lx, new value = %d\n", nl[0].n_name,
X nl[0].n_value, oval);
X exit(0);
X}
X
Xerror(s)
X char *s;
X{
X perror(s);
X exit(1);
X}
________This_Is_The_END________
if test `wc -l < kpatch.c` -ne 74; then
echo 'shar: kpatch.c was damaged during transit (should have been 74 lines)'
fi
fi ; : end of overwriting check
exit 0
--
Steve Alexander, Software Technologies Group | stevea@i88.isc.com
INTERACTIVE Systems Corporation, Naperville, IL | ...!{sun,ico}!laidbak!stevea
Technical Details
Message-ID:
<1992Jan09.154906.20003@i88.isc.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!ogicse!hsdndev!spdcc!dirtydog.ima.isc.com!ispd-newsserver!laidbak!steveaReferences:
<96524@bu.edu> <bhqpxa.ane@wang.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f53ba,e380224bfc521d2d X-Google-Attributes: gidf53ba,public X-Google-Thread: 1122ea,5da1bd22e8628b29,start X-Google-Attributes: gid1122ea,public X-Google-Thread: f9325,5da1bd22e8628b29,start X-Google-Attributes: gidf9325,public X-Google-ArrivalTime: 1992-01-09 08:47:01 PST Path: arc1-ca.pugleaf.net!sparky!uunet!ogicse!hsdndev!spdcc!dirtydog.ima.isc.com!ispd-newsserver!laidbak!stevea From: stevea@i88.isc.com (Steve Alexander) Newsgroups: comp.sys.ibm.pc.misc,biz.sco.general,comp.protocols.tcp-ip Subject: Re: Using two Ethernet cards under SCO Unix ? Keywords: ethernet, sco unix, weird setups Message-ID: <1992Jan09.154906.20003@i88.isc.com> Date: 9 Jan 92 15:49:06 GMT Article-I.D.: i88.1992Jan09.154906.20003 References: <96524@bu.edu> <bhqpxa.ane@wang.com> Sender: usenet@i88.isc.com (Usenet News) Organization: INTERACTIVE Systems Corporation, Naperville, IL Lines: 118 Nntp-Posting-Host: ozzy.i88.isc.com