Sam Leffler [Thu, 14 Nov 2002 23:43:16 +0000 (23:43 +0000)]
o eliminate separate callback interface for h/w tagged input packets; instead
drivers "tag packets" with an m_tag and the input packet handling recognizes
such packets and does the right thing
o track the number of active vlans on an interface; this lets lots of places
only do vlan-specific processing when needed
o track changes to ether_ifdetach/ether_ifattach
o track bpf changes
o eliminate the use of M_PROTO1 for communicating to drivers about tagged
packets
o eliminate the use of IFF_LINK0 for drivers communicating to the vlan code
that they support h/w tagging; replaced by explicit interface capabilities
o add ifnet capabilities for h/w tagging and support of "large mtu's"
o use new interface capabilities to auto-configure use of large mtu's and h/w
tagging
o add support for proper handling of promiscuous mode
o document driver/vlan communication conventions
Sam Leffler [Thu, 14 Nov 2002 23:36:28 +0000 (23:36 +0000)]
o add if_nvlans member to track the number of vlans active on an interface
o add if_input member for interface drivers to call through to pass packets "up"
o remove ethernet-specific function decls (moved to ethernet.h)
Sam Leffler [Thu, 14 Nov 2002 23:35:06 +0000 (23:35 +0000)]
o change input packet handling to eliminate the pointer to the struct
ether_header; instead drivers are to leave the Ethernet header at the
front of the packet
o add declarations for netgraph and vlan hooks that were removed from ethernet.h
o change various in-file calling conventions to track change in input API
o fixup bridge support to handle Ethernet header no longer being stripped
o add consistency checks to ether_input to catch problems with the change
in the API; some of these may want to be moved to #ifdef DIAGNOSTIC at a
later time (though they are not too expensive to leave as is)
o change ether_demux to eliminate the passing of the Ethernet header; it is
now expected at the front of the packet a la ether_input
o add ether_sprintf compatibility shim
o change ether_ifattach API to remove "bpf supported param" and add a pointer
to the MAC address to be installed for the LL address (this is for future
changes to divest struct arpcom from struct ifnet)
o change ether_ifdetach API to remove "bpf support param"
Sam Leffler [Thu, 14 Nov 2002 23:28:47 +0000 (23:28 +0000)]
general cleanups mostly aimed at improving portability of drivers
o ETHER_* (ETHER_ALIGN, ETHER_MAX_FRAME, ETHER_CRC_LEN, etc.)
o M_HASFCS for drivers to indicate packets include FCS
o remove global declarations for ng_ether* and vlan_* since these
represent a private contract between the if_ethersubr.c code and
certain parts of the system that should not normally be abused
o add ether_* declarations that were elsewhere
o remove ETHER_BPF_* since they are no longer used with the parameter
no longer passed to ether_ifattach and ether_ifdetach
Sam Leffler [Thu, 14 Nov 2002 23:24:13 +0000 (23:24 +0000)]
o add support for multiple link types per interface (e.g. 802.11 and Ethernet)
o introduce BPF_TAP and BPF_MTAP macros to hide implementation details and
ease code portability
o use m_getcl where appropriate
Reviewed by: many
Approved by: re
Obtained from: NetBSD (multiple link type support)
Robert Drehmel [Thu, 14 Nov 2002 17:06:01 +0000 (17:06 +0000)]
Define `Sudden_Underflow' when compiling for the Alpha
architecture, mainly to avoid getting a SIGFPE signal sent
when calling strtod(3) with certain input.
The SIGFPE has been sent because the code was not aware that
a Gradual Underflow is handled in software via traps on the
Alpha architecture, but is not implemented in our Alpha kernel
layer.
With `Sudden_Underflow' defined, strtod(3) should not depend
on Gradual Underflow and adjust its calculations accordingly,
which means that other, more subtle errors than the sending of
SIGFPE could be solved by this.
Thomas Moestl [Thu, 14 Nov 2002 16:11:12 +0000 (16:11 +0000)]
Make the msg_size, msg_bufx and msg_bufr memebers of struct msgbuf
signed, since they describe a ring buffer and signed arithmetic is
performed on them. This avoids some evilish casts.
Since this changes all but two members of this structure, style(9)
those remaining ones, too.
Warner Losh [Thu, 14 Nov 2002 14:06:14 +0000 (14:06 +0000)]
bde points out that the LIBC_MAJOR macro doesn't exist and requests
that we not use it here. In its place I've put a comment about the
current state of play.
Ruslan Ermilov [Thu, 14 Nov 2002 12:40:14 +0000 (12:40 +0000)]
Reset LogTag to NULL in closelog(3). This fixes mysterious crashes
caused by dynamic PAM modules that call openlog(3) and closelog(3),
e.g. ports/security/pam_pwdfile.
What happened here is that the module first registered its "ident"
with openlog(3), then PAM library unloaded module with dlclose(3),
and the next call to syslog(3) resulted in SIGSEGV.
Maxim Sobolev [Thu, 14 Nov 2002 08:43:07 +0000 (08:43 +0000)]
Add a new newsyslog.conf flag - 'G', which if set tells newsyslog(8) that
the specified filename of the log to be rotated is in fact shell glob
pattern. In this case, all files matching this pattern will be rotated
using the same options. Useful in the case when there is no pre-defined
name for the logfiles (e.g. xtradius, samba etc).
Marcel Moolenaar [Thu, 14 Nov 2002 06:40:23 +0000 (06:40 +0000)]
o Fix _longjmp() to return 1 when the return value is given as 0.
o Remove the unwanted smartness in _longjmp() where it compares
the current ar.bspstore with the saved ar.bspstore and restores
ar.rnat based on it. This either avoids saving ar.rnat in the
jmp_buf or is the consequence of not saving ar.rnat. All this
complexity breaks libc_r where we use longjmp() to switch to
different threads and the current ar.bspstore has no relation
to the saved ar.bspstore. Thus: we save ar.rnat in setjmp()
and simply restore ar.bspstore and ar.rnat in longjmp().
David Xu [Thu, 14 Nov 2002 06:06:45 +0000 (06:06 +0000)]
In kse_release(), check if current thread is bound
and current kse mailbox was already initialized, also
prevent last thread from exiting unless we figure out
how to safely support null thread proc.
Warner Losh [Thu, 14 Nov 2002 05:15:50 +0000 (05:15 +0000)]
MFp4:
o Use 32-bit unsigned types for things that really are 32-bit quantities,
not bus_addr_t. These are not the same as a bus_addr_t, so don't use
that here. Harmless on i386, introduced problems on sparc64.
Marcel Moolenaar [Thu, 14 Nov 2002 01:46:20 +0000 (01:46 +0000)]
Add conditional code specific to ia64 to allow newfs(8)-ing FAT
partitions marked as being of type efi. This change adds code to
1. actually run the newfs command at mount time (install.c),
2. display the newfs state on screen (label.c)
3. allow toggling of the newfs state (label.c)
Even though newfs(8)-ing FAT partitions can be of use on i386
machines in general, it has been opted to minimize impact for
now.
Nate Lawson [Thu, 14 Nov 2002 01:14:35 +0000 (01:14 +0000)]
Minimal take on previous commit -- remove getopt and printf. Static size
is reduced by 40k, dynamic by a few bytes.
Functional changes:
* "sleep -- arg" now returns usage() instead of ignoring the --
* "sleep -1" now returns immediately instead of returning usage()
Nate Lawson [Thu, 14 Nov 2002 00:20:58 +0000 (00:20 +0000)]
Back out previous commit since there is controversy about changing so much
in sleep including duping strtol(3). Code changes also increased
dynamic size of sleep(1).
Scott Long [Wed, 13 Nov 2002 22:53:48 +0000 (22:53 +0000)]
When parsing the CIS, if a BAR tuple is encountered, enable the corresponding
bit in the PCI command register for the device. Otherwise, device drivers
that look at this register to see which types of BARs are usable will think
that none of them are.
This allows my Adaptec 1480A cardbus card to finally work.
Daniel Eischen [Wed, 13 Nov 2002 18:12:09 +0000 (18:12 +0000)]
Use a jump table (a la Solaris) for pthread routines with default
entries in the table being stubs. While I'm here, add macros to
auto-generate the stubs. A conforming threads library can override
the stub routines by filling in the jump table.
Add some entries to namespace.h and sync un-namespace.h to it.
Also add a comment to remind folks to update un-namespace.h
when changing namespace.h.
Jacques Vidrine [Wed, 13 Nov 2002 17:46:15 +0000 (17:46 +0000)]
The pam_krb5 module stored a reference to a krb5_ccache structure as
PAM module state (created in pam_sm_authenticate and referenced later
in pam_sm_setcred and pam_sm_acct_mgmt). However, the krb5_ccache
structure shares some data members with the krb5_context structure
that was used in its creation. Since a new krb5_context is created
and destroyed at each PAM entry point, this inevitably caused the
krb5_ccache structure to reference free'd memory.
Now instead of storing a pointer to the krb5_ccache structure,
we store the name of the cache (e.g. `MEMORY:0x123CACHE') in
pam_sm_authenticate, and resolve the name in the other entry points.
This bug was uncovered by phkmalloc's free'd memory scrubbing.
Another way to accomplish this would have been to leave
`error_message' alone, but to explicitly load the Kerberos com_err
error tables. However, I don't really like the idea of a PAM module
dorking with global tables.
Robert Watson [Wed, 13 Nov 2002 15:47:09 +0000 (15:47 +0000)]
Introduce a condition variable to avoid returning EBUSY when
the MAC policy list is busy during a load or unload attempt.
We assert no locks held during the cv wait, meaning we should
be fairly deadlock-safe. Because of the cv model and busy
count, it's possible for a cv waiter waiting for exclusive
access to the policy list to be starved by active and
long-lived access control/labeling events. For now, we
accept that as a necessary tradeoff.
Maxime Henrion [Wed, 13 Nov 2002 15:14:57 +0000 (15:14 +0000)]
Add the sys/stddef.h header, so that we can have ptrdiff_t
definition in the kernel. It also includes the offsetof()
definition which, according to bde@ should be here and not
in sys/types.h, and the definition of NULL so that we're
closer to make it closer to standard C.
Maxim Konovalov [Wed, 13 Nov 2002 11:31:44 +0000 (11:31 +0000)]
Due to a memory alignment sizeof(struct ipfw_flow_id) is bigger than
ipfw_flow_id structure actual size and bcmp(3) may fail to compare
them properly. Compare members of these structures instead.
Marcel Moolenaar [Wed, 13 Nov 2002 05:39:59 +0000 (05:39 +0000)]
Also test for type efi everywhere we currently test for type fat.
With this change there's no a priori difference between EFI and
FAT partitions. With this change and the corresponding change to
libdisk, we can create EFI partitions, just like regular FAT
partitions.
Alan Cox [Wed, 13 Nov 2002 05:39:58 +0000 (05:39 +0000)]
Move pmap_collect() out of the machine-dependent code, rename it
to reflect its new location, and add page queue and flag locking.
Notes: (1) alpha, i386, and ia64 had identical implementations
of pmap_collect() in terms of machine-independent interfaces;
(2) sparc64 doesn't require it; (3) powerpc had it as a TODO.
Marcel Moolenaar [Wed, 13 Nov 2002 05:31:32 +0000 (05:31 +0000)]
Handle EFI partitions the same as regular FAT partitions. The only
difference between the two from a low-level point of view is that
the partition type is different. This change adds EFI related cases
to existing switch statements with existing FAT related cases.
Robert Watson [Tue, 12 Nov 2002 22:30:01 +0000 (22:30 +0000)]
Add LOGIN_SETMAC to the list of flags that can't be set without class
information, since we rely on the pwd entry to know what MAC labels
to set as part of the login process.
Peter Wemm [Tue, 12 Nov 2002 21:18:21 +0000 (21:18 +0000)]
Fix a "bug" in sysctl(8). Limit the length when we print a string from
the kernel rather than ignoring the length and keeping on going till we
finally hit a \0 character in the buffer.
John Baldwin [Tue, 12 Nov 2002 21:12:42 +0000 (21:12 +0000)]
Remove a line that set the status to success. We already do that at the
beginning, so the best this could achieve would be to mask an earlier
failure. Break instead of continue for another failure case.
John Baldwin [Tue, 12 Nov 2002 21:09:58 +0000 (21:09 +0000)]
Try to cleanup the non-interactive disk labeling code a bit. Rework
the loop that runs through the environment variables to be a bit more
intuitive. Also, change some 'continue's in failure cases to 'break's
instead. If we are going to fail, we should just do it.
PR: bin/40654
Submitted by: Thomas Zenker <thz@Lennartz-electronic.de> (partially)
John Baldwin [Tue, 12 Nov 2002 20:48:49 +0000 (20:48 +0000)]
Do a bit of cleanup. new_part() basically ignored the passed in size
argument as of revision 1.52 (July 12, 1996, about a month after I
graduated from high school) when 'newfs -u' support was axed, so remove it.
This also allows us to remove a hack in the create partition case where we
created the partition twice since we didn't have the size the first time.