Commit Graph

45 Commits

Author SHA1 Message Date
itojun d2f1c029b9 kill sprintf, use snprintf 2004-04-21 18:40:37 +00:00
matt e3b919c754 Constify if.c radix.c and route.c (and fix related fallout). 2004-04-21 04:17:28 +00:00
matt a87928f350 ANSI'fy, de-__P(), and constify some read-only data. 2004-04-19 05:16:45 +00:00
christos 36b4e0b6e7 Fix off-by-one in PRC_NCMDS check. From FreeBSD via OpenBSD 2003-09-30 00:01:18 +00:00
itojun 82eb4ce914 change the additional arg to be passed to ip{,6}_output to struct socket *.
this fixes KAME policy lookup which was broken by the previous commit.
2003-08-22 21:53:01 +00:00
jonathan 28b5f5dfab (fast-ipsec): Add hooks to pass IPv4 IPsec traffic into fast-ipsec, if
configured with ``options FAST_IPSEC''.  Kernels with KAME IPsec or
with no IPsec should work as before.

All calls to ip_output() now always pass an additional compulsory
argument: the inpcb associated with the packet being sent,
or 0 if no inpcb is available.

Fast-ipsec tested with ICMP or UDP over ESP. TCP doesn't work, yet.
2003-08-15 03:42:00 +00:00
agc aad01611e7 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22364, verified by myself.
2003-08-07 16:26:28 +00:00
itojun c00fa8dfd9 avoid swapping endian of ip_len and ip_off on mbuf, to meet with M_LEADINGSPACE
optimization made last year.  should solve PR 17867 and 10195.

IP_HDRINCL behavior of raw ip socket is kept unchanged.  we may want to
provide IP_HDRINCL variant that does not swap endian.
2002-08-14 00:23:27 +00:00
itojun 27174b9ec9 fix null pointer deref. from ho@openbsd 2002-07-29 22:54:38 +00:00
lukem 2565646230 don't need <sys/types.h> when including <sys/param.h> 2001-11-15 09:47:59 +00:00
lukem 4f2ad95259 add RCSIDs 2001-11-13 00:56:55 +00:00
itojun 4d51fe368b change the meaning of ifnet.if_lastchange to meet RFC1573 ifLastChange.
follows BSD/OS practice and ucd-snmp code (FreeBSD does it for specific
interfaces only).

was: if_lastchange get updated on every packet transmission/receipt.
now: if_lastchange get updated when IFF_UP is changed.
2001-06-14 05:44:23 +00:00
thorpej bf2dcec4f5 Remove the use of splimp() from the NetBSD kernel. splnet()
and only splnet() is allowed for the protection of data structures
used by network devices.
2001-04-13 23:29:55 +00:00
itojun 2d9097af9e correct typecast for eonrtrequest 3rd arg. 2001-01-17 15:13:37 +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
thorpej fc5dafc79b Fix a rather annoying problem where the sockaddr_dl which holds
the link level name for the interface (ifp->if_sadl) is allocated
before ifp->if_addrlen is initialized, which could lead to allocating
too little space for the link level address.

Do this by splitting allocation of the link level name out of
if_attach() and into if_alloc_sadl(), which is normally called
by functions like ether_ifattach().  Network interfaces which
don't have a link-specific attach routine must call if_alloc_sadl()
themselves (example: gif).

Link level names are freed by if_free_sadl(), which can be called
from e.g. ether_ifdetach().  Drivers never need call if_free_sadl()
themselves as if_detach() will do it if it is not already done.

While here, add the ability to pass an AF_LINK address to
SIOCSIFADDR in ether_ioctl() (this is what caused me to notice
the problem that the above fixes).
2001-01-17 00:30:49 +00:00
augustss 8529438fe6 Remove register declarations. 2000-03-30 12:51:13 +00:00
itojun 04ac848d6f introduce m->m_pkthdr.aux to hold random data which needs to be passed
between protocol handlers.

ipsec socket pointers, ipsec decryption/auth information, tunnel
decapsulation information are in my mind - there can be several other usage.
at this moment, we use this for ipsec socket pointer passing.  this will
avoid reuse of m->m_pkthdr.rcvif in ipsec code.

due to the change, MHLEN will be decreased by sizeof(void *) - for example,
for i386, MHLEN was 100 bytes, but is now 96 bytes.
we may want to increase MSIZE from 128 to 256 for some of our architectures.

take caution if you use it for keeping some data item for long period
of time - use extra caution on M_PREPEND() or m_adj(), as they may result
in loss of m->m_pkthdr.aux pointer (and mbuf leak).

this will bump kernel version.

(as discussed in tech-net, tested in kame tree)
2000-03-01 12:49:27 +00:00
itojun 559075a711 make sure we do not pass bogus socket pointer to IPv4 IPsec.
XXX we (KAME) are trying to invent cleaner way to pass socket pointer to
ip{,6}_output... so please permit this mess for now.
1999-12-24 05:01:33 +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
mjacob d7e48cb804 adjust format args for compiler changes 1999-03-04 02:38:31 +00:00
jonathan f2a2327e0a defopt EON. 1998-07-05 01:06:49 +00:00
fvdl e5bc90f40c Merge with Lite2 + local changes 1998-03-01 02:20:01 +00:00
thorpej 4c54445530 Use offsetof() from libkern.h 1998-01-28 02:35:10 +00:00
cgd 4293c20761 return an error if given an ioctl which isn't recognized. (Fixes
ifconfig media warning with GENERIC kernels, as well as simply being
more correct.)
1998-01-16 18:54:10 +00:00
is 07b064e02e New ARP system, supports IPv4 over any hardware link.
Some of the stuff (e.g., rarpd, bootpd, dhcpd etc., libsa) still will
only support Ethernet. Tcpdump itself should be ok, but libpcap needs
lot of work.

For the detailed change history, look at the commit log entries for
the is-newarp branch.
1997-03-15 18:09:08 +00:00
veego 8f03890dff Cast the printf("%ld", sizeof) in eoniphdr to long.
This fix a -Wall error on non alpha systems
1996-11-23 21:13:18 +00:00
cgd 6cc49bedec fix -Wformat problems 1996-11-13 20:00:15 +00:00
christos 5545959d0b backout previous kprintf changes 1996-10-13 02:03:00 +00:00
christos 6d7ad25bea printf -> kprintf, sprintf -> ksprintf 1996-10-10 23:12:43 +00:00
scottr 64da2bdad9 Include <machine/cpu.h> to get setsoftnet().
XXX - We need this for at least amiga and hp300.  This change must die,
      and is intended as a temporary workaround only.
1996-05-09 22:29:25 +00:00
thorpej 4edabe2501 Changed struct ifnet to have a pointer to the softc of the underlying
device and a printable "external name" (name + unit number), thus eliminating
if_name and if_unit.  Updated interface to (*if_watchdog)() and (*if_reset)()
to take a struct ifnet *, rather than a unit number.
1996-05-07 02:40:22 +00:00
cgd 7e4d04910d fix screw-up in the prototyping changes: print pointers with %p, NOT
by casting them to (unsigned int) then printing with %x.
1996-04-13 01:34:06 +00:00
christos 2d4af9a7f8 netiso prototypes and fixes to get -DTUBA to compile. 1996-02-13 22:07:57 +00:00
mycroft 3c833d10fc Clean this up a bit. Use queue.h more; de-uglify casts. 1995-06-13 07:13:14 +00:00
mycroft d2307f3ecb Update to match data structure changes. 1995-06-13 05:52:42 +00:00
cgd 6ac2bbfc35 be more careful with types, also pull in headers where necessary. 1994-10-30 21:43:03 +00:00
cgd fccfa11af5 New RCS ID's, take two. they're more aesthecially pleasant, and use 'NetBSD' 1994-06-29 06:39:25 +00:00
mycroft c427e65091 Update to 4.4-Lite networking code, with a few local changes. 1994-05-13 06:08:03 +00:00
mycroft 5887b43cde Nuke if_init. 1994-02-11 06:41:51 +00:00
cgd b8b27d46f2 pull in <machine/cpu.h>, rather than <machine/mtpr.h> for soft intr stuff 1994-01-16 01:58:59 +00:00
mycroft 00d41f83e8 Make this compile again after netinet changes. 1994-01-10 22:01:43 +00:00
mycroft 95b048b53a Canonicalize all #includes. 1993-12-18 00:40:47 +00:00
cgd b3ab33bca9 file header cleanup and rcsid additions 1993-05-20 05:26:42 +00:00
cgd db622a7428 added netccitt, netiso, and netns support, from (currently
alpha) patch 126
1993-04-09 12:00:07 +00:00