Commit Graph

417 Commits

Author SHA1 Message Date
roy 98b0d70fff Add ifam_pid and ifam_addrflags to ifa_msghdr.
Re-version RTM_NEWADDR, RTM_DELADDR, RTM_CHGADDR and NET_RT_IFLIST.
Add compat code for old version.
2016-09-21 10:50:22 +00:00
martin 1766e4eee1 Make the ktrace record written by do_sys_sendmsg/do_sys_recvmsg overridable
by the caller. Use this in compat_netbsd32 to log the 32bit version, so
the 32bit userland kdump is happy.
2016-09-13 07:01:07 +00:00
mrg 1d6ce431db fill in the tv_nsec parts of the converted timespec in cvtstat(). 2016-08-20 00:34:42 +00:00
ozaki-r a403cbd4f5 Apply pserialize and psref to struct ifaddr and its variants
This change makes struct ifaddr and its variants (in_ifaddr and in6_ifaddr)
MP-safe by using pserialize and psref. At this moment, pserialize_perform
and psref_target_destroy are disabled because (1) we don't need them
because of softnet_lock (2) they cause a deadlock because of softnet_lock.
So we'll enable them when we remove softnet_lock in the future.
2016-08-01 03:15:30 +00:00
ozaki-r 3a0f73376f Apply if_get/if_put to compat_ifioctl 2016-07-25 08:30:19 +00:00
ozaki-r 9e4c2bda8a Switch the address list of intefaces to pslist(9)
As usual, we leave the old list to avoid breaking kvm(3) users.
2016-07-07 09:32:01 +00:00
ozaki-r e1135cd9b9 Use curlwp_bind and curlwp_bindx instead of open-coding LP_BOUND 2016-06-16 02:38:40 +00:00
ozaki-r 040205ae93 Protect ifnet list with psz and psref
The change ensures that ifnet objects in the ifnet list aren't freed during
list iterations by using pserialize(9) and psref(9).

Note that the change adds a pslist(9) for ifnet but doesn't remove the
original ifnet list (ifnet_list) to avoid breaking kvm(3) users. We
shouldn't use the original list in the kernel anymore.
2016-05-12 02:24:16 +00:00
roy bb67ec8f00 Add sc_pid to sockcred so that SOCK_DGRAM and LOCAL_CREDS socket option
can learn the process id of the AF_LOCAL sender.
Add compat glue for old structure.
2016-04-06 19:45:45 +00:00
mrg 65f5251eae remove a bunch of "@echo done" from the tail of rules. these messages
were vaguely useful back when we didn't run make -j, but now you end
up with a single line "done" every so often, with no idea what it is
for.  very few other targets claim they're done so just remove these.
2016-03-22 08:25:22 +00:00
christos 8cc2b02f1c PR/50947: David Binderman: sprinkle parens 2016-03-11 18:32:29 +00:00
pgoyette 8285edda53 Modularize the clockctl pseudo-device and link to the build. 2015-12-07 03:25:57 +00:00
pgoyette 5d8b2e34a2 The COMPAT_10 code for SYSVxxx is now part of the sysv_ipc module, so
don't install syscall function pointers from the compat module.
2015-12-05 01:59:51 +00:00
pgoyette 65fae32d98 Merge the compat_sysv module into the sysv_ipc module - it should
never have been a separate module in the first place (my bad).

Adjust dependencies as appropriate.
2015-12-03 02:51:00 +00:00
pgoyette 0bc066df68 Add comment to #ifdef - it's a long way from its original #if 2015-12-03 00:28:55 +00:00
maxv ea498aca7e Change do_sys_mount() so that it only takes as argument the type of the
drive instead of its associated vfsops. Makes it more friendly, and allows
compat binaries to autoload VFS modules if needed.

sent on tech-kern@, ok christos@
2015-10-23 19:40:10 +00:00
christos e2746c9719 Handle both ioctls in both places :-) 2015-10-22 15:18:25 +00:00
uebayasi ea72de740f Order library object build. 2015-09-07 03:44:19 +00:00
uebayasi 9068ec741b Sprinkle more done messages. 2015-09-07 03:20:18 +00:00
uebayasi dd204a345e In kernel lib build, print message when things not only start bug also end. 2015-09-06 15:34:55 +00:00
pooka d8e04c9094 to garnish, dust with _KERNEL_OPT 2015-08-24 22:50:32 +00:00
maxv 6647020bbc Unused inits (harmless).
Found by Brainy.
2015-07-24 13:02:52 +00:00
njoly fc005ae43f Handle case where compat_ifioctl() is called with ocmd != cmd, as found in
compat Linux. Do not crash by ensuring that oifr is correctly set.

Fix crash reported by Robert Swindells on tech-kern@.
2015-07-11 07:43:32 +00:00
pgoyette 9681555f60 The compat_sysv module now depends on sysv_ipc module. 2015-05-13 02:08:20 +00:00
christos 6ebc227033 rump is compiled with COMPAT_OSOCK not COMPAT_OIFREQ and the code in if.c
is not handling this case properly. Make this work by checking again if
we need to convert struct ifreq here, and if we do, we do it ourselves.
2015-05-12 20:42:46 +00:00
pgoyette 0caf2564d1 Fix the #ifdef _MODULE stuff so that the syscall packages and sysctl stuff
gets handled properly even in built-in module case.

XXX
Whatever was I thinking when I put those conditionals in?  And wouldn't it
be a wonderful thing to have some atf regression tests to actually catch
errors in the compat{,_sysv} modules?   :)
2015-05-11 10:32:13 +00:00
pgoyette ff00f0b594 Split the SYSV* compat code out into a separate compat_sysv module.
For monolithic kernels, both modules will be compiled as "built-ins",
while modular environments will be able to load the SYSVSEM, SYSVSHM,
and SYSVMSG code independant from the rest of compat.

This is a necessary precursor step to making the "STD" SYSV* code
into a separate module.

Tested in both monolithic and modular environments with no errors
seen.
2015-05-10 07:41:15 +00:00
ozaki-r 1d0321acf8 Tweak ifconf variants
The tweaks make the code intention clear and make further changes easy.

No functional change.
2014-11-26 09:53:53 +00:00
maxv eda7c7bbe4 Do not uselessly include <sys/malloc.h>. 2014-11-09 17:48:07 +00:00
christos 3c3b014425 simplify 2014-10-20 11:58:01 +00:00
maxv 4ddff69ff4 Memory leak, triggerable from root only.
Found by my code scanner.

ok christos@
2014-10-20 06:56:38 +00:00
matt 45b1ec740d Try not to use f_data, use f_{vnode,socket,pipe,mqueue,kqueue,ksem} to get
a correctly typed pointer.
2014-09-05 09:20:59 +00:00
rtr 0dedd9772f fix parameter types in pr_ioctl, called xx_control() functions and remove
abuse of pointer to struct mbuf type.

param2 changed to u_long type and uses parameter name 'cmd' (ioctl command)
param3 changed to void * type and uses parameter name 'data'
param4 changed to struct ifnet * and uses parameter name 'ifp'
param5 has been removed (formerly struct lwp *) and uses of 'l' have been
       replaced with curlwp from curproc(9).

callers have had (now unnecessary) casts to struct mbuf * removed, called
code has had (now unnecessary) casts to u_long, void * and struct ifnet *
respectively removed.

reviewed by rmind@
2014-07-01 05:49:18 +00:00
rtr d54d7ab24a * split PRU_CONTROL functionality out of xxx_userreq() switches and place
into separate xxx_ioctl() functions.
* place KASSERT(req != PRU_CONTROL) inside xxx_userreq() as it is now
  inappropriate for req = PRU_CONTROL in xxx_userreq().
* replace calls to pr_generic() with req = PRU_CONTROL with pr_ioctl().
* remove & fixup references to PRU_CONTROL xxx_userreq() function comments.
* fix various comments references for xxx_userreq() that mentioned
  PRU_CONTROL as xxx_userreq() no longer handles the request.

a further change will follow to fix parameter and naming inconsistencies
retained from original code.

Reviewed by rmind@
2014-06-22 08:10:18 +00:00
dholland 39b82eecb9 Use accessor functions for the tty's table of control characters.
(at least from outside the core tty sources)

Move some xon/xoff code from net/ppp_tty.c to kern/tty.c.
2014-05-22 16:31:19 +00:00
rmind 39bd8dee77 Add struct pr_usrreqs with a pr_generic function and prepare for the
dismantling of pr_usrreq in the protocols; no functional change intended.
PRU_ATTACH/PRU_DETACH changes will follow soon.

Bump for struct protosw.  Welcome to 6.99.62!
2014-05-18 14:46:15 +00:00
njoly 4eb3dbc504 Move a few compat 50 syscalls, not applicable to rump kernels, out of
kern_time_50.c to a new source module.
2014-04-04 18:17:36 +00:00
christos dbe9c08e6d use cpu_getmodel() to get the model name 2014-03-24 20:08:08 +00:00
christos 59afdfa995 Fix the compat-4.3 getdirentries call (pre d_type). This is used in NetBSD-0.9. 2014-01-28 01:29:04 +00:00
christos dab0adecf2 It is wishful thinking that vn_readdir will return dirent12 structures. 2014-01-24 22:11:46 +00:00
martin 4d03a889b8 Free pathbuf in an error path.
From Maxime Villard.
2013-12-17 20:45:22 +00:00
christos 9d605174d9 Change the queue.3 *_END(&head) macros to NULL. Since we don't have CIRCLEQ
anymore, all the macros expand to NULL anyway, so this improves readability.
Requested by rmind@
2013-11-27 17:24:43 +00:00
christos 0b725b63c7 change the mountlist CIRCLEQ into a TAILQ 2013-11-23 13:35:36 +00:00
christos 721e82b55a exec modules need to be of the exec kind 2013-09-19 18:50:35 +00:00
christos ab470567c6 compat glue for new lwp_park() 2013-03-29 01:02:49 +00:00
christos 6b28c645f3 remove empty #if 2013-02-21 14:13:01 +00:00
skrll a0267f89e6 Wrap sysctl_teardown(&compat_clog) with the appropriate #if defined()s 2013-02-21 10:22:04 +00:00
pgoyette e8ac3e27f9 Move boottime50 and its associated sysctl into the compat module. As
noted on tech-kern.  Should fix PR/47579.

OK christos@

Will request pull-up to 6.0 in a few days.
2013-02-21 01:39:54 +00:00
christos 8a8a278a1c Simplify the ifdef mess. No functional context. 2013-01-22 01:47:20 +00:00
njoly 1ebbf7b605 Move rusage computation to a new getrusage1() function. Adjust all
compat/emulations to make use of it.
2012-11-03 23:22:21 +00:00