Commit Graph

1991 Commits

Author SHA1 Message Date
tsutsui
3684ba252b Use memcmp(9) and memcpy(9) directly rather than via
local BCMP() and BCOPY() macro.
2009-04-18 15:20:06 +00:00
tsutsui
d779b85d3e Remove extra whitespace added by a stupid tool.
XXX: more in src/sys/arch
2009-04-18 14:58:02 +00:00
elad
2d1c968399 Remove a few KAUTH_GENERIC_ISSUSER in favor of more descriptive
alternatives.

Discussed on tech-kern:

	http://mail-index.netbsd.org/tech-kern/2009/04/11/msg004798.html

Input from ad@, christos@, dyoung@, tsutsui@.

Okay ad@.
2009-04-15 20:44:24 +00:00
christos
86ba58fd64 Fix locking as Andy explained. Also fill in uid and gid like sys_pipe did. 2009-04-11 23:05:26 +00:00
christos
b859fbe7cb Fix PR/37878 and PR/37550: Provide stat(2) for all devices and don't use
fbadop_stat.
2009-04-11 15:47:33 +00:00
bouyer
0c046062f0 Fix another typo 2009-04-04 15:53:49 +00:00
bouyer
11abca258d Fix a comment, and make it build. 2009-04-04 15:47:28 +00:00
bouyer
7f8c56170f Fixes from Masao Uebayashi 2009-04-04 15:31:47 +00:00
ad
c6367674d6 Add fileops::fo_drain(), to be called from fd_close() when there is more
than one active reference to a file descriptor. It should dislodge threads
sleeping while holding a reference to the descriptor. Implemented only for
sockets but should be extended to pipes, fifos, etc.

Fixes the case of a multithreaded process doing something like the
following, which would have hung until the process got a signal.

thr0	accept(fd, ...)
thr1	close(fd)
2009-04-04 10:12:51 +00:00
bouyer
1fd1b49685 Fix for if_start() and pfil_hook() being called from hardware interrupt
context (reported on various mailing-lists, and part of PR kern/41114,
causing panic in pf(4) and possibly ipf(4) when BRIDGE_IPF is used).
Defer bridge_forward() to a software interrupt; bridge_input() enqueues
mbufs to ifp->if_snd which is handled in bridge_forward().
2009-04-04 10:00:23 +00:00
christos
af069eb3c7 Centralize the ROUNDUP and ADVANCE macro in a header file, give them an
RT_ prefix and use them appropriately, instead of making copies. Make
pppd use the RT_ROUNDUP macro; fixes proxyarp setting on 64 bit hosts.

XXX: All this should be pulled up to 5.0
2009-04-02 21:02:06 +00:00
darran
49d3640ae0 Also inherit the parent's TCP segmentation offload capability.
Note the vlan interface does not see updates to the parents capabilities
so if, for example, TSO is on in both, then turned off in the parent it
will remain on in the vlan interface.
2009-04-01 22:56:59 +00:00
darran
36ea3668b9 Fixes PR kern/41069 and PR kern/41070.
Extends the Opencrypto API to allow the destination buffer size to be
specified when its not the same size as the input buffer (i.e. for
operations like compress and decompress).
The crypto_op and crypt_n_op structures gain a u_int dst_len field.
The session_op structure gains a comp_alg field to specify a compression
algorithm.
Moved four ioctls to new ids; CIOCGSESSION, CIOCNGSESSION,  CIOCCRYPT,
and CIOCNCRYPTM.
Added four backward compatible ioctls; OCIOCGSESSION, OCIOCNGSESSION,
OCIOCCRYPT, and OCIOCNCRYPTM.

Backward compatibility is maintained in ocryptodev.h and ocryptodev.c which
implement the original ioctls and set dst_len and comp_alg to 0.

Adds user-space access to compression features.

Adds software gzip support (CRYPTO_GZIP_COMP).

Adds the fast version of crc32 from zlib to libkern. This should be generally
useful and provide a place to start normalizing the various crc32 routines
in the kernel.  The crc32 routine is used in this patch to support GZIP.

With input and support from tls@NetBSD.org.
2009-03-25 01:26:12 +00:00
roy
4ff22349d3 When a route is deleted or it's ifa changed and it's the connected route
for the ifa we should ensure the IFA_ROUTE flag is removed from the ifa
and if applicable, added to the new ifa.
2009-03-24 16:36:52 +00:00
cegger
e2cb85904d bcopy -> memcpy 2009-03-18 17:06:41 +00:00
cegger
c363a9cb62 bzero -> memset 2009-03-18 16:00:08 +00:00
cegger
35fb64746b bcmp -> memcmp 2009-03-18 15:14:29 +00:00
cegger
df7f595ecd Ansify function definitions w/o arguments. Generated with sed. 2009-03-18 10:22:21 +00:00
cegger
962766853c ansify function definitions 2009-03-16 05:59:21 +00:00
cegger
dc56dbbd97 ansify function definitions 2009-03-15 21:23:31 +00:00
cegger
d3189d3544 ansify function definitions 2009-03-15 20:30:05 +00:00
dsl
454af1c0e8 Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
2009-03-14 15:35:58 +00:00
dsl
02cdf4d2c8 Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
2009-03-14 14:45:51 +00:00
plunky
bb3009f7a7 Deprecate the SIOCSIFPHYADDR ioctl and the sysctl node in favour
of the generic SIOCALIFADDR.

As suggested by cube.
2009-03-13 18:40:10 +00:00
roy
ab72df6eb5 Revert r1.119 as the implementation is broken. 2009-03-11 09:26:27 +00:00
mrg
ce98775552 like KERN_FILE2: *do* update "needed" when there is no count. we want
userland to know what sort of size to provide..

while here, slightly normalise the previous to init_sysctl.c.
2009-03-11 05:55:22 +00:00
plunky
32813437a3 repair the SIOCSIFPHYADDR ioctl handler to be compatible with previous
versions which used a "struct sockaddr"
2009-03-10 22:14:57 +00:00
yamt
3d7b4bf380 - rtredirect: use sockaddr_cmp directly.
- remove now unused equal.
2009-02-20 10:57:19 +00:00
yamt
a628bc1c00 remove inline from some functions which are not small or critical. 2009-02-20 10:54:57 +00:00
christos
c6c3da7776 PR/40690: Jordan Gordeev: pppoe(4) doesn't work when PPPoE relays are present
Add support for sending the session id tag back.
2009-02-19 15:17:50 +00:00
christos
fab9a9d4d2 mention when this will really break, not 2038 but 2145. 2009-02-14 20:48:46 +00:00
christos
942a145f69 PR/40603: Christoph Badura: unprivileged users can add and delete interface
link addresses. Fixed by centralizing the test as suggested. Will pull up
to 5.0 once submitter tests the fix.
2009-02-12 19:05:36 +00:00
dyoung
dcbf325fdb Cosmetic: break a line, change some spaces to tabs, remove an extra
empty line.
2009-02-05 21:45:36 +00:00
pooka
233a89adc0 Drop splnet() *after* tsleep instead of before. Fixes a race condition
between sleep and wakeup.  (tested on NetBSD 4.0)
2009-02-01 21:25:06 +00:00
yamt
1b3ee850af ppp_get_compressor: take module_lock when trying to load a module. PR/40428 2009-01-19 15:16:34 +00:00
mrg
c30587badd Fix multiple problems:
* A sign extension error creating the bridge ID corrupted the
    priority (always making it the maximum).
    * Do not catch STP packets on an interface for which STP is not
    enabled -- it's a violation of the spec, and causes STP to fail on
    neighboring bridges.
    * An optimization to bstp_input() -- some information is already
    known when we call it.

contributed anonymously.
2009-01-18 10:28:55 +00:00
christos
185469a211 restore binary compatibility on 64 bit systems. 2009-01-13 19:10:52 +00:00
christos
acdd91479e we need route_enqueue not to be static 2009-01-11 04:34:16 +00:00
christos
461a86f9bd merge christos-time_t 2009-01-11 02:45:45 +00:00
bjh21
12052c1959 Make Econet code compile again. 2009-01-07 20:56:40 +00:00
roy
108e90401a When removing routes automatically added, remove the flag from the associated
address.
When changing routes automatically addded, move the flag to the new assoicated
address.
2008-12-21 19:12:43 +00:00
cegger
9b87d582bd kill MALLOC and FREE macros. 2008-12-17 20:51:31 +00:00
christos
9a5d3f2817 replace bitmask_snprintf(9) with snprintb(3) 2008-12-16 22:35:21 +00:00
christos
c8164f5d15 RTAX_GENMASK and RTAX_AUTHOR could cause kernel memory corruption because
info struct members could be pointing to free'd memory. Fix from dyoung.
XXX: Pullup to 5.0
2008-12-12 22:34:58 +00:00
cube
9f95a5d658 Fix handling of ppp compressor modules, from Andrew Doran's input.
- ref count each compressor
 - allow {un,}registration of several modules at once
 - une RUN_ONCE to make sure the mutex is initialised, because
   unfortunately built-in (and bootloader-loaded) modules init functions
   are run before pseudo-devices attach (reported by Nick Hudson).
2008-11-29 23:15:20 +00:00
pooka
c6e7028d1c Make dom_maxrtkey of inet/inet6domain the size of the ip_encap pack
structures.  This is far from optimal, but gets rid of iffy
#ifdef INET in radix.c.  The radix bonsai still needs lots of love
before loading domains dynamically is possible...
2008-11-25 18:28:05 +00:00
cube
c12e613f44 Rework the way PPP compmressors are handled and allow them to be
automatically loaded when needed.
2008-11-25 02:40:36 +00:00
dyoung
a38f380ef4 Update comment for last. 2008-11-20 21:55:15 +00:00
dyoung
67852fcbc2 In the new ifioctl order, tun_ioctl() can call itself through
ifioctl_common().  Since the first tun_ioctl() call already holds
the simplelock, the second tun_ioctl() call will wait forever to
acquire it: deadlock.

To fix this, wait to acquire the lock until tuninit().
2008-11-20 21:54:42 +00:00
martin
e6d2ca8863 Pass SIOCAIFADDR to ifioctl_common, fixes PR kern/39900. 2008-11-13 22:22:24 +00:00