Commit Graph

51 Commits

Author SHA1 Message Date
wiz 456dff6cb8 Spell 'occurred' with two 'r's. 2001-09-16 16:34:23 +00:00
itojun 2990097219 repair validation on RTAX_GENMASK insertion. has been broken since 44bsd.
(freebsd3 has a fix since 1999, but has insufficient validation on sa_len)
2001-07-21 12:20:36 +00:00
enami 661cd5d582 No need to clear part of struct rt_addrinfo in rt_xaddrs() since the only
caller clears whole the struct.
2001-07-19 00:12:09 +00:00
thorpej cbf41a143a bzero -> memset 2001-07-18 16:43:09 +00:00
itojun 80e7db0fcd simplify previous change (mbuf length adjustment for rtsock response). 2001-06-04 08:57:58 +00:00
itojun 4a32096acf adjust routing socket response mbufs to the correct length. sync with kame. 2001-06-04 01:30:11 +00:00
itojun df9784d749 pull post-4.4BSD change to sys/net/route.c from BSD/OS 4.2 (UCB copyrighted).
have sys/net/route.c:rtrequest1(), which takes rt_addrinfo * as the argument.
pass rt_addrinfo all the way down to rtrequest, and ifa->ifa_rtrequest.
3rd arg of ifa->ifa_rtrequest is now rt_addrinfo * instead of sockaddr *
(almost noone is using it anyways).

benefit: the follwoing command now works.  previously we need two route(8)
invocations, "add" then "change".
# route add -inet6 default ::1 -ifp gif0

remove unsafe typecast in rtrequest(), from rtentry * to sockaddr *.  it was
introduced by 4.3BSD-reno and never corrected.

XXX is eon_rtrequest() change correct regarding to 3rd arg?
eon_rtrequest() and rtrequest() were incorrect since 4.3BSD-reno,
so i do not have correct answer in the source code.
someone with more clue about netiso-over-ip, please help.
2001-01-17 04:05:41 +00:00
enami 7d3b20fb20 Don't require the size of sockaddr to be rounded up if it was the last one
and was netmask.
2000-11-10 03:37:42 +00:00
itojun 27fcf101a1 prevent stack overwrite due to bzero() arg mistake. from msaitoh. 2000-10-19 01:07:42 +00:00
erh d921f48d7a When grabbing address structures out of a character array make sure that the number of addresses and length of each match up with the size of the data we're handed. Fixes arp on the alpha. 2000-09-28 01:14:06 +00:00
mrg 8e3207b69a <vm/vm.h> -> <uvm/uvm_extern.h> 2000-06-28 02:53:49 +00:00
simonb 450dc64ed8 Remove some routing specific sysctl function declarations from
<sys/sysctl.h> and make them static in net/rtsock.c.
2000-04-15 17:51:27 +00:00
augustss c1ebd1929a Kill some more register declarations. 2000-03-30 09:45:33 +00:00
itojun dcec402dc9 initialize rn with 0, just to be sure 2000-03-12 11:58:15 +00:00
itojun 8937ddef33 do not touch radix_node with RNF_ROOT on route_output(). this can
cause kernel panic (by non-root invocation of route(8)) on certain
routing table setup.
KAME PR: 217
2000-03-10 14:47:12 +00:00
thorpej 0f5c059d1f - Add link status to if_data, so that routing daemons and other interested
parties can easily know the state of a link.
- Define an interface announcement message for the routing socket so that
  routing daemons and other interested parties know when an interface
  is attached/detached.
2000-03-06 20:49:00 +00:00
itojun de10c7425e backout incomplete hack from KAME codebase (originally from bbn).
the hack tries to respect ifa or ifp passed to RTM_ADD.  However, the change
broke certain link-layers.  They include:
- midway ethernet card (en*), which uses sockaddr_dl in gateway portion
  to pass PVC information.  with the patch, the gateway portion will be
  overwritten by empty sockaddr_dl and PVC initialization will fail.
- IPv6, which can't set static ND table with the patch (ndp -s), for the
  similar reason as above.

There may be improved hack coming soon, hope the new one does not break others.
2000-02-17 04:28:00 +00:00
itojun 5d257be455 make assumption in rt_msg1 (len <= MHLEN + MLEN) explicit.
panic if not satisfied.
2000-02-11 06:11:03 +00:00
thorpej d844a3ac41 First-draft if_detach() implementation, originally from Bill Studnemund,
although this version has been changed somewhat:
- reference counting on ifaddrs isn't as complete as Bill's original
  work was.  This is hard to get right, and we should attack one
  protocol at a time.
- This doesn't do reference counting or dynamic allocation of ifnets yet.
- This version introduces a new PRU -- PRU_PURGEADDR, which is used to
  purge an ifaddr from a protocol.  The old method Bill used didn't work
  on all protocols, and it only worked on some because it was Very Lucky.

This mostly works ... i.e. works for my USB Ethernet, except for a dangling
ifaddr reference left by the IPv6 code; have not yet tracked this down.
2000-02-01 22:52:04 +00:00
bouyer f86517a031 Update protocoles and interfaces stats counters to 64bit.
RTM_IFINFO is now 0xf, 0xe is RTM_OIFINFO which returns the old (if_msghdr14)
struct with 32bit counters (binary compat, conditioned on COMPAT_14).
Same for sysctl: node 3 is renamed NET_RT_OIFLIST, NET_RT_IFLIST is now node 4.
Change rt_msg1() to add an mbuf to the mbuf chain instead of just panic()
when the message is larger than MHLEN.
1999-11-19 10:41:41 +00:00
thorpej 267920eb1a defopt INET6, and put it in opt_inet.h (most places already include this
file, which is why the file list is so short).
1999-07-09 23:41:16 +00:00
itojun 118d2b1d4f IPv6 kernel code, based on KAME/NetBSD 1.4, SNAP kit 19990628.
(Sorry for a big commit, I can't separate this into several pieces...)
Pls check sys/netinet6/TODO and sys/netinet6/IMPLEMENTATION for details.

- sys/kern: do not assume single mbuf, accept chained mbuf on passing
  data from userland to kernel (or other way round).
- "midway" ATM card: ATM PVC pseudo device support, like those done in ALTQ
  package (ftp://ftp.csl.sony.co.jp/pub/kjc/).
- sys/netinet/tcp*: IPv4/v6 dual stack tcp support.
- sys/netinet/{ip6,icmp6}.h, sys/net/pfkeyv2.h: IETF document assumes those
  file to be there so we patch it up.
- sys/netinet: IPsec additions are here and there.
- sys/netinet6/*: most of IPv6 code sits here.
- sys/netkey: IPsec key management code
- dev/pci/pcidevs: regen

In my understanding no code here is subject to export control so it
should be safe.
1999-07-01 08:12:45 +00:00
chopps 0723de9c6c deal with failure of malloc NOWAIT by restarting after mallocing with WAIT.
don't write beyond the users given buffer size (this happened if there was
	enough space for the initial malloc to succeed).
1999-04-02 17:22:21 +00:00
christos c748ecf74a fix thinko in previous change. 1998-12-12 17:26:09 +00:00
christos 13d58281de IPX counters and centralize statistics routine. 1998-12-10 15:52:39 +00:00
fvdl e5bc90f40c Merge with Lite2 + local changes 1998-03-01 02:20:01 +00:00
christos badc0e40aa PR/2733: Bill Sommerfeld: route change command can crash system. Actually
the case mentioned in the PR was fixed as part of PR/2582. There was a similar
case though that was not handled as part of my initial fix, which was fixed
in FreeBSD. I applied the remaining part from FreeBSD and the code matches
now the FreeBSD respective version. [this probably should be pulled up for 1.3]
1997-12-10 00:47:57 +00:00
thorpej 667f747f9a m_copyback() is now in uipc_mbuf.c 1997-03-27 20:38:20 +00:00
thorpej cf9c91c5d7 Allow non-superuser to open, listen to, and send safe commands on the
routing socket.  Superuser priviledge is required for all commands
but RTM_GET.
1997-02-22 03:47:01 +00:00
mycroft f056beb022 Undo silly part of previous change. 1996-12-11 09:37:42 +00:00
christos 0c609bcf9e - Fix PR/2582: default route change without specifying gateway kills system.
While I was there:
- Fix KNF style problem.
- Remove bogus casts to 0, and (caddr_t).
1996-07-01 01:12:32 +00:00
mycroft c630947e89 We must indirect through the higher-level protocol for
PRU_{BIND,CONNECT} so that it can check the sockaddr.
1996-05-23 18:30:57 +00:00
mycroft 49d52c9b1c Pass a proc pointer down to the usrreq and pcbbind functions for PRU_ATTACH, PRU_BIND and
PRU_CONTROL.  The usrreq interface really needs to be split up, but this will have to wait.
Remove SS_PRIV completely.
1996-05-22 13:54:55 +00:00
cgd 19b97477b9 make this version of ROUNDUP() consistent with the others in this directory.
(only makes a diff on the alpha.)
1996-03-29 00:32:10 +00:00
christos 206e75c6f1 Net prototypes 1996-02-13 21:59:53 +00:00
cgd 9ee311ead5 Update to latest code from CSRG. 1995-08-19 07:48:14 +00:00
mycroft 873ed30f83 so_pcb should be a void *. 1995-08-17 02:57:20 +00:00
mycroft 5482957905 splnet --> splsoftnet 1995-08-12 23:59:09 +00:00
mycroft 6897f39ae9 Various cleanup, including:
* Convert several data structures to use queue.h.
* Split in_pcbnotify() into two parts; one for notifying a specific PCB, and
one for notifying all PCBs for a particular foreign address.
1995-06-12 00:46:47 +00:00
cgd e363664703 fixed sized types, where appropriate. when casting pointers to
integers to do math on them, cast to long.  ioctl commands are
u_longs.
1995-03-08 02:56:49 +00:00
cgd cf92afd66e New RCS ID's, take two. they're more aesthecially pleasant, and use 'NetBSD' 1994-06-29 06:29:24 +00:00
mycroft 07b4f2ab54 Update to 4.4-Lite networking code, with a few local changes. 1994-05-13 06:02:48 +00:00
mycroft d3be517803 Update to RTM version 3. Add prototypes. Add some new constants which are
not used yet.
1994-05-11 09:26:46 +00:00
cgd 5742972bb4 kill kinfo stuff, for now 1994-05-07 04:26:58 +00:00
mycroft bf98a55f37 Deprecate af.h. 1994-02-10 17:25:03 +00:00
cgd a939028310 include <machine/cpu.h> not <machine/mtpr.h> 1994-01-16 02:22:51 +00:00
mycroft 95b048b53a Canonicalize all #includes. 1993-12-18 00:40:47 +00:00
jtc f7b7d95850 include systm.h to get prototypes (and possibly inlines) of *max functions. 1993-09-04 00:00:19 +00:00
cgd fe1802950b add include of select.h if necessary for protos, or delete if extraneous 1993-05-22 11:40:42 +00:00
cgd 8d6c77881c make kernel select interface be one-stop shopping & clean it all up. 1993-05-18 18:18:40 +00:00