Commit Graph

174831 Commits

Author SHA1 Message Date
dyoung de87fe677d *** Summary ***
When a link-layer address changes (e.g., ifconfig ex0 link
02🇩🇪ad:be:ef:02 active), send a gratuitous ARP and/or a Neighbor
Advertisement to update the network-/link-layer address bindings
on our LAN peers.

Refuse a change of ethernet address to the address 00:00:00:00:00:00
or to any multicast/broadcast address.  (Thanks matt@.)

Reorder ifnet ioctl operations so that driver ioctls may inherit
the functions of their "class"---ether_ioctl(), fddi_ioctl(), et
cetera---and the class ioctls may inherit from the generic ioctl,
ifioctl_common(), but both driver- and class-ioctls may override
the generic behavior.  Make network drivers share more code.

Distinguish a "factory" link-layer address from others for the
purposes of both protecting that address from deletion and computing
EUI64.

Return consistent, appropriate error codes from network drivers.

Improve readability.  KNF.

*** Details ***

In if_attach(), always initialize the interface ioctl routine,
ifnet->if_ioctl, if the driver has not already initialized it.
Delete if_ioctl == NULL tests everywhere else, because it cannot
happen.

In the ioctl routines of network interfaces, inherit common ioctl
behaviors by calling either ifioctl_common() or whichever ioctl
routine is appropriate for the class of interface---e.g., ether_ioctl()
for ethernets.

Stop (ab)using SIOCSIFADDR and start to use SIOCINITIFADDR.  In
the user->kernel interface, SIOCSIFADDR's argument was an ifreq,
but on the protocol->ifnet interface, SIOCSIFADDR's argument was
an ifaddr.  That was confusing, and it would work against me as I
make it possible for a network interface to overload most ioctls.
On the protocol->ifnet interface, replace SIOCSIFADDR with
SIOCINITIFADDR.  In ifioctl(), return EPERM if userland tries to
invoke SIOCINITIFADDR.

In ifioctl(), give the interface the first shot at handling most
interface ioctls, and give the protocol the second shot, instead
of the other way around. Finally, let compatibility code (COMPAT_OSOCK)
take a shot.

Pull device initialization out of switch statements under
SIOCINITIFADDR.  For example, pull ..._init() out of any switch
statement that looks like this:

        switch (...->sa_family) {
        case ...:
                ..._init();
                ...
                break;
        ...
        default:
                ..._init();
                ...
                break;
        }

Rewrite many if-else clauses that handle all permutations of IFF_UP
and IFF_RUNNING to use a switch statement,

        switch (x & (IFF_UP|IFF_RUNNING)) {
        case 0:
                ...
                break;
        case IFF_RUNNING:
                ...
                break;
        case IFF_UP:
                ...
                break;
        case IFF_UP|IFF_RUNNING:
                ...
                break;
        }

unifdef lots of code containing #ifdef FreeBSD, #ifdef NetBSD, and
#ifdef SIOCSIFMTU, especially in fwip(4) and in ndis(4).

In ipw(4), remove an if_set_sadl() call that is out of place.

In nfe(4), reuse the jumbo MTU logic in ether_ioctl().

Let ethernets register a callback for setting h/w state such as
promiscuous mode and the multicast filter in accord with a change
in the if_flags: ether_set_ifflags_cb() registers a callback that
returns ENETRESET if the caller should reset the ethernet by calling
if_init(), 0 on success, != 0 on failure.  Pull common code from
ex(4), gem(4), nfe(4), sip(4), tlp(4), vge(4) into ether_ioctl(),
and register if_flags callbacks for those drivers.

Return ENOTTY instead of EINVAL for inappropriate ioctls.  In
zyd(4), use ENXIO instead of ENOTTY to indicate that the device is
not any longer attached.

Add to if_set_sadl() a boolean 'factory' argument that indicates
whether a link-layer address was assigned by the factory or some
other source.  In a comment, recommend using the factory address
for generating an EUI64, and update in6_get_hw_ifid() to prefer a
factory address to any other link-layer address.

Add a routing message, RTM_LLINFO_UPD, that tells protocols to
update the binding of network-layer addresses to link-layer addresses.
Implement this message in IPv4 and IPv6 by sending a gratuitous
ARP or a neighbor advertisement, respectively.  Generate RTM_LLINFO_UPD
messages on a change of an interface's link-layer address.

In ether_ioctl(), do not let SIOCALIFADDR set a link-layer address
that is broadcast/multicast or equal to 00:00:00:00:00:00.

Make ether_ioctl() call ifioctl_common() to handle ioctls that it
does not understand.

In gif(4), initialize if_softc and use it, instead of assuming that
the gif_softc and ifp overlap.

Let ifioctl_common() handle SIOCGIFADDR.

Sprinkle rtcache_invariants(), which checks on DIAGNOSTIC kernels
that certain invariants on a struct route are satisfied.

In agr(4), rewrite agr_ioctl_filter() to be a bit more explicit
about the ioctls that we do not allow on an agr(4) member interface.

bzero -> memset.  Delete unnecessary casts to void *.  Use
sockaddr_in_init() and sockaddr_in6_init().  Compare pointers with
NULL instead of "testing truth".  Replace some instances of (type
*)0 with NULL.  Change some K&R prototypes to ANSI C, and join
lines.
2008-11-07 00:20:01 +00:00
pooka f455f7ee91 * use advisory file locks to avoid multiple mounts on the same device
(multiple rdonly mounts are still allowed)
* shuffle some assignments to avoid leaking resources in error branches
2008-11-07 00:18:33 +00:00
joerg 220377354c Don't use do {} while(0) for a single function call. 2008-11-07 00:15:42 +00:00
joerg ecbfc2933c Remove XXXUBC code for ffs_reallocblks, that has been conditionalized in
2002 and #if 0'ed in 2005. It would need a considerable amount of work
to bring back and obscures the more important block allocation.
2008-11-06 22:31:08 +00:00
veego a74f73830c Add missing LIBDPLIBS, found by using 'LDFLAGS += -Wl,-z,defs' and sort
src/external/mit/xorg/lib/Makefile to match the new order.
2008-11-06 22:28:25 +00:00
macallan 9263b0c23b add a couple more registers 2008-11-06 22:16:03 +00:00
macallan 61277fe87d install crmfbreg.h 2008-11-06 22:15:39 +00:00
macallan e1d1db9e9e add a couple driver names for Xorg 2008-11-06 22:13:58 +00:00
macallan 7aac9a5290 don't build DRI drivers on sgimips either 2008-11-06 22:11:47 +00:00
macallan dd39ac4627 use ppc_video.c on sgimip as well since mips_video.c is just another subset
of ppc_video.c
2008-11-06 22:10:47 +00:00
macallan 0b74872bfb add sgimips 2008-11-06 22:09:11 +00:00
macallan c67e988999 reachover for the crime driver 2008-11-06 22:08:39 +00:00
macallan 8afdb5e4f5 add Xorg bits 2008-11-06 22:00:38 +00:00
macallan 90dfb8be62 add Xorg stuff 2008-11-06 21:58:28 +00:00
christos 125a3d7f1f fix diagassert arg. 2008-11-06 19:59:42 +00:00
wiz e896af94f7 ext2 -> Ext2, to match newfs_ext2fs. 2008-11-06 19:40:03 +00:00
cegger 4b9b87ae5b Link cpus in the order they are attaching and not in inverse order. 2008-11-06 19:29:46 +00:00
wiz 55bab24118 Spelling fixes. 2008-11-06 17:51:39 +00:00
cegger 1f7782b4ba wrap lines. no functional change. 2008-11-06 17:50:59 +00:00
wiz e68e7dcd1f Use Nx instead of NetBSD; spell "ext2" with lower case 'e', per Wikipedia. 2008-11-06 17:48:33 +00:00
abs 96dc40fee6 Add the following note to README:
Please commit changes to 'GENERIC.in' and other source files *first*, then
 run 'makeconf' and commit the generated files to ensure the 'Created from:'
 tags are correct.

Then follow it. Noted by tsutsui@
2008-11-06 17:12:20 +00:00
rmind 9d3a4ed2de cpuctl_ioctl: use cpu_index(), instead of cpuid.
Fixes cpuctl(8) on some processors.
2008-11-06 16:48:51 +00:00
tsutsui d13d5beaba Comment out nonexistent crash(8) xref. 2008-11-06 16:23:56 +00:00
tsutsui 4a22671764 - misc updates and fixes to sync with reality:
- boot loader prompt
 - netboot with the NetBSD boot loader
 - banner on LCD
- add some Xrefs
2008-11-06 16:20:55 +00:00
apb 88ba92672f * Instead of silently ignoring extra args, print a usage error. This
adddresses the silent failure reported in PR 39862 by Brian A. Seklecki
* Adjust usage message to match the synopsis in the man page.
2008-11-06 16:01:54 +00:00
apb 046bb95d46 Adjust synopsis and description to make it clear that -d devname and
-t devtype are mutually exclusive.
2008-11-06 15:58:16 +00:00
christos 5f123c574b make the eula acceptance permanent by adding it to sysctl.conf. From Anon Ymous 2008-11-06 15:30:23 +00:00
vanhu 33dafe234f fixed delsainfo() to avoid a crash when iddst's value is SAINFO_CLIENTADDR 2008-11-06 14:12:28 +00:00
nakayama 531d468612 Redo rev.1.13. We must refer to CURBRK via GOT in case of PIC. 2008-11-06 13:42:55 +00:00
blymn 3286a94bad Move init of essid to the attach code. 2008-11-06 12:03:43 +00:00
wiz 70006e12db Fix /usr/lib/libgcov_g.a entry (second keyword was missing). 2008-11-06 11:03:00 +00:00
darrenr 552614e264 38456 ipf mostly ignores locking in NetBSD 2008-11-06 09:51:57 +00:00
darrenr 60886a044c 38456 ipf mostly ignores locking in NetBSD
...plus some cleanup of fastroute code.
2008-11-06 09:49:59 +00:00
mrg ac1ceac37d pull across the fix from my master bozohttpd cvs tree for PR 38466. 2008-11-06 06:38:43 +00:00
dyoung 41215a0ab5 Use DVUNIT_ANY instead of the anonymous constant -1. 2008-11-06 03:40:04 +00:00
dyoung 44a13e6f88 Cosmetic: change (type *)0 to NULL. 2008-11-06 03:34:37 +00:00
dyoung 0703ab0f27 Fix typo: IEEE80211_DUR_DIFS -> IEEE80211_DUR_DS_DIFS. 2008-11-06 03:28:59 +00:00
dyoung 5c0c1b5199 Use NULL instead of (bus_dma_tag_t)0. 2008-11-06 01:17:24 +00:00
dyoung 557e8919c2 Compute tags over the ACPI sources. 2008-11-06 00:41:52 +00:00
abs 09149f66a7 Add a note that SERCONSOLE breaks on the Falcon, and remove from
FALCON config.
2008-11-05 23:55:06 +00:00
christos faa758fa9c add a primitive "accept the license" for ipw and iwi. XXX: Needs translations. 2008-11-05 22:58:37 +00:00
christos 9fd1d5af01 PR/11317: Hubert Feyrer: Recognize mismatched parentheses inside old style
command substitution.
2008-11-05 22:04:43 +00:00
bouyer b9e39927ac evtchn_do_event(): in our C implementation of spllower(), if a handler fails
to restore the spl (shouldn't happen, but ...), we could end up with a
higther pending ipl set and never cleared because iplbit already
handled this level. while (iplmask != 0) {} would then never be true,
and we'd end up triggering KASSERT(iplbit != 0).
Now print the faultly handler and reset the IPL, and start the whole
pending IPL handling again if needed.
2008-11-05 21:04:05 +00:00
cube b4ecd0fe82 Add necessary defines. Noted by Bernd Ernesti. 2008-11-05 19:50:06 +00:00
hannken a797621996 fss_bs_thread: initialize b_error and b_resid.
Before it was possible for fss reads to return bogus b_resid values
leading to "delta > 0" panics from physio().
2008-11-05 19:30:57 +00:00
bjs 172fcb442e Add missing debuglib entries for libz_g.a, libp2k_g.a, libpuffs_g.a,
librefuse_g.a, libgcov_g.a, and libcrypto_{rc5,mdc2,idea}_g.a.
2008-11-05 18:23:32 +00:00
blymn 57e1492b11 * Disable aborting the scan for the moment - it causes a firmware error if
a scan was never initiated which breaks WEP and open wireless connections
* Make sure the ESSID is cleared.
2008-11-05 09:42:20 +00:00
elad fb62056e51 Don't build kernel modules with PIE.
Discussed with and okay christos@.
2008-11-05 00:54:25 +00:00
dbj 930ff683e1 pass HOST_CFLAGS when building cross tools 2008-11-04 23:58:40 +00:00
dbj 9e00aa9431 include unistd.h where getmode is traditionally declared 2008-11-04 23:31:32 +00:00