The NetBSD Project

CVS log for src/sys/net/if_ethersubr.c

[BACK] Up to [cvs.NetBSD.org] / src / sys / net

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.323 / (download) - annotate - [select for diffs], Tue Nov 15 10:47:39 2022 UTC (2 months, 3 weeks ago) by roy
Branch: MAIN
CVS Tags: netbsd-10-base, netbsd-10, HEAD
Changes since 1.322: +15 -2 lines
Diff to previous 1.322 (colored)

arp: Validate ARP source hardware address matches Ethernet source

RFC 5227 section 1.1 states that for a DaD ARP probe the sender hardware
address must match the hardware address of the interface sending the
packet.

We can now verify this by checking the mbuf tag PACKET_TAG_ETHERNET_SRC.

This fixes an obsure issue where an old router was sending out bogus
ARP probes.

Thanks to Ryo Shimizu <ryo@nerv.org> for the re-implementation.

Revision 1.322 / (download) - annotate - [select for diffs], Tue Nov 15 09:14:28 2022 UTC (2 months, 3 weeks ago) by roy
Branch: MAIN
Changes since 1.321: +2 -6 lines
Diff to previous 1.321 (colored)

Revert prior.

Revision 1.321 / (download) - annotate - [select for diffs], Mon Nov 14 09:23:42 2022 UTC (2 months, 3 weeks ago) by roy
Branch: MAIN
Changes since 1.320: +6 -2 lines
Diff to previous 1.320 (colored)

net: Store a pointer to the Layer 2 Sender Hardware address in mbuf

The BSD networking stack is designed around passing a mbuf down the chain
and each layer removes the part it's interested in before passing it to
the next. This makes it easy for each layer to do it's work,
but non trivial to work backwards.

As such we now store a pointer to the Senders Hardware address in the
mbuf packet header so that protocols can perform any required validation.

Revision 1.242.6.10 / (download) - annotate - [select for diffs], Mon Oct 10 16:09:12 2022 UTC (3 months, 3 weeks ago) by martin
Branch: netbsd-8
Changes since 1.242.6.9: +8 -6 lines
Diff to previous 1.242.6.9 (colored) to branchpoint 1.242 (colored) next main 1.243 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #1770):

	sys/net/if_ethersubr.c: revision 1.254

Fix a bug in the VLAN path: there's an inverted logic, the mbuf needs to
be bigger than struct ether_vlan_header, not smaller.

Meanwhile add a KASSERT in the LLC path.

Revision 1.320 / (download) - annotate - [select for diffs], Sat Sep 3 02:47:59 2022 UTC (5 months ago) by thorpej
Branch: MAIN
CVS Tags: bouyer-sunxi-drm-base, bouyer-sunxi-drm
Changes since 1.319: +2 -3 lines
Diff to previous 1.319 (colored)

Garbage-collect the remaining vestiges of netisr.

Revision 1.319 / (download) - annotate - [select for diffs], Sat Sep 3 02:24:59 2022 UTC (5 months ago) by thorpej
Branch: MAIN
Changes since 1.318: +7 -19 lines
Diff to previous 1.318 (colored)

Convert MPLS from a legacy netisr to pktqueue.

Revision 1.318 / (download) - annotate - [select for diffs], Sat Sep 3 01:48:22 2022 UTC (5 months ago) by thorpej
Branch: MAIN
Changes since 1.317: +9 -10 lines
Diff to previous 1.317 (colored)

Convert NETATALK from a legacy netisr to pktqueue.

Revision 1.317 / (download) - annotate - [select for diffs], Sat Sep 3 01:35:03 2022 UTC (5 months ago) by thorpej
Branch: MAIN
Changes since 1.316: +3 -4 lines
Diff to previous 1.316 (colored)

Convert ARP from a legacy netisr to pktqueue.

Revision 1.316 / (download) - annotate - [select for diffs], Sat Sep 3 00:31:02 2022 UTC (5 months ago) by thorpej
Branch: MAIN
Changes since 1.315: +8 -3 lines
Diff to previous 1.315 (colored)

Only use configured RPS hash functions for IPv4 and IPv6 packets.

This is NFC change now because only IPv4 and IPv6 use pktqueue,
but that will change in future commits.

Revision 1.315 / (download) - annotate - [select for diffs], Mon Jun 20 12:22:00 2022 UTC (7 months, 2 weeks ago) by martin
Branch: MAIN
Changes since 1.314: +4 -2 lines
Diff to previous 1.314 (colored)

Avoid unused variable

Revision 1.314 / (download) - annotate - [select for diffs], Mon Jun 20 08:20:09 2022 UTC (7 months, 2 weeks ago) by yamaguchi
Branch: MAIN
Changes since 1.313: +34 -2 lines
Diff to previous 1.313 (colored)

 bpf(4): added support for VLAN hardware offloading of ethernet devices

Revision 1.313 / (download) - annotate - [select for diffs], Mon Jun 20 08:14:48 2022 UTC (7 months, 2 weeks ago) by yamaguchi
Branch: MAIN
Changes since 1.312: +118 -17 lines
Diff to previous 1.312 (colored)

bridge(4): support VLAN frames stripped by hardware tagging

Revision 1.312 / (download) - annotate - [select for diffs], Mon Jun 20 08:02:25 2022 UTC (7 months, 2 weeks ago) by yamaguchi
Branch: MAIN
Changes since 1.311: +55 -55 lines
Diff to previous 1.311 (colored)

Handling frames that vlan id is 0 as non-VLAN frames
even if a vlan tag is stripped by harware offloading

Revision 1.311 / (download) - annotate - [select for diffs], Mon Apr 4 06:10:00 2022 UTC (10 months ago) by yamaguchi
Branch: MAIN
Changes since 1.310: +5 -26 lines
Diff to previous 1.310 (colored)

Move input processing of lagg(4) before ether_input
to get rid of dependence.

This implementation is similar with that of bridge(4).

Revision 1.310 / (download) - annotate - [select for diffs], Fri Dec 31 14:26:09 2021 UTC (13 months ago) by riastradh
Branch: MAIN
Changes since 1.309: +4 -2 lines
Diff to previous 1.309 (colored)

ethersubr(9): Assert IFNET_LOCKED in ether_ioctl_reinit.

Changes to if_flags are nontrivial configuration changes that require
the long-term ioctl lock.

Revision 1.309 / (download) - annotate - [select for diffs], Fri Dec 31 14:25:24 2021 UTC (13 months ago) by riastradh
Branch: MAIN
Changes since 1.308: +7 -7 lines
Diff to previous 1.308 (colored)

sys: Use if_init wrapper function.

Exception: Not in kern_pmf.c, for the kind of silly reason that it
avoids having kern_pmf.c refer to symbols defined only in net; this
avoids a pain in the rump.

Revision 1.308 / (download) - annotate - [select for diffs], Fri Dec 31 14:24:38 2021 UTC (13 months ago) by riastradh
Branch: MAIN
Changes since 1.307: +3 -3 lines
Diff to previous 1.307 (colored)

sys: Use if_stop wrapper function.

Exception: Not in kern_pmf.c, for the kind of silly reason that it
avoids having kern_pmf.c refer to symbols defined only in net; this
avoids a pain in the rump.

Revision 1.307 / (download) - annotate - [select for diffs], Fri Dec 10 01:18:29 2021 UTC (13 months, 3 weeks ago) by msaitoh
Branch: MAIN
Changes since 1.306: +3 -2 lines
Diff to previous 1.306 (colored)

Add comment to clarify.

Revision 1.306 / (download) - annotate - [select for diffs], Tue Nov 30 01:17:02 2021 UTC (14 months ago) by yamaguchi
Branch: MAIN
Changes since 1.305: +3 -3 lines
Diff to previous 1.305 (colored)

Move net/agr/ieee8023_slowprotocols.h to net/ether_slowprotocols.h

Definitions related to slowprotocols are duplicated between
agr/ieee8023ad_slowprotocols.h and lagg/if_lagg_lacp.h
Therefore, the contents are moved to added file.

Note: currently, there are just LACP and Marker protocol,
however slowprotocols is independent of them.

Revision 1.305 / (download) - annotate - [select for diffs], Thu Nov 25 00:49:34 2021 UTC (14 months, 1 week ago) by msaitoh
Branch: MAIN
Changes since 1.304: +25 -17 lines
Diff to previous 1.304 (colored)

Better counting for ierrors, iqdrops and noproto in ether_input().

 - Use if_noproto for unknown or unsupported protocols.
 - Use if_ierrors for wrong mbuf or oversized frame.

Revision 1.304 / (download) - annotate - [select for diffs], Mon Nov 15 07:07:05 2021 UTC (14 months, 3 weeks ago) by yamaguchi
Branch: MAIN
Changes since 1.303: +100 -2 lines
Diff to previous 1.303 (colored)

introduced APIs to configure VLAN TAG to ethernet devices

Revision 1.303 / (download) - annotate - [select for diffs], Mon Nov 8 16:50:05 2021 UTC (14 months, 3 weeks ago) by christos
Branch: MAIN
Changes since 1.302: +14 -8 lines
Diff to previous 1.302 (colored)

Don't classify dropped packets that we don't understand as errors, for
example etype 0x88CA (TIPC (Transparent Inter Process Communication,)
or 0x893A (IEEE 1905).
Classify them as dropped like Linux does (FreeBSD just ignores them). From RVP.

Revision 1.242.6.9 / (download) - annotate - [select for diffs], Wed Oct 27 18:52:51 2021 UTC (15 months, 1 week ago) by martin
Branch: netbsd-8
Changes since 1.242.6.8: +3 -3 lines
Diff to previous 1.242.6.8 (colored) to branchpoint 1.242 (colored)

Fix merge mishap from previous (ticket #1704)

Revision 1.242.6.8 / (download) - annotate - [select for diffs], Mon Oct 25 18:16:07 2021 UTC (15 months, 1 week ago) by martin
Branch: netbsd-8
Changes since 1.242.6.7: +3 -3 lines
Diff to previous 1.242.6.7 (colored) to branchpoint 1.242 (colored)

Pull up following revision(s) (requested by ryo in ticket #1704):

	sys/net/if_ethersubr.c: revision 1.302

frame's vlan tag must be ntohs()'ed.

VLAN 0 Priority tag was misrecognized on non vlan-hwtagging interfaces.

Revision 1.276.2.2 / (download) - annotate - [select for diffs], Mon Oct 25 18:11:02 2021 UTC (15 months, 1 week ago) by martin
Branch: netbsd-9
CVS Tags: netbsd-9-3-RELEASE
Changes since 1.276.2.1: +3 -3 lines
Diff to previous 1.276.2.1 (colored) to branchpoint 1.276 (colored) next main 1.277 (colored)

Pull up following revision(s) (requested by ryo in ticket #1369):

	sys/net/if_ethersubr.c: revision 1.302

frame's vlan tag must be ntohs()'ed.

VLAN 0 Priority tag was misrecognized on non vlan-hwtagging interfaces.

Revision 1.302 / (download) - annotate - [select for diffs], Mon Oct 25 17:05:43 2021 UTC (15 months, 1 week ago) by ryo
Branch: MAIN
Changes since 1.301: +3 -3 lines
Diff to previous 1.301 (colored)

frame's vlan tag must be ntohs()'ed.
VLAN 0 Priority tag was misrecognized on non vlan-hwtagging interfaces.

Revision 1.301 / (download) - annotate - [select for diffs], Mon Oct 11 05:13:11 2021 UTC (15 months, 3 weeks ago) by knakahara
Branch: MAIN
Changes since 1.300: +14 -7 lines
Diff to previous 1.300 (colored)

Make pktq_rps_hash() pluggable for each interface type.  Reviewed by gdt@n.o, thorpej@n.o, and riastradh@n.o, thanks.

Revision 1.300 / (download) - annotate - [select for diffs], Thu Sep 30 04:29:16 2021 UTC (16 months ago) by yamaguchi
Branch: MAIN
Changes since 1.299: +2 -8 lines
Diff to previous 1.299 (colored)

lagg: Register lagg_ifdetach to ether_ifdetach hook

Revision 1.299 / (download) - annotate - [select for diffs], Thu Sep 30 04:13:42 2021 UTC (16 months ago) by yamaguchi
Branch: MAIN
Changes since 1.298: +2 -6 lines
Diff to previous 1.298 (colored)

vlan: Register vlan_ifdetach to ether_ifdetach hook

Revision 1.298 / (download) - annotate - [select for diffs], Thu Sep 30 03:57:48 2021 UTC (16 months ago) by yamaguchi
Branch: MAIN
Changes since 1.297: +2 -6 lines
Diff to previous 1.297 (colored)

bridge: Register bridge_ifdetach to ether_ifdetach hook

Revision 1.297 / (download) - annotate - [select for diffs], Thu Sep 30 03:54:04 2021 UTC (16 months ago) by yamaguchi
Branch: MAIN
Changes since 1.296: +41 -2 lines
Diff to previous 1.296 (colored)

Provide a hook point called when ether_ifdetach is called

Revision 1.296 / (download) - annotate - [select for diffs], Thu Sep 30 03:51:05 2021 UTC (16 months ago) by yamaguchi
Branch: MAIN
Changes since 1.295: +2 -9 lines
Diff to previous 1.295 (colored)

net: obsolete ifnet::if_link_state_chenged
that was used for updating link-state of vlan I/F

The obsoleted function is replaced with
ifnet::if_linkstate_hooks

Revision 1.295 / (download) - annotate - [select for diffs], Thu Sep 30 03:47:27 2021 UTC (16 months ago) by yamaguchi
Branch: MAIN
Changes since 1.294: +2 -7 lines
Diff to previous 1.294 (colored)

vlan: Register the callback to update link-state of vlan I/F
to link-state change hook

The callback is registered in every vlan I/F even if the parent
interface is the same. Therefore it is not needed to search the
vlan I/F by the parent interface unlike the previous callback.

Revision 1.294 / (download) - annotate - [select for diffs], Thu Sep 30 03:15:25 2021 UTC (16 months ago) by yamaguchi
Branch: MAIN
Changes since 1.293: +13 -5 lines
Diff to previous 1.293 (colored)

Replace ifnet::if_agriprivate with ifnet::if_lagg

agr(4) and lagg(4) can not be used on the same interface so that
if_agrprivate and if_lagg are not used at the same time.
For resolve this wasteful, if_lagg is used in not only lagg(4)
but also agr(4).

After this modification, if_lagg has 3 states:
1. if_lagg == NULL
   - Both agr(4) and lagg(4) are not running on the interface
2. if_lagg != NULL && ifp->if_type != IFT_IEEE8023ADLAG
   - agr(4) is running on the I/F
3. if_lagg != NULL && ifp->if_type == IFT_IEEE8023ADLAG
   - lagg(4) is running on the I/F

Revision 1.292.4.1 / (download) - annotate - [select for diffs], Thu Jun 17 04:46:35 2021 UTC (19 months, 2 weeks ago) by thorpej
Branch: thorpej-i2c-spi-conf
Changes since 1.292: +21 -2 lines
Diff to previous 1.292 (colored) next main 1.293 (colored)

Sync w/ HEAD.

Revision 1.292.6.1 / (download) - annotate - [select for diffs], Mon May 31 22:15:21 2021 UTC (20 months ago) by cjep
Branch: cjep_staticlib_x
Changes since 1.292: +21 -2 lines
Diff to previous 1.292 (colored) next main 1.293 (colored)

sync with head

Revision 1.293 / (download) - annotate - [select for diffs], Mon May 17 04:07:43 2021 UTC (20 months, 2 weeks ago) by yamaguchi
Branch: MAIN
CVS Tags: thorpej-i2c-spi-conf2-base, thorpej-i2c-spi-conf2, thorpej-i2c-spi-conf-base, thorpej-futex2-base, thorpej-futex2, thorpej-cfargs2-base, thorpej-cfargs2, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1
Changes since 1.292: +21 -2 lines
Diff to previous 1.292 (colored)

Add a new link-aggregation pseudo interface named lagg(4)

 - FreeBSD's lagg(4) based implementation
 - MP-safe and MP-scalable

Revision 1.289.2.1 / (download) - annotate - [select for diffs], Sat Apr 3 22:29:01 2021 UTC (22 months ago) by thorpej
Branch: thorpej-futex
Changes since 1.289: +11 -7 lines
Diff to previous 1.289 (colored) next main 1.290 (colored)

Sync with HEAD.

Revision 1.292 / (download) - annotate - [select for diffs], Sun Feb 14 19:35:37 2021 UTC (23 months, 2 weeks ago) by roy
Branch: MAIN
CVS Tags: thorpej-futex-base, thorpej-cfargs-base, thorpej-cfargs, cjep_staticlib_x-base
Branch point for: thorpej-i2c-spi-conf, cjep_staticlib_x
Changes since 1.291: +6 -7 lines
Diff to previous 1.291 (colored)

if_ether: revert prior alignment checks

Apparently not needed as our drivers ensure this.

Revision 1.291 / (download) - annotate - [select for diffs], Sat Feb 13 13:00:16 2021 UTC (23 months, 3 weeks ago) by roy
Branch: MAIN
Changes since 1.290: +8 -12 lines
Diff to previous 1.290 (colored)

Prior alignment fixes should not use an offset

Revision 1.290 / (download) - annotate - [select for diffs], Sat Feb 13 07:28:04 2021 UTC (23 months, 3 weeks ago) by roy
Branch: MAIN
Changes since 1.289: +14 -5 lines
Diff to previous 1.289 (colored)

if_ether: Ensure that ether_header is aligned

Revision 1.289 / (download) - annotate - [select for diffs], Sat Sep 26 18:38:09 2020 UTC (2 years, 4 months ago) by roy
Branch: MAIN
Branch point for: thorpej-futex
Changes since 1.288: +14 -2 lines
Diff to previous 1.288 (colored)

vlan: match the interface link state with that of the parent

Now addresses on a vlan will detach and undergo duplicate address
dectection on link state changes just as on a standard interface.

Revision 1.288 / (download) - annotate - [select for diffs], Fri Aug 28 06:27:49 2020 UTC (2 years, 5 months ago) by ozaki-r
Branch: MAIN
Changes since 1.287: +3 -2 lines
Diff to previous 1.287 (colored)

ether: count dropped packets on output

Revision 1.287 / (download) - annotate - [select for diffs], Fri Aug 28 06:27:16 2020 UTC (2 years, 5 months ago) by ozaki-r
Branch: MAIN
Changes since 1.286: +30 -39 lines
Diff to previous 1.286 (colored)

ether: count dropped packets on input

Revision 1.286 / (download) - annotate - [select for diffs], Fri Aug 28 06:25:52 2020 UTC (2 years, 5 months ago) by ozaki-r
Branch: MAIN
Changes since 1.285: +111 -96 lines
Diff to previous 1.285 (colored)

ether: separate handling of LLC frames as ether_input_llc (NFCI)

Revision 1.285 / (download) - annotate - [select for diffs], Fri Aug 28 06:23:42 2020 UTC (2 years, 5 months ago) by ozaki-r
Branch: MAIN
Changes since 1.284: +3 -12 lines
Diff to previous 1.284 (colored)

net: introduce IFQ_ENQUEUE_ISR to assemble packet queuing routines (NFCI)

Revision 1.284 / (download) - annotate - [select for diffs], Thu Apr 30 03:29:55 2020 UTC (2 years, 9 months ago) by riastradh
Branch: MAIN
Changes since 1.283: +5 -4 lines
Diff to previous 1.283 (colored)

Convert ether_input from rnd_initial_entropy to entropy_epoch().

Revision 1.270.2.2 / (download) - annotate - [select for diffs], Mon Apr 13 08:05:15 2020 UTC (2 years, 9 months ago) by martin
Branch: phil-wifi
Changes since 1.270.2.1: +27 -16 lines
Diff to previous 1.270.2.1 (colored) to branchpoint 1.270 (colored) next main 1.271 (colored)

Mostly merge changes from HEAD upto 20200411

Revision 1.283 / (download) - annotate - [select for diffs], Sun Mar 15 23:14:41 2020 UTC (2 years, 10 months ago) by thorpej
Branch: MAIN
CVS Tags: phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, is-mlppp-base, is-mlppp, bouyer-xenpvh-base2, bouyer-xenpvh-base1, bouyer-xenpvh-base, bouyer-xenpvh
Changes since 1.282: +4 -10 lines
Diff to previous 1.282 (colored)

Add and use a new function, mowner_init_owner(), that initializes an
MBUFTRACE mowner structure (so that providers of it don't have to
grovel the internals).

Revision 1.280.2.2 / (download) - annotate - [select for diffs], Sat Feb 29 20:21:06 2020 UTC (2 years, 11 months ago) by ad
Branch: ad-namecache
Changes since 1.280.2.1: +6 -6 lines
Diff to previous 1.280.2.1 (colored) to branchpoint 1.280 (colored) next main 1.281 (colored)

Sync with head.

Revision 1.282 / (download) - annotate - [select for diffs], Wed Jan 29 04:11:35 2020 UTC (3 years ago) by thorpej
Branch: MAIN
CVS Tags: ad-namecache-base3
Changes since 1.281: +6 -6 lines
Diff to previous 1.281 (colored)

Adopt <net/if_stats.h>.

Revision 1.280.2.1 / (download) - annotate - [select for diffs], Fri Jan 17 21:47:36 2020 UTC (3 years ago) by ad
Branch: ad-namecache
Changes since 1.280: +4 -4 lines
Diff to previous 1.280 (colored)

Sync with head.

Revision 1.281 / (download) - annotate - [select for diffs], Thu Jan 16 13:16:59 2020 UTC (3 years ago) by kardel
Branch: MAIN
CVS Tags: ad-namecache-base2, ad-namecache-base1
Changes since 1.280: +4 -4 lines
Diff to previous 1.280 (colored)

use the CARP interface for arp/nd instead of the carp parent interface.
this provides the correct source mac address for the packets.

there are routers out there that cache the source mac during
nd and then subsequently bypass/miss packet filters on carp
interfaces as they send to the parent interface mac instead of the
correct carp interface mac.

Revision 1.280 / (download) - annotate - [select for diffs], Wed Oct 16 18:29:49 2019 UTC (3 years, 3 months ago) by christos
Branch: MAIN
CVS Tags: phil-wifi-20191119, ad-namecache-base
Branch point for: ad-namecache
Changes since 1.279: +4 -3 lines
Diff to previous 1.279 (colored)

Add and use __FPTRCAST, requested by uwe@

Revision 1.279 / (download) - annotate - [select for diffs], Wed Oct 16 15:27:39 2019 UTC (3 years, 3 months ago) by christos
Branch: MAIN
Changes since 1.278: +3 -3 lines
Diff to previous 1.278 (colored)

Add void * function pointer casts. There are different ways to "fix" those
warnings:
    1. this one: add a void * cast (which I think is the least intrusive)
    2. add pragmas to elide the warning
    3. add intermediate inline conversion functions
    4. change the called function prototypes, adding unused arguments and
       converting some of the pointer arguments to void *.
    5. make the functions varyadic (which defeats the purpose of checking)
    6. pass command line flags to elide the warning
I did try 3 and 4 and I was not pleased with the result (sys_ptrace_common.c)
(3) added too much code and defines, and (4) made the regular use clumsy.

Revision 1.242.6.7 / (download) - annotate - [select for diffs], Tue Oct 8 18:12:44 2019 UTC (3 years, 3 months ago) by martin
Branch: netbsd-8
CVS Tags: netbsd-8-2-RELEASE
Changes since 1.242.6.6: +3 -2 lines
Diff to previous 1.242.6.6 (colored) to branchpoint 1.242 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #1402):

	sys/net/if_ethersubr.c: revision 1.277

Increment if_iqdrops when dropping an oversized frame.

Revision 1.242.6.6 / (download) - annotate - [select for diffs], Tue Oct 8 18:09:41 2019 UTC (3 years, 3 months ago) by martin
Branch: netbsd-8
Changes since 1.242.6.5: +16 -9 lines
Diff to previous 1.242.6.5 (colored) to branchpoint 1.242 (colored)

Pull up following revision(s) (requested by ozaki-r in ticket #1401):

	sys/net/if_ethersubr.c: revision 1.255

Fix two bugs in altq_etherclassify. When scanning the mbuf chain we need
to make sure that m_next is not NULL, otherwise NULL deref. After that,
we must not touch m->m_pkthdr, given that 'm' may not be the first mbuf
of the chain anymore.

Declare mtop, and add a KASSERT to make sure it has M_PKTHDR set.

Revision 1.276.2.1 / (download) - annotate - [select for diffs], Tue Oct 8 17:02:24 2019 UTC (3 years, 3 months ago) by martin
Branch: netbsd-9
CVS Tags: netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1
Changes since 1.276: +9 -2 lines
Diff to previous 1.276 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #292):

	sys/net/if_ethersubr.c: revision 1.277
	sys/net/if_ethersubr.c: revision 1.278

Increment if_iqdrops when dropping an oversized frame.

 -

Print oversized frame's message only when DIAGNOSTIC is set. The message
is not so important because we increment if_iqdrops now.

Revision 1.278 / (download) - annotate - [select for diffs], Wed Oct 2 04:17:16 2019 UTC (3 years, 4 months ago) by msaitoh
Branch: MAIN
Changes since 1.277: +8 -2 lines
Diff to previous 1.277 (colored)

 Print oversized frame's message only when DIAGNOSTIC is set. The message
is not so important because we increment if_iqdrops now.

Revision 1.277 / (download) - annotate - [select for diffs], Tue Oct 1 08:13:16 2019 UTC (3 years, 4 months ago) by msaitoh
Branch: MAIN
Changes since 1.276: +3 -2 lines
Diff to previous 1.276 (colored)

 Increment if_iqdrops when dropping an oversized frame.

Revision 1.276 / (download) - annotate - [select for diffs], Wed Jul 17 03:26:24 2019 UTC (3 years, 6 months ago) by msaitoh
Branch: MAIN
CVS Tags: netbsd-9-base
Branch point for: netbsd-9
Changes since 1.275: +11 -2 lines
Diff to previous 1.275 (colored)

 Implement VLAN hardware filter function(ETHERCAP_VLAN_HWFILTER).
First proposed by jmcneill in 2017 and modified by me.

How to use:

 - Set callback function:

	ether_set_vlan_cb(struct ethercom *, ether_vlancb_t)

 - Callback. This function is called when a vlan is attached/detached to the
   parent interface:

	int (*ether_vlancb_t)(struct ethercom *ec, uint16_t vlanid, bool set);

 - ifconfig(8)

	ifconfig ixg0 [-]vlan-hwfilter

 Note that ETHERCAP_VLAN_HWFILTER is set by default on ixg(4) because
the PF driver usually enable "all block" filter by default.

Revision 1.270.2.1 / (download) - annotate - [select for diffs], Mon Jun 10 22:09:45 2019 UTC (3 years, 7 months ago) by christos
Branch: phil-wifi
Changes since 1.270: +76 -40 lines
Diff to previous 1.270 (colored)

Sync with HEAD

Revision 1.275 / (download) - annotate - [select for diffs], Wed May 29 10:07:30 2019 UTC (3 years, 8 months ago) by msaitoh
Branch: MAIN
CVS Tags: phil-wifi-20190609
Changes since 1.274: +9 -4 lines
Diff to previous 1.274 (colored)

Even if we don't use MII(4), use the common path of SIOC[GS]IFMEDIA in
sys/net/if_ethersubr.c if we can.
 - Add ec_ifmedia into struct ethercom.
 - ec_mii in struct ethercom is kept and used as it is. It might be used in
   future. Note that some Ethernet drivers which _DOESN'T_ use mii(4) use
   ec_mii for keeping the if_media. Those should be changed in future.

Revision 1.274 / (download) - annotate - [select for diffs], Wed May 15 02:56:48 2019 UTC (3 years, 8 months ago) by ozaki-r
Branch: MAIN
Changes since 1.273: +11 -2 lines
Diff to previous 1.273 (colored)

Store IFF_ALLMULTI in ec_flags instead of if_flags to avoid data races

IFF_ALLMULTI is set/unset to if_flags via if_mcast_op.  To avoid data races on
if_flags, IFNET_LOCK was added for if_mcast_op.  Unfortunately it produces
a deadlock so we want to remove added IFNET_LOCK by avoiding the data races by
another approach.

This fix introduces ec_flags to struct ethercom and stores IFF_ALLMULTI to it.
ec_flags is protected by ETHER_LOCK and thus IFNET_LOCK is no longer necessary
for if_mcast_op.  Note that the fix is applied only to MP-safe drivers that
the data races matter.

In the kernel, IFF_ALLMULTI is set by a driver and used by the driver itself.
So changing the storing place doesn't break anything.  One exception is
ioctl(SIOCGIFFLAGS); we have to include IFF_ALLMULTI in a result if needed to
export the flag as well as before.

A upcoming commit will remove IFNET_LOCK.

PR kern/54189

Revision 1.273 / (download) - annotate - [select for diffs], Mon Feb 4 10:11:34 2019 UTC (4 years ago) by mrg
Branch: MAIN
CVS Tags: isaki-audio2-base, isaki-audio2
Changes since 1.272: +3 -4 lines
Diff to previous 1.272 (colored)

add or adjust fallthru comments.

Revision 1.260.2.6 / (download) - annotate - [select for diffs], Wed Dec 26 14:02:04 2018 UTC (4 years, 1 month ago) by pgoyette
Branch: pgoyette-compat
CVS Tags: pgoyette-compat-merge-20190127
Changes since 1.260.2.5: +59 -36 lines
Diff to previous 1.260.2.5 (colored) to branchpoint 1.260 (colored) next main 1.261 (colored)

Sync with HEAD, resolve a few conflicts

Revision 1.272 / (download) - annotate - [select for diffs], Fri Dec 21 08:58:08 2018 UTC (4 years, 1 month ago) by msaitoh
Branch: MAIN
CVS Tags: pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226
Changes since 1.271: +59 -36 lines
Diff to previous 1.271 (colored)

 Add SIOCSETHERCAP. It's used to change ec_capenable.

Revision 1.260.2.5 / (download) - annotate - [select for diffs], Mon Nov 26 01:52:50 2018 UTC (4 years, 2 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.260.2.4: +3 -3 lines
Diff to previous 1.260.2.4 (colored) to branchpoint 1.260 (colored)

Sync with HEAD, resolve a couple of conflicts

Revision 1.271 / (download) - annotate - [select for diffs], Thu Nov 15 10:23:56 2018 UTC (4 years, 2 months ago) by maxv
Branch: MAIN
CVS Tags: pgoyette-compat-1126
Changes since 1.270: +3 -3 lines
Diff to previous 1.270 (colored)

Remove the 't' argument from m_tag_find().

Revision 1.260.2.4 / (download) - annotate - [select for diffs], Mon Jun 25 07:26:06 2018 UTC (4 years, 7 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.260.2.3: +10 -10 lines
Diff to previous 1.260.2.3 (colored) to branchpoint 1.260 (colored)

Sync with HEAD

Revision 1.270 / (download) - annotate - [select for diffs], Thu Jun 14 07:54:57 2018 UTC (4 years, 7 months ago) by yamaguchi
Branch: MAIN
CVS Tags: phil-wifi-base, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625
Branch point for: phil-wifi
Changes since 1.269: +4 -4 lines
Diff to previous 1.269 (colored)

Use ether_lookup_multi() instead of the macro

ok ozaki-r@

Revision 1.269 / (download) - annotate - [select for diffs], Tue Jun 12 07:12:35 2018 UTC (4 years, 7 months ago) by ozaki-r
Branch: MAIN
Changes since 1.268: +3 -2 lines
Diff to previous 1.268 (colored)

Check if ether_ifdetach is called without INET_LOCK

Revision 1.268 / (download) - annotate - [select for diffs], Tue May 29 16:24:34 2018 UTC (4 years, 8 months ago) by maxv
Branch: MAIN
Changes since 1.267: +2 -7 lines
Diff to previous 1.267 (colored)

Remove an XXX of mine, actually it's fine. While here also remove a
misleading printf.

Revision 1.267 / (download) - annotate - [select for diffs], Tue May 29 08:24:59 2018 UTC (4 years, 8 months ago) by maxv
Branch: MAIN
Changes since 1.266: +7 -3 lines
Diff to previous 1.266 (colored)

Replace KASSERT by m_pullup. While the ethernet header is always there
when the packet was received on a physical interface, it may not be if
the packet was received over L2TP/EtherIP.

In particular, if the inner ethernet header ends up on two separate IP
fragments. Here the KASSERT is triggered, and on !DIAGNOSTIC we corrupt
memory.

Note that this is a widespread problem: a lot of L2 code was written with
the assumption that "most" headers are present in the first mbuf.
Obviously, that's not true if L2 encapsulation is being used.

Revision 1.260.2.3 / (download) - annotate - [select for diffs], Mon May 21 04:36:15 2018 UTC (4 years, 8 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.260.2.2: +3 -3 lines
Diff to previous 1.260.2.2 (colored) to branchpoint 1.260 (colored)

Sync with HEAD

Revision 1.266 / (download) - annotate - [select for diffs], Wed May 9 06:35:10 2018 UTC (4 years, 8 months ago) by maxv
Branch: MAIN
CVS Tags: pgoyette-compat-0521
Changes since 1.265: +3 -3 lines
Diff to previous 1.265 (colored)

Replace
	m_copym(m, 0, M_COPYALL, M_DONTWAIT)
by
	m_copypacket(m, M_DONTWAIT)
when it is clear that we are copying a packet (that has M_PKTHDR) and not
a raw mbuf chain.

Revision 1.260.2.2 / (download) - annotate - [select for diffs], Wed May 2 07:20:22 2018 UTC (4 years, 9 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.260.2.1: +6 -6 lines
Diff to previous 1.260.2.1 (colored) to branchpoint 1.260 (colored)

Synch with HEAD

Revision 1.265 / (download) - annotate - [select for diffs], Sun Apr 29 07:13:10 2018 UTC (4 years, 9 months ago) by maxv
Branch: MAIN
CVS Tags: pgoyette-compat-0502
Changes since 1.264: +5 -5 lines
Diff to previous 1.264 (colored)

Remove references to m_copy in comments.

Revision 1.264 / (download) - annotate - [select for diffs], Thu Apr 26 19:56:55 2018 UTC (4 years, 9 months ago) by maxv
Branch: MAIN
Changes since 1.263: +3 -3 lines
Diff to previous 1.263 (colored)

m_copy -> m_copym

Revision 1.260.2.1 / (download) - annotate - [select for diffs], Mon Apr 16 02:00:08 2018 UTC (4 years, 9 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.260: +37 -32 lines
Diff to previous 1.260 (colored)

Sync with HEAD, resolve some conflicts

Revision 1.263 / (download) - annotate - [select for diffs], Mon Apr 9 16:14:11 2018 UTC (4 years, 9 months ago) by maxv
Branch: MAIN
CVS Tags: pgoyette-compat-0422, pgoyette-compat-0415
Changes since 1.262: +6 -4 lines
Diff to previous 1.262 (colored)

Replace KASSERTMSG by a real check. L2 encapsulation protocols (at least
L2TP) don't ensure the LLC is there, and in !DIAGNOSTIC configurations
m_copydata will crash. Tested with L2TP.

Revision 1.262 / (download) - annotate - [select for diffs], Mon Apr 9 11:35:22 2018 UTC (4 years, 9 months ago) by maxv
Branch: MAIN
Changes since 1.261: +3 -2 lines
Diff to previous 1.261 (colored)

Add KASSERT. The input point expects struct ether_header to be there.

Now, I'm wondering whether it can be triggered by L2 encapsulation
protocols - they may not provide a contiguous area.

Revision 1.261 / (download) - annotate - [select for diffs], Mon Apr 9 11:05:59 2018 UTC (4 years, 9 months ago) by maxv
Branch: MAIN
Changes since 1.260: +33 -31 lines
Diff to previous 1.260 (colored)

Minor stylistic changes, add XXX and fix typo. No functional change.

Revision 1.242.6.5 / (download) - annotate - [select for diffs], Tue Mar 13 15:40:25 2018 UTC (4 years, 10 months ago) by martin
Branch: netbsd-8
CVS Tags: netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1
Changes since 1.242.6.4: +56 -46 lines
Diff to previous 1.242.6.4 (colored) to branchpoint 1.242 (colored)

Pull up following revision(s) (requested by ozaki-r in ticket #628):
	sys/net/if_ethersubr.c: revision 1.250
	sys/net/if_ethersubr.c: revision 1.251
	sys/net/if_ethersubr.c: revision 1.252
	sys/net/if_ethersubr.c: revision 1.248
Use kmem_alloc instead of kmem_intr_alloc in ether_addmulti

ether_addmulti is now not called in softint thanks to wqinput that
pulled input routines of ICMP out of softint.

style

Fix the net.ether.multicast sysctl. If there is no multicast address
don't kmem_alloc(0) (which panics the kernel), and if the number of
multicast addresses has decreased don't copyout uninitialized kernel
data.

Several fixes:
 - Style and typos
 - Use kmem_zalloc, in case there is a padding between the fields of
   the structures
 - Use ETHER_ADDR_LEN instead of a hard-coded '6'
 - kmem_alloc(KM_SLEEP) can't fail
 - Simplify ether_aton_r
 - Use mutex_obj_free, not to leak memory

Revision 1.242.6.4 / (download) - annotate - [select for diffs], Thu Mar 8 14:37:58 2018 UTC (4 years, 11 months ago) by martin
Branch: netbsd-8
Changes since 1.242.6.3: +33 -30 lines
Diff to previous 1.242.6.3 (colored) to branchpoint 1.242 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #618):
	sys/net/if_ethersubr.c: revision 1.245
	sys/net/if_ethersubr.c: revision 1.247

  Use macro(ETHER_LOCK() and ETHER_UNLOCK()). No functional change.

- Modify ether_ioctl() for readability. No functional change.

- KNF

Revision 1.260 / (download) - annotate - [select for diffs], Tue Feb 13 15:21:59 2018 UTC (4 years, 11 months ago) by maxv
Branch: MAIN
CVS Tags: pgoyette-compat-base, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315
Branch point for: pgoyette-compat
Changes since 1.259: +12 -11 lines
Diff to previous 1.259 (colored)

Make the arpresolve branch more readable, fix typo, fix XXX (which I
added), add missing pserialize_read_exit (which I forgot).

Revision 1.259 / (download) - annotate - [select for diffs], Tue Feb 13 10:50:38 2018 UTC (4 years, 11 months ago) by maxv
Branch: MAIN
Changes since 1.258: +2 -4 lines
Diff to previous 1.258 (colored)

Remove KERNEL_LOCK around the MPLS code. It's not needed, since we're only
touching the tag of the mbuf - the tag belongs only to the mbuf, and the
mbuf is not shared.

ok knakahara@

Revision 1.258 / (download) - annotate - [select for diffs], Mon Feb 12 12:17:38 2018 UTC (4 years, 11 months ago) by maxv
Branch: MAIN
Changes since 1.257: +5 -4 lines
Diff to previous 1.257 (colored)

Fix typo, and add a comment about MPLS.

Revision 1.257 / (download) - annotate - [select for diffs], Fri Jan 19 12:31:27 2018 UTC (5 years ago) by nakayama
Branch: MAIN
Changes since 1.256: +3 -3 lines
Diff to previous 1.256 (colored)

Fix inverted logic.

Revision 1.256 / (download) - annotate - [select for diffs], Mon Jan 15 14:00:34 2018 UTC (5 years ago) by maxv
Branch: MAIN
Changes since 1.255: +33 -20 lines
Diff to previous 1.255 (colored)

Style, and fix a bug in the AppleTalk path: we're doing
M_PREPEND(M_DONTWAIT), but we forgot to NULL-check the mbuf afterwards.

Revision 1.255 / (download) - annotate - [select for diffs], Mon Jan 15 13:14:18 2018 UTC (5 years ago) by maxv
Branch: MAIN
Changes since 1.254: +16 -9 lines
Diff to previous 1.254 (colored)

Fix two bugs in altq_etherclassify. When scanning the mbuf chain we need
to make sure that m_next is not NULL, otherwise NULL deref. After that,
we must not touch m->m_pkthdr, given that 'm' may not be the first mbuf
of the chain anymore.

Declare mtop, and add a KASSERT to make sure it has M_PKTHDR set.

Revision 1.254 / (download) - annotate - [select for diffs], Mon Jan 15 12:17:05 2018 UTC (5 years ago) by maxv
Branch: MAIN
Changes since 1.253: +6 -4 lines
Diff to previous 1.253 (colored)

Fix a bug in the VLAN path: there's an inverted logic, the mbuf needs to
be bigger than struct ether_vlan_header, not smaller.

Meanwhile add a KASSERT in the LLC path.

Revision 1.253 / (download) - annotate - [select for diffs], Mon Jan 15 11:57:27 2018 UTC (5 years ago) by maxv
Branch: MAIN
Changes since 1.252: +33 -22 lines
Diff to previous 1.252 (colored)

Style, make the code more readable, and add a KASSERT (we expect the mbuf
to have M_PKTHDR set).

Revision 1.252 / (download) - annotate - [select for diffs], Mon Jan 15 10:27:51 2018 UTC (5 years ago) by maxv
Branch: MAIN
Changes since 1.251: +21 -19 lines
Diff to previous 1.251 (colored)

Several fixes:
 - Style and typos
 - Use kmem_zalloc, in case there is a padding between the fields of
   the structures
 - Use ETHER_ADDR_LEN instead of a hard-coded '6'
 - kmem_alloc(KM_SLEEP) can't fail
 - Simplify ether_aton_r
 - Use mutex_obj_free, not to leak memory

Revision 1.251 / (download) - annotate - [select for diffs], Mon Jan 15 07:59:48 2018 UTC (5 years ago) by maxv
Branch: MAIN
Changes since 1.250: +13 -6 lines
Diff to previous 1.250 (colored)

Fix the net.ether.multicast sysctl. If there is no multicast address
don't kmem_alloc(0) (which panics the kernel), and if the number of
multicast addresses has decreased don't copyout uninitialized kernel
data.

Revision 1.242.6.3 / (download) - annotate - [select for diffs], Tue Jan 9 19:23:04 2018 UTC (5 years ago) by snj
Branch: netbsd-8
Changes since 1.242.6.2: +6 -3 lines
Diff to previous 1.242.6.2 (colored) to branchpoint 1.242 (colored)

Pull up following revision(s) (requested by maxv in ticket #480):
	sys/net/if_ethersubr.c: revision 1.249
Make sure we have an llc structure in the packet, and don't read past the
end of the mbuf if we don't. I'm wondering whether we should not pull up
instead, but whatever.

Revision 1.242.6.2 / (download) - annotate - [select for diffs], Tue Jan 2 10:20:33 2018 UTC (5 years, 1 month ago) by snj
Branch: netbsd-8
Changes since 1.242.6.1: +5 -13 lines
Diff to previous 1.242.6.1 (colored) to branchpoint 1.242 (colored)

Pull up following revision(s) (requested by ozaki-r in ticket #456):
	sys/arch/arm/sunxi/sunxi_emac.c: 1.9
	sys/dev/ic/dwc_gmac.c: 1.43-1.44
	sys/dev/pci/if_iwm.c: 1.75
	sys/dev/pci/if_wm.c: 1.543
	sys/dev/pci/ixgbe/ixgbe.c: 1.112
	sys/dev/pci/ixgbe/ixv.c: 1.74
	sys/kern/sys_socket.c: 1.75
	sys/net/agr/if_agr.c: 1.43
	sys/net/bpf.c: 1.219
	sys/net/if.c: 1.397, 1.399, 1.401-1.403, 1.406-1.410, 1.412-1.416
	sys/net/if.h: 1.242-1.247, 1.250, 1.252-1.257
	sys/net/if_bridge.c: 1.140 via patch, 1.142-1.146
	sys/net/if_etherip.c: 1.40
	sys/net/if_ethersubr.c: 1.243, 1.246
	sys/net/if_faith.c: 1.57
	sys/net/if_gif.c: 1.132
	sys/net/if_l2tp.c: 1.15, 1.17
	sys/net/if_loop.c: 1.98-1.101
	sys/net/if_media.c: 1.35
	sys/net/if_pppoe.c: 1.131-1.132
	sys/net/if_spppsubr.c: 1.176-1.177
	sys/net/if_tun.c: 1.142
	sys/net/if_vlan.c: 1.107, 1.109, 1.114-1.121
	sys/net/npf/npf_ifaddr.c: 1.3
	sys/net/npf/npf_os.c: 1.8-1.9
	sys/net/rtsock.c: 1.230
	sys/netcan/if_canloop.c: 1.3-1.5
	sys/netinet/if_arp.c: 1.255
	sys/netinet/igmp.c: 1.65
	sys/netinet/in.c: 1.210-1.211
	sys/netinet/in_pcb.c: 1.180
	sys/netinet/ip_carp.c: 1.92, 1.94
	sys/netinet/ip_flow.c: 1.81
	sys/netinet/ip_input.c: 1.362
	sys/netinet/ip_mroute.c: 1.147
	sys/netinet/ip_output.c: 1.283, 1.285, 1.287
	sys/netinet6/frag6.c: 1.61
	sys/netinet6/in6.c: 1.251, 1.255
	sys/netinet6/in6_pcb.c: 1.162
	sys/netinet6/ip6_flow.c: 1.35
	sys/netinet6/ip6_input.c: 1.183
	sys/netinet6/ip6_output.c: 1.196
	sys/netinet6/mld6.c: 1.90
	sys/netinet6/nd6.c: 1.239-1.240
	sys/netinet6/nd6_nbr.c: 1.139
	sys/netinet6/nd6_rtr.c: 1.136
	sys/netipsec/ipsec_output.c: 1.65
	sys/rump/net/lib/libnetinet/netinet_component.c: 1.9-1.10
kmem_intr_free kmem_intr_[z]alloced memory
the underlying pools are the same but api-wise those should match
Unify IFEF_*_MPSAFE into IFEF_MPSAFE
There are already two flags for if_output and if_start, however, it seems such
MPSAFE flags are eventually needed for all if_XXX operations. Having discrete
flags for each operation is wasteful of if_extflags bits. So let's unify
the flags into one: IFEF_MPSAFE.
Fortunately IFEF_*_MPSAFE flags have never been included in any releases, so
we can change them without breaking backward compatibility of the releases
(though the kernel version of -current should be bumped).
Note that if an interface have both MP-safe and non-MP-safe operations at a
time, we have to set the IFEF_MPSAFE flag and let callees of non-MP-safe
opeartions take the kernel lock.
Proposed on tech-kern@ and tech-net@
Provide macros for softnet_lock and KERNEL_LOCK hiding NET_MPSAFE switch
It reduces C&P codes such as "#ifndef NET_MPSAFE KERNEL_LOCK(1, NULL); ..."
scattered all over the source code and makes it easy to identify remaining
KERNEL_LOCK and/or softnet_lock that are held even if NET_MPSAFE.
No functional change
Hold KERNEL_LOCK on if_ioctl selectively based on IFEF_MPSAFE
If IFEF_MPSAFE is set, hold the lock and otherwise don't hold.
This change requires additions of KERNEL_LOCK to subsequence functions from
if_ioctl such as ifmedia_ioctl and ifioctl_common to protect non-MP-safe
components.
Proposed on tech-kern@ and tech-net@
Ensure to hold if_ioctl_lock when calling if_flags_set
Fix locking against myself on ifpromisc
vlan_unconfig_locked could be called with holding if_ioctl_lock.
Ensure to not turn on IFF_RUNNING of an interface until its initialization completes
And ensure to turn off it before destruction as per IFF_RUNNING's description
"resource allocated". (The description is a bit doubtful though, I believe the
change is still proper.)
Ensure to hold if_ioctl_lock on if_up and if_down
One exception for if_down is if_detach; in the case the lock isn't needed
because it's guaranteed that no other one can access ifp at that point.
Make if_link_queue MP-safe if IFEF_MPSAFE
if_link_queue is a queue to store events of link state changes, which is
used to pass events from (typically) an interrupt handler to
if_link_state_change softint. The queue was protected by KERNEL_LOCK so far,
but if IFEF_MPSAFE is enabled, it becomes unsafe because (perhaps) an interrupt
handler of an interface with IFEF_MPSAFE doesn't take KERNEL_LOCK. Protect it
by a spin mutex.
Additionally with this change KERNEL_LOCK of if_link_state_change softint is
omitted if NET_MPSAFE is enabled.
Note that the spin mutex is now ifp->if_snd.ifq_lock as well as the case of
if_timer (see the comment).
Use IFADDR_WRITER_FOREACH instead of IFADDR_READER_FOREACH
At that point no other one modifies the list so IFADDR_READER_FOREACH
is unnecessary. Use of IFADDR_READER_FOREACH is harmless in general though,
if we try to detect contract violations of pserialize, using it violates
the contract. So avoid using it makes life easy.
Ensure to call if_addr_init with holding if_ioctl_lock
Get rid of outdated comments
Fix build of kernels without ether
By throwing out if_enable_vlan_mtu and if_disable_vlan_mtu that
created a unnecessary dependency from if.c to if_ethersubr.c.
PR kern/52790
Rename IFNET_LOCK to IFNET_GLOBAL_LOCK
IFNET_LOCK will be used in another lock, if_ioctl_lock (might be renamed then).
Wrap if_ioctl_lock with IFNET_* macros (NFC)
Also if_ioctl_lock perhaps needs to be renamed to something because it's now
not just for ioctl...
Reorder some destruction routines in if_detach
- Destroy if_ioctl_lock at the end of the if_detach because it's used in various
  destruction routines
- Move psref_target_destroy after pr_purgeif because we want to use psref in
  pr_purgeif (otherwise destruction procedures can be tricky)
Ensure to call if_mcast_op with holding IFNET_LOCK
Note that CARP doesn't deal with IFNET_LOCK yet.
Remove IFNET_GLOBAL_LOCK where it's unnecessary because IFNET_LOCK is held
Describe which lock is used to protect each member variable of struct ifnet
Requested by skrll@
Write a guideline for converting an interface to IFEF_MPSAFE
Requested by skrll@
Note that IFNET_LOCK must not be held in softint
Don't set IFEF_MPSAFE unless NET_MPSAFE at this point
Because recent investigations show that interfaces with IFEF_MPSAFE need to
follow additional restrictions to work with the flag safely. We should enable it
on an interface by default only if the interface surely satisfies the
restrictions, which are described in if.h.
Note that enabling IFEF_MPSAFE solely gains a few benefit on performance because
the network stack is still serialized by the big kernel locks by default.

Revision 1.250 / (download) - annotate - [select for diffs], Sat Dec 9 10:51:30 2017 UTC (5 years, 1 month ago) by maxv
Branch: MAIN
Changes since 1.249: +24 -22 lines
Diff to previous 1.249 (colored)

style

Revision 1.249 / (download) - annotate - [select for diffs], Sat Dec 9 10:19:42 2017 UTC (5 years, 1 month ago) by maxv
Branch: MAIN
Changes since 1.248: +6 -3 lines
Diff to previous 1.248 (colored)

Make sure we have an llc structure in the packet, and don't read past the
end of the mbuf if we don't. I'm wondering whether we should not pull up
instead, but whatever.

Revision 1.248 / (download) - annotate - [select for diffs], Wed Dec 6 04:00:07 2017 UTC (5 years, 2 months ago) by ozaki-r
Branch: MAIN
Changes since 1.247: +6 -7 lines
Diff to previous 1.247 (colored)

Use kmem_alloc instead of kmem_intr_alloc in ether_addmulti

ether_addmulti is now not called in softint thanks to wqinput that
pulled input routines of ICMP out of softint.

Revision 1.190.2.4 / (download) - annotate - [select for diffs], Sun Dec 3 11:39:02 2017 UTC (5 years, 2 months ago) by jdolecek
Branch: tls-maxphys
Changes since 1.190.2.3: +279 -203 lines
Diff to previous 1.190.2.3 (colored) next main 1.191 (colored)

update from HEAD

Revision 1.247 / (download) - annotate - [select for diffs], Wed Nov 22 04:27:57 2017 UTC (5 years, 2 months ago) by msaitoh
Branch: MAIN
CVS Tags: tls-maxphys-base-20171202
Changes since 1.246: +23 -20 lines
Diff to previous 1.246 (colored)

- Modify ether_ioctl() for readability. No functional change.
- KNF

Revision 1.246 / (download) - annotate - [select for diffs], Thu Nov 16 03:07:18 2017 UTC (5 years, 2 months ago) by ozaki-r
Branch: MAIN
Changes since 1.245: +2 -10 lines
Diff to previous 1.245 (colored)

Unify IFEF_*_MPSAFE into IFEF_MPSAFE

There are already two flags for if_output and if_start, however, it seems such
MPSAFE flags are eventually needed for all if_XXX operations. Having discrete
flags for each operation is wasteful of if_extflags bits. So let's unify
the flags into one: IFEF_MPSAFE.

Fortunately IFEF_*_MPSAFE flags have never been included in any releases, so
we can change them without breaking backward compatibility of the releases
(though the kernel version of -current should be bumped).

Note that if an interface have both MP-safe and non-MP-safe operations at a
time, we have to set the IFEF_MPSAFE flag and let callees of non-MP-safe
opeartions take the kernel lock.

Proposed on tech-kern@ and tech-net@

Revision 1.245 / (download) - annotate - [select for diffs], Thu Oct 26 09:41:15 2017 UTC (5 years, 3 months ago) by msaitoh
Branch: MAIN
Changes since 1.244: +12 -12 lines
Diff to previous 1.244 (colored)

 Use macro(ETHER_LOCK() and ETHER_UNLOCK()). No functional change.

Revision 1.242.6.1 / (download) - annotate - [select for diffs], Tue Oct 24 08:38:59 2017 UTC (5 years, 3 months ago) by snj
Branch: netbsd-8
CVS Tags: matt-nb8-mediatek-base, matt-nb8-mediatek
Changes since 1.242: +3 -3 lines
Diff to previous 1.242 (colored)

Pull up following revision(s) (requested by knakahara in ticket #302):
	sys/arch/powerpc/booke/dev/pq3etsec.c: 1.30-1.31
	sys/arch/x86/pci/if_vmx.c: 1.20
	sys/dev/ic/i82557.c: 1.148
	sys/dev/ic/rtl8169.c: 1.152
	sys/dev/pci/cxgb/cxgb_sge.c: 1.5
	sys/dev/pci/if_age.c: 1.51
	sys/dev/pci/if_alc.c: 1.25
	sys/dev/pci/if_ale.c: 1.23
	sys/dev/pci/if_bge.c: 1.311
	sys/dev/pci/if_bge.c: 1.312
	sys/dev/pci/if_bnx.c: 1.62
	sys/dev/pci/if_jme.c: 1.32
	sys/dev/pci/if_nfe.c: 1.64
	sys/dev/pci/if_sip.c: 1.167
	sys/dev/pci/if_stge.c: 1.63-1.64
	sys/dev/pci/if_ti.c: 1.102
	sys/dev/pci/if_txp.c: 1.48
	sys/dev/pci/if_vge.c: 1.61
	sys/dev/pci/if_wm.c: 1.538
	sys/dev/pci/ixgbe/ix_txrx.c: 1.29 via patch
	sys/net/agr/if_agrether_hash.c: 1.4
	sys/net/if_ether.h: 1.67-1.68
	sys/net/if_ethersubr.c: 1.244
	sys/net/if_vlan.c: 1.100
	sys/net80211/ieee80211_input.c: 1.89
	sys/net80211/ieee80211_output.c: 1.59
	sys/sys/mbuf.h: 1.171
VLAN ID uses pkthdr instead of mtag now. Contributed by s-yamaguchi@IIJ.
I just commit by proxy. Reviewed by joerg@n.o and christos@n.o, thanks.
See http://mail-index.netbsd.org/tech-net/2017/09/26/msg006459.html
--
only get vtag when we have vtag like the other drivers.
--
- only get the vtag if we have it like the other drivers
- mask the hardware vlan tag
--
- add a constant for the vlan mask.
- enforce that we have a tag before we get it.
only get vtag when we have vtag like the other drivers.
like if_bge.c:1.312 and if_stge.c:1.64.
fixed by s-yamaguchi@IIJ, thanks.

Revision 1.244 / (download) - annotate - [select for diffs], Tue Sep 26 07:42:06 2017 UTC (5 years, 4 months ago) by knakahara
Branch: MAIN
Changes since 1.243: +3 -3 lines
Diff to previous 1.243 (colored)

VLAN ID uses pkthdr instead of mtag now. Contributed by s-yamaguchi@IIJ.

I just commit by proxy. Reviewed by joerg@n.o and christos@n.o, thanks.
See http://mail-index.netbsd.org/tech-net/2017/09/26/msg006459.html

XXX need pullup to -8 branch

Revision 1.204.2.2 / (download) - annotate - [select for diffs], Sun Sep 24 20:05:03 2017 UTC (5 years, 4 months ago) by snj
Branch: netbsd-7
CVS Tags: netbsd-7-2-RELEASE
Changes since 1.204.2.1: +67 -2 lines
Diff to previous 1.204.2.1 (colored) to branchpoint 1.204 (colored) next main 1.205 (colored)

Pull up following revision(s) (requested by manu in ticket #1409):
	sys/arch/xen/xen/if_xennet_xenbus.c: 1.65
	sys/arch/xen/xen/xennetback_xenbus.c: 1.53, 1.56 via patch
	sys/net/if_bridge.c: 1.105
	sys/net/if_ether.h: 1.65
	sys/net/if_ethersubr.c: 1.215, 1.235
	sys/net/if_vlan.c: 1.76, 1.77, 1.83, 1.88, 1.94
Protect vlan_unconfig with a mutex
It is not thread-safe but is likely to be executed in concurrent.
See PR 49264 for more detail.
--
Tweak vlan_unconfig
No functional change.
--
Add handling of VLAN packets in if_bridge where the parent interface supports
them (Jean-Jacques.Puig%espci.fr@localhost). Factor out the vlan_mtu enabling and
disabling code.
--
Enable the VLAN mtu capability and check for the adjusted packet size
(Jean-Jacques.Puig at espci.fr).
Factor out the packet-size checking function for clarity.
--
Don't increment the reference count only when it was 0...
From Jean-Jacques.Puig
--
Account for the CRC len (Jean-Jacques.Puig)
--
Fix a bug that the parent interface's callback wasn't called when the vlan
interface is configured. A callback function uses VLAN_ATTACHED() function
which check ec->ec_nvlans, the value should be incremented before calling the
callback. This bug was added in if_vlan.c rev. 1.83 (2015/11/19).

Revision 1.205.2.12 / (download) - annotate - [select for diffs], Mon Aug 28 17:53:11 2017 UTC (5 years, 5 months ago) by skrll
Branch: nick-nhusb
Changes since 1.205.2.11: +19 -34 lines
Diff to previous 1.205.2.11 (colored) to branchpoint 1.205 (colored) next main 1.206 (colored)

Sync with HEAD

Revision 1.243 / (download) - annotate - [select for diffs], Sun Jul 23 10:55:00 2017 UTC (5 years, 6 months ago) by para
Branch: MAIN
CVS Tags: nick-nhusb-base-20170825
Changes since 1.242: +5 -5 lines
Diff to previous 1.242 (colored)

kmem_intr_free kmem_intr_[z]alloced memory

the underlying pools are the same but api-wise those should match

Revision 1.225.2.6 / (download) - annotate - [select for diffs], Wed Apr 26 02:53:29 2017 UTC (5 years, 9 months ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.225.2.5: +2 -11 lines
Diff to previous 1.225.2.5 (colored) to branchpoint 1.225 (colored) next main 1.226 (colored)

Sync with HEAD

Revision 1.235.2.1 / (download) - annotate - [select for diffs], Fri Apr 21 16:54:05 2017 UTC (5 years, 9 months ago) by bouyer
Branch: bouyer-socketcan
Changes since 1.235: +17 -31 lines
Diff to previous 1.235 (colored) next main 1.236 (colored)

Sync with HEAD

Revision 1.242 / (download) - annotate - [select for diffs], Thu Apr 6 03:54:59 2017 UTC (5 years, 10 months ago) by ozaki-r
Branch: MAIN
CVS Tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, pgoyette-localcount-20170426, perseant-stdc-iso10646-base, perseant-stdc-iso10646, netbsd-8-base, jdolecek-ncq-base, jdolecek-ncq, bouyer-socketcan-base1
Branch point for: netbsd-8
Changes since 1.241: +2 -4 lines
Diff to previous 1.241 (colored)

Revert "Make sure to hold if_ioctl_lock when calling ifp->if_ioctl"

As per pgoyette@ and riastradh@ requests; we shouldn't decide to
hold a lock based on if the lock is held or not.

Revision 1.241 / (download) - annotate - [select for diffs], Wed Apr 5 03:47:51 2017 UTC (5 years, 10 months ago) by ozaki-r
Branch: MAIN
Changes since 1.240: +4 -2 lines
Diff to previous 1.240 (colored)

Make sure to hold if_ioctl_lock when calling ifp->if_ioctl

Unfortunately callers of ifp->if_ioctl (if_addr_init, if_flags_set
and if_mcast_op) may or may not hold if_ioctl_lock, so we have to
hold the lock only if it's not held.

Revision 1.240 / (download) - annotate - [select for diffs], Fri Mar 24 09:22:46 2017 UTC (5 years, 10 months ago) by ozaki-r
Branch: MAIN
Changes since 1.239: +2 -11 lines
Diff to previous 1.239 (colored)

Remove KERNEL_LOCK for arpresolve in ether_output

Because arpresolve should be already MP-safe.

Revision 1.225.2.5 / (download) - annotate - [select for diffs], Mon Mar 20 06:57:49 2017 UTC (5 years, 10 months ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.225.2.4: +61 -40 lines
Diff to previous 1.225.2.4 (colored) to branchpoint 1.225 (colored)

Sync with HEAD

Revision 1.204.6.1 / (download) - annotate - [select for diffs], Mon Mar 13 07:41:27 2017 UTC (5 years, 10 months ago) by skrll
Branch: netbsd-7-nhusb
Changes since 1.204: +3 -2 lines
Diff to previous 1.204 (colored) next main 1.205 (colored)

Sync with netbsd-7-1-RELEASE

Revision 1.239 / (download) - annotate - [select for diffs], Tue Feb 21 03:59:31 2017 UTC (5 years, 11 months ago) by ozaki-r
Branch: MAIN
CVS Tags: pgoyette-localcount-20170320
Changes since 1.238: +3 -5 lines
Diff to previous 1.238 (colored)

Sweep unnecessary malloc.h inclusions

Revision 1.238 / (download) - annotate - [select for diffs], Tue Feb 14 03:05:06 2017 UTC (5 years, 11 months ago) by ozaki-r
Branch: MAIN
Changes since 1.237: +12 -5 lines
Diff to previous 1.237 (colored)

Do ND in L2_output in the same manner as arpresolve

The benefits of this change are:
- The flow is consistent with IPv4 (and FreeBSD and OpenBSD)
  - old: ip6_output => nd6_output (do ND if needed) => L2_output (lookup a stored cache)
  - new: ip6_output => L2_output (lookup a cache. Do ND if cache not found)
- We can remove some workarounds in nd6_output
- We can move L2 specific operations to their own place
- The performance slightly improves because one cache lookup is reduced

Revision 1.237 / (download) - annotate - [select for diffs], Sun Feb 12 09:36:05 2017 UTC (5 years, 11 months ago) by skrll
Branch: MAIN
Changes since 1.236: +5 -16 lines
Diff to previous 1.236 (colored)

Remove redundant splnet/splx calls - ec_lock is IPL_NET.

Revision 1.204.2.1 / (download) - annotate - [select for diffs], Sun Feb 5 19:14:17 2017 UTC (6 years ago) by snj
Branch: netbsd-7
CVS Tags: netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1
Changes since 1.204: +3 -2 lines
Diff to previous 1.204 (colored)

Pull up following revision(s) (requested by maxv in ticket #1355):
	sys/net/if_arcsubr.c: revision 1.76 via patch
	sys/net/if_ecosubr.c: revision 1.50 via patch
	sys/net/if_ethersubr.c: revision 1.236 via patch
	sys/net/if_fddisubr.c: revision 1.104 via patch
	sys/net/if_tokensubr.c: revision 1.80 via patch
Don't forget to free the mbuf when we decide not to reply to an ARP
request. This obviously is a terrible bug, since it allows a remote sender
to DoS the system with specially-crafted requests sent in a loop.

Revision 1.204.4.1 / (download) - annotate - [select for diffs], Sun Feb 5 19:14:01 2017 UTC (6 years ago) by snj
Branch: netbsd-7-0
Changes since 1.204: +3 -2 lines
Diff to previous 1.204 (colored) next main 1.205 (colored)

Pull up following revision(s) (requested by maxv in ticket #1355):
	sys/net/if_arcsubr.c: revision 1.76 via patch
	sys/net/if_ecosubr.c: revision 1.50 via patch
	sys/net/if_ethersubr.c: revision 1.236 via patch
	sys/net/if_fddisubr.c: revision 1.104 via patch
	sys/net/if_tokensubr.c: revision 1.80 via patch
Don't forget to free the mbuf when we decide not to reply to an ARP
request. This obviously is a terrible bug, since it allows a remote sender
to DoS the system with specially-crafted requests sent in a loop.

Revision 1.205.2.11 / (download) - annotate - [select for diffs], Sun Feb 5 13:40:58 2017 UTC (6 years ago) by skrll
Branch: nick-nhusb
Changes since 1.205.2.10: +103 -52 lines
Diff to previous 1.205.2.10 (colored) to branchpoint 1.205 (colored)

Sync with HEAD

Revision 1.188.8.5 / (download) - annotate - [select for diffs], Sun Feb 5 05:48:00 2017 UTC (6 years ago) by snj
Branch: netbsd-6
Changes since 1.188.8.4: +3 -2 lines
Diff to previous 1.188.8.4 (colored) to branchpoint 1.188 (colored) next main 1.189 (colored)

Pull up following revision(s) (requested by maxv in ticket #1429):
	sys/net/if_arcsubr.c: revision 1.76 via patch
	sys/net/if_ecosubr.c: revision 1.50 via patch
	sys/net/if_ethersubr.c: revision 1.236 via patch
	sys/net/if_fddisubr.c: revision 1.104 via patch
	sys/net/if_tokensubr.c: revision 1.80 via patch
Don't forget to free the mbuf when we decide not to reply to an ARP
request. This obviously is a terrible bug, since it allows a remote sender
to DoS the system with specially-crafted requests sent in a loop.

Revision 1.188.8.3.2.2 / (download) - annotate - [select for diffs], Sun Feb 5 05:47:28 2017 UTC (6 years ago) by snj
Branch: netbsd-6-1
Changes since 1.188.8.3.2.1: +3 -2 lines
Diff to previous 1.188.8.3.2.1 (colored) to branchpoint 1.188.8.3 (colored) next main 1.188.8.4 (colored)

Pull up following revision(s) (requested by maxv in ticket #1429):
	sys/net/if_arcsubr.c: revision 1.76 via patch
	sys/net/if_ecosubr.c: revision 1.50 via patch
	sys/net/if_ethersubr.c: revision 1.236 via patch
	sys/net/if_fddisubr.c: revision 1.104 via patch
	sys/net/if_tokensubr.c: revision 1.80 via patch
Don't forget to free the mbuf when we decide not to reply to an ARP
request. This obviously is a terrible bug, since it allows a remote sender
to DoS the system with specially-crafted requests sent in a loop.

Revision 1.188.8.2.4.2 / (download) - annotate - [select for diffs], Sun Feb 5 05:46:51 2017 UTC (6 years ago) by snj
Branch: netbsd-6-0
Changes since 1.188.8.2.4.1: +3 -2 lines
Diff to previous 1.188.8.2.4.1 (colored) to branchpoint 1.188.8.2 (colored) next main 1.188.8.3 (colored)

Pull up following revision(s) (requested by maxv in ticket #1429):
	sys/net/if_arcsubr.c: revision 1.76 via patch
	sys/net/if_ecosubr.c: revision 1.50 via patch
	sys/net/if_ethersubr.c: revision 1.236 via patch
	sys/net/if_fddisubr.c: revision 1.104 via patch
	sys/net/if_tokensubr.c: revision 1.80 via patch
Don't forget to free the mbuf when we decide not to reply to an ARP
request. This obviously is a terrible bug, since it allows a remote sender
to DoS the system with specially-crafted requests sent in a loop.

Revision 1.236 / (download) - annotate - [select for diffs], Tue Jan 24 18:37:20 2017 UTC (6 years ago) by maxv
Branch: MAIN
CVS Tags: nick-nhusb-base-20170204
Changes since 1.235: +3 -2 lines
Diff to previous 1.235 (colored)

Don't forget to free the mbuf when we decide not to reply to an ARP
request. This obviously is a terrible bug, since it allows a remote sender
to DoS the system with specially-crafted requests sent in a loop.

Revision 1.235 / (download) - annotate - [select for diffs], Fri Jan 13 06:11:56 2017 UTC (6 years ago) by msaitoh
Branch: MAIN
CVS Tags: bouyer-socketcan-base
Branch point for: bouyer-socketcan
Changes since 1.234: +2 -6 lines
Diff to previous 1.234 (colored)

 Fix a bug that the parent interface's callback wasn't called when the vlan
interface is configured. A callback function uses VLAN_ATTACHED() function
which check ec->ec_nvlans, the value should be incremented before calling the
callback. This bug was added in if_vlan.c rev. 1.83 (2015/11/19).

Revision 1.234 / (download) - annotate - [select for diffs], Tue Jan 10 05:42:34 2017 UTC (6 years ago) by ozaki-r
Branch: MAIN
Changes since 1.233: +6 -3 lines
Diff to previous 1.233 (colored)

Enable some sysctl knobs on rump kernels for ifmcstat

Revision 1.233 / (download) - annotate - [select for diffs], Tue Jan 10 05:40:59 2017 UTC (6 years ago) by ozaki-r
Branch: MAIN
Changes since 1.232: +44 -17 lines
Diff to previous 1.232 (colored)

Replace adaptive mutex for ethercom with spin one

Unfortunately even wm(4) doesn't allow adaptive mutex because wm(4)
tries to hold it with holding its own spin mutex.

Revision 1.225.2.4 / (download) - annotate - [select for diffs], Sat Jan 7 08:56:50 2017 UTC (6 years ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.225.2.3: +60 -36 lines
Diff to previous 1.225.2.3 (colored) to branchpoint 1.225 (colored)

Sync with HEAD.  (Note that most of these changes are simply $NetBSD$
tag issues.)

Revision 1.232 / (download) - annotate - [select for diffs], Sat Dec 31 15:07:02 2016 UTC (6 years, 1 month ago) by ozaki-r
Branch: MAIN
CVS Tags: pgoyette-localcount-20170107
Changes since 1.231: +4 -3 lines
Diff to previous 1.231 (colored)

Use kmem_intr_alloc instead of kmem_alloc

ether_addmulti still can be called in softint.

Fix PR kern/51755

Revision 1.231 / (download) - annotate - [select for diffs], Wed Dec 28 07:32:16 2016 UTC (6 years, 1 month ago) by ozaki-r
Branch: MAIN
Changes since 1.230: +57 -35 lines
Diff to previous 1.230 (colored)

Protect ec_multi* with mutex

The data can be accessed from sysctl, ioctl, interface watchdog
(if_slowtimo) and interrupt handlers. We need to protect the data against
parallel accesses from them.

Currently the mutex is applied to some drivers, we need to apply it to all
drivers in the future.

Note that the mutex is adaptive one for ease of implementation but some
drivers access the data in interrupt context so we cannot apply the mutex
to every drivers as is. We have two options: one is to replace the mutex
with a spin one, which requires some additional works (see
ether_multicast_sysctl), and the other is to modify the drivers to access
the data not in interrupt context somehow.

Revision 1.230 / (download) - annotate - [select for diffs], Wed Dec 28 07:26:24 2016 UTC (6 years, 1 month ago) by ozaki-r
Branch: MAIN
Changes since 1.229: +4 -3 lines
Diff to previous 1.229 (colored)

Use ether_ifattach in carp_clone_create instead of C&P code

carp_clone_destroy calls ether_ifdetach so not calling ether_ifattach is
inconsistent. If we add something pair of initialization and destruction
to ether_ifattach and ether_ifdetach (e.g., mutex_init/mutex_destroy),
ether_ifdetach of carp_clone_destroy won't work. So use ether_ifattach.

In order to do so, make ether_ifattach accept the 2nd argument (lla) as
NULL to allow carp to initialize its link level address by itself.

Revision 1.205.2.10 / (download) - annotate - [select for diffs], Mon Dec 5 10:55:27 2016 UTC (6 years, 2 months ago) by skrll
Branch: nick-nhusb
Changes since 1.205.2.9: +12 -2 lines
Diff to previous 1.205.2.9 (colored) to branchpoint 1.205 (colored)

Sync with HEAD

Revision 1.225.2.3 / (download) - annotate - [select for diffs], Fri Nov 4 14:49:20 2016 UTC (6 years, 3 months ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.225.2.2: +16 -2 lines
Diff to previous 1.225.2.2 (colored) to branchpoint 1.225 (colored)

Sync with HEAD

Revision 1.229 / (download) - annotate - [select for diffs], Tue Oct 18 07:30:30 2016 UTC (6 years, 3 months ago) by ozaki-r
Branch: MAIN
CVS Tags: pgoyette-localcount-20161104, nick-nhusb-base-20161204
Changes since 1.228: +12 -2 lines
Diff to previous 1.228 (colored)

Don't hold global locks if NET_MPSAFE is enabled

If NET_MPSAFE is enabled, don't hold KERNEL_LOCK and softnet_lock in
part of the network stack such as IP forwarding paths. The aim of the
change is to make it easy to test the network stack without the locks
and reduce our local diffs.

By default (i.e., if NET_MPSAFE isn't enabled), the locks are held
as they used to be.

Reviewed by knakahara@

Revision 1.205.2.9 / (download) - annotate - [select for diffs], Wed Oct 5 20:56:08 2016 UTC (6 years, 4 months ago) by skrll
Branch: nick-nhusb
Changes since 1.205.2.8: +29 -13 lines
Diff to previous 1.205.2.8 (colored) to branchpoint 1.205 (colored)

Sync with HEAD

Revision 1.228 / (download) - annotate - [select for diffs], Mon Oct 3 11:06:06 2016 UTC (6 years, 4 months ago) by ozaki-r
Branch: MAIN
CVS Tags: nick-nhusb-base-20161004
Changes since 1.227: +6 -2 lines
Diff to previous 1.227 (colored)

Fix race condition on ifqueue used by traditional netisr

If a underlying network device driver supports MSI/MSI-X, RX interrupts
can be delivered to arbitrary CPUs. This means that Layer 2 subroutines
such as ether_input (softint) and subsequent Layer 3 subroutines (softint)
which are called via traditional netisr can be dispatched on an arbitrary
CPU. Layer 2 subroutines now run without any locks (expected) and so a
Layer 2 subroutine and a Layer 3 subroutine can run in parallel.

There is a shared data between a Layer 2 routine and a Layer 3 routine,
that is ifqueue and IF_ENQUEUE (from L2) and IF_DEQUEUE (from L3) on it
are racy now.

To fix the race condition, use ifqueue#ifq_lock to protect ifqueue
instead of splnet that is meaningless now.

The same race condition exists in route_intr. Fix it as well.

Reviewed by knakahara@

Revision 1.225.2.2 / (download) - annotate - [select for diffs], Sat Aug 6 00:19:10 2016 UTC (6 years, 6 months ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.225.2.1: +23 -11 lines
Diff to previous 1.225.2.1 (colored) to branchpoint 1.225 (colored)

Sync with HEAD

Revision 1.227 / (download) - annotate - [select for diffs], Mon Aug 1 03:15:30 2016 UTC (6 years, 6 months ago) by ozaki-r
Branch: MAIN
CVS Tags: pgoyette-localcount-20160806, localcount-20160914
Changes since 1.226: +23 -11 lines
Diff to previous 1.226 (colored)

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.

Revision 1.225.2.1 / (download) - annotate - [select for diffs], Tue Jul 26 03:24:23 2016 UTC (6 years, 6 months ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.225: +3 -3 lines
Diff to previous 1.225 (colored)

Sync with HEAD

Revision 1.226 / (download) - annotate - [select for diffs], Mon Jul 25 23:46:09 2016 UTC (6 years, 6 months ago) by rjs
Branch: MAIN
CVS Tags: pgoyette-localcount-20160726
Changes since 1.225: +3 -3 lines
Diff to previous 1.225 (colored)

Restore correct test for return value from aarpresolve().

Revision 1.205.2.8 / (download) - annotate - [select for diffs], Sat Jul 9 20:25:21 2016 UTC (6 years, 6 months ago) by skrll
Branch: nick-nhusb
Changes since 1.205.2.7: +40 -13 lines
Diff to previous 1.205.2.7 (colored) to branchpoint 1.205 (colored)

Sync with HEAD

Revision 1.225 / (download) - annotate - [select for diffs], Tue Jun 21 03:54:04 2016 UTC (6 years, 7 months ago) by knakahara
Branch: MAIN
CVS Tags: pgoyette-localcount-base, nick-nhusb-base-20160907
Branch point for: pgoyette-localcount
Changes since 1.224: +8 -3 lines
Diff to previous 1.224 (colored)

fix ATF net/carp failure

Revision 1.224 / (download) - annotate - [select for diffs], Mon Jun 20 07:01:45 2016 UTC (6 years, 7 months ago) by knakahara
Branch: MAIN
Changes since 1.223: +19 -7 lines
Diff to previous 1.223 (colored)

make ether_output() MP-safe, so that if_ether can enable IFEF_OUTPUT_MPSAFE.

making MP-scalable is future work.

Revision 1.223 / (download) - annotate - [select for diffs], Thu Jun 16 03:03:33 2016 UTC (6 years, 7 months ago) by ozaki-r
Branch: MAIN
Changes since 1.222: +18 -8 lines
Diff to previous 1.222 (colored)

Use if_get_byindex instead of if_byindex for MP-safe

Revision 1.205.2.7 / (download) - annotate - [select for diffs], Sun May 29 08:44:38 2016 UTC (6 years, 8 months ago) by skrll
Branch: nick-nhusb
Changes since 1.205.2.6: +4 -4 lines
Diff to previous 1.205.2.6 (colored) to branchpoint 1.205 (colored)

Sync with HEAD

Revision 1.222 / (download) - annotate - [select for diffs], Thu Apr 28 00:16:56 2016 UTC (6 years, 9 months ago) by ozaki-r
Branch: MAIN
CVS Tags: nick-nhusb-base-20160529
Changes since 1.221: +4 -4 lines
Diff to previous 1.221 (colored)

Constify rtentry of if_output

We no longer need to change rtentry below if_output.

The change makes it clear where rtentries are changed (or not)
and helps forthcoming locking (os psrefing) rtentries.

Revision 1.205.2.6 / (download) - annotate - [select for diffs], Fri Apr 22 15:44:17 2016 UTC (6 years, 9 months ago) by skrll
Branch: nick-nhusb
Changes since 1.205.2.5: +16 -36 lines
Diff to previous 1.205.2.5 (colored) to branchpoint 1.205 (colored)

Sync with HEAD

Revision 1.221 / (download) - annotate - [select for diffs], Wed Apr 20 09:01:04 2016 UTC (6 years, 9 months ago) by knakahara
Branch: MAIN
CVS Tags: nick-nhusb-base-20160422
Changes since 1.220: +3 -4 lines
Diff to previous 1.220 (colored)

IFQ_ENQUEUE refactor (3/3) : eliminate pktattr argument from IFQ_ENQUEUE caller

Revision 1.220 / (download) - annotate - [select for diffs], Wed Apr 20 08:58:48 2016 UTC (6 years, 9 months ago) by knakahara
Branch: MAIN
Changes since 1.219: +4 -5 lines
Diff to previous 1.219 (colored)

IFQ_ENQUEUE refactor (2/3) : eliminate pktattr argument from altq implemantation

Revision 1.219 / (download) - annotate - [select for diffs], Wed Apr 20 08:56:32 2016 UTC (6 years, 9 months ago) by knakahara
Branch: MAIN
Changes since 1.218: +9 -9 lines
Diff to previous 1.218 (colored)

IFQ_ENQUEUE refactor (1/3) : add altq_pktattr fields to m_pkthdr

Reviewed by joerg@n.o and tls@n.o, thanks.

Revision 1.218 / (download) - annotate - [select for diffs], Fri Apr 15 01:31:29 2016 UTC (6 years, 9 months ago) by ozaki-r
Branch: MAIN
Changes since 1.217: +5 -24 lines
Diff to previous 1.217 (colored)

Hide PPPoE variables from if_ethersubr.c

This improves modularity of if_pppoe.

From s-yamaguchi@IIJ

Revision 1.217 / (download) - annotate - [select for diffs], Thu Apr 7 03:22:15 2016 UTC (6 years, 10 months ago) by christos
Branch: MAIN
Changes since 1.216: +4 -3 lines
Diff to previous 1.216 (colored)

- tidy up error messages
- add a length argument to arpresolve()
- add KASSERT for overflow

Revision 1.205.2.5 / (download) - annotate - [select for diffs], Sat Mar 19 11:30:32 2016 UTC (6 years, 10 months ago) by skrll
Branch: nick-nhusb
Changes since 1.205.2.4: +6 -3 lines
Diff to previous 1.205.2.4 (colored) to branchpoint 1.205 (colored)

Sync with HEAD

Revision 1.216 / (download) - annotate - [select for diffs], Tue Feb 9 08:32:12 2016 UTC (6 years, 11 months ago) by ozaki-r
Branch: MAIN
CVS Tags: nick-nhusb-base-20160319
Changes since 1.215: +6 -3 lines
Diff to previous 1.215 (colored)

Introduce softint-based if_input

This change intends to run the whole network stack in softint context
(or normal LWP), not hardware interrupt context. Note that the work is
still incomplete by this change; to that end, we also have to softint-ify
if_link_state_change (and bpf) which can still run in hardware interrupt.

This change softint-ifies at ifp->if_input that is called from
each device driver (and ieee80211_input) to ensure Layer 2 runs
in softint (e.g., ether_input and bridge_input). To this end,
we provide a framework (called percpuq) that utlizes softint(9)
and percpu ifqueues. With this patch, rxintr of most drivers just
queues received packets and schedules a softint, and the softint
dequeues packets and does rest packet processing.

To minimize changes to each driver, percpuq is allocated in struct
ifnet for now and that is initialized by default (in if_attach).
We probably have to move percpuq to softc of each driver, but it's
future work. At this point, only wm(4) has percpuq in its softc
as a reference implementation.

Additional information including performance numbers can be found
in the thread at tech-kern@ and tech-net@:
http://mail-index.netbsd.org/tech-kern/2016/01/14/msg019997.html

Acknowledgment: riastradh@ greatly helped this work.
Thank you very much!

Revision 1.205.2.4 / (download) - annotate - [select for diffs], Sun Dec 27 12:10:06 2015 UTC (7 years, 1 month ago) by skrll
Branch: nick-nhusb
Changes since 1.205.2.3: +74 -5 lines
Diff to previous 1.205.2.3 (colored) to branchpoint 1.205 (colored)

Sync with HEAD (as of 26th Dec)

Revision 1.215 / (download) - annotate - [select for diffs], Thu Nov 19 16:23:54 2015 UTC (7 years, 2 months ago) by christos
Branch: MAIN
CVS Tags: nick-nhusb-base-20151226
Changes since 1.214: +71 -2 lines
Diff to previous 1.214 (colored)


Add handling of VLAN packets in if_bridge where the parent interface supports
them (Jean-Jacques.Puig@espci.fr). Factor out the vlan_mtu enabling and
disabling code.

Revision 1.214 / (download) - annotate - [select for diffs], Tue Oct 13 12:33:07 2015 UTC (7 years, 3 months ago) by roy
Branch: MAIN
Changes since 1.213: +5 -5 lines
Diff to previous 1.213 (colored)

arpresolve() now returns 0 on success otherwise an error code.
Callers of arpresolve() now pass the error code back to their caller,
masking out EWOULDBLOCK.

This allows applications such as ping(8) to display a suitable error
condition.

Revision 1.205.2.3 / (download) - annotate - [select for diffs], Tue Sep 22 12:06:10 2015 UTC (7 years, 4 months ago) by skrll
Branch: nick-nhusb
Changes since 1.205.2.2: +8 -13 lines
Diff to previous 1.205.2.2 (colored) to branchpoint 1.205 (colored)

Sync with HEAD

Revision 1.213 / (download) - annotate - [select for diffs], Mon Aug 31 08:05:20 2015 UTC (7 years, 5 months ago) by ozaki-r
Branch: MAIN
CVS Tags: nick-nhusb-base-20150921
Changes since 1.212: +3 -3 lines
Diff to previous 1.212 (colored)

Replace ARP cache (llinfo) with lltable/llentry

Highlights of the change are:
- Use llentry instead of llinfo to manage ARP caches
  - ARP specific data are stored in the hashed list
    of an interface instead of the global list (llinfo_arp)
- Fine-grain locking on llentry
- arptimer (callout) per ARP cache
  - the global timer callout with the big locks can be
    removed (though softnet_lock is still required for now)
- net.inet.arp.prune is now obsoleted
  - it was the interval of the global timer callout
- net.inet.arp.refresh is now obsoleted
  - it was a parameter that prevents expiration of active caches
  - Removed to simplify the timer logic, but we may be able to
    restore the feature if really needed

Proposed on tech-kern and tech-net.

Revision 1.212 / (download) - annotate - [select for diffs], Mon Aug 24 22:21:26 2015 UTC (7 years, 5 months ago) by pooka
Branch: MAIN
Changes since 1.211: +5 -2 lines
Diff to previous 1.211 (colored)

sprinkle _KERNEL_OPT

Revision 1.211 / (download) - annotate - [select for diffs], Wed Aug 12 02:20:31 2015 UTC (7 years, 5 months ago) by ozaki-r
Branch: MAIN
Changes since 1.210: +4 -12 lines
Diff to previous 1.210 (colored)

Tidy up header inclusions

Revision 1.205.2.2 / (download) - annotate - [select for diffs], Sat Jun 6 14:40:25 2015 UTC (7 years, 8 months ago) by skrll
Branch: nick-nhusb
Changes since 1.205.2.1: +16 -70 lines
Diff to previous 1.205.2.1 (colored) to branchpoint 1.205 (colored)

Sync with HEAD

Revision 1.210 / (download) - annotate - [select for diffs], Thu Jun 4 09:19:59 2015 UTC (7 years, 8 months ago) by ozaki-r
Branch: MAIN
CVS Tags: nick-nhusb-base-20150606
Changes since 1.209: +11 -43 lines
Diff to previous 1.209 (colored)

Pull out route lookups from L2 output routines

Route lookups for routes of RTF_GATEWAY were done in L2 output
routines such as ether_output, but they should be done in L3
i.e., before L2 output routines. This change places the lookups
between L3 output routines (say ip_output) and the L2 output
routines.

The change is based on dyoung's patch submitted in the thread:
https://mail-index.netbsd.org/tech-net/2013/02/01/msg003847.html
You can find out detailed investigations by dyoung about the
issue in there.

Note that the change introduces a workaround for MPLS. ether_output
knew that it needs to fill the ethertype of a frame as MPLS,
based on a tag of an original route (rtentry), but now we don't
pass it to ehter_output. So we have to tell that in another way.
We use mtag to do so for now, which introduces some overhead.
We should fix it somehow in the future.

Discussed on tech-kern and tech-net.

Revision 1.209 / (download) - annotate - [select for diffs], Mon May 25 08:29:01 2015 UTC (7 years, 8 months ago) by ozaki-r
Branch: MAIN
Changes since 1.208: +2 -25 lines
Diff to previous 1.208 (colored)

Remove leftover IPX-related stuffs

No objection on tech-kern and tech-net.

Revision 1.208 / (download) - annotate - [select for diffs], Wed May 20 09:17:18 2015 UTC (7 years, 8 months ago) by ozaki-r
Branch: MAIN
Changes since 1.207: +3 -3 lines
Diff to previous 1.207 (colored)

Remove leftover use of AF_NS and NS option

Unnecessary NETISR_NS is also removed.

Revision 1.207 / (download) - annotate - [select for diffs], Mon Apr 13 22:46:57 2015 UTC (7 years, 9 months ago) by riastradh
Branch: MAIN
Changes since 1.206: +3 -2 lines
Diff to previous 1.206 (colored)

Include <sys/rndsource.h> for rnd_add_data.

Revision 1.205.2.1 / (download) - annotate - [select for diffs], Mon Apr 6 15:18:22 2015 UTC (7 years, 10 months ago) by skrll
Branch: nick-nhusb
Changes since 1.205: +5 -2 lines
Diff to previous 1.205 (colored)

Sync with HEAD

Revision 1.206 / (download) - annotate - [select for diffs], Fri Apr 3 07:55:18 2015 UTC (7 years, 10 months ago) by ozaki-r
Branch: MAIN
CVS Tags: nick-nhusb-base-20150406
Changes since 1.205: +5 -2 lines
Diff to previous 1.205 (colored)

Don't grab KERNEL_LOCK during if_output when NET_MPSAFE

The change makes L3 MP-safe work easy. At this point
we deal with only IP forwarding.

No functional change when NET_MPSAFE isn't enabled.

Revision 1.205 / (download) - annotate - [select for diffs], Fri Nov 28 08:29:00 2014 UTC (8 years, 2 months ago) by ozaki-r
Branch: MAIN
CVS Tags: nick-nhusb-base
Branch point for: nick-nhusb
Changes since 1.204: +2 -6 lines
Diff to previous 1.204 (colored)

Remove dead codes and make if_free_sadl static

No functional change.

Revision 1.190.2.3 / (download) - annotate - [select for diffs], Wed Aug 20 00:04:34 2014 UTC (8 years, 5 months ago) by tls
Branch: tls-maxphys
Changes since 1.190.2.2: +135 -60 lines
Diff to previous 1.190.2.2 (colored)

Rebase to HEAD as of a few days ago.

Revision 1.204 / (download) - annotate - [select for diffs], Sun Aug 10 16:44:36 2014 UTC (8 years, 5 months ago) by tls
Branch: MAIN
CVS Tags: tls-maxphys-base, netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-base, netbsd-7-1-RC1, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE
Branch point for: netbsd-7-nhusb, netbsd-7-0, netbsd-7
Changes since 1.203: +9 -2 lines
Diff to previous 1.203 (colored)

Merge tls-earlyentropy branch into HEAD.

Revision 1.196.2.2 / (download) - annotate - [select for diffs], Sun Aug 10 06:56:15 2014 UTC (8 years, 5 months ago) by tls
Branch: tls-earlyentropy
Changes since 1.196.2.1: +124 -55 lines
Diff to previous 1.196.2.1 (colored) to branchpoint 1.196 (colored) next main 1.197 (colored)

Rebase.

Revision 1.203 / (download) - annotate - [select for diffs], Mon Jul 28 14:24:48 2014 UTC (8 years, 6 months ago) by ozaki-r
Branch: MAIN
CVS Tags: tls-earlyentropy-base
Changes since 1.202: +11 -2 lines
Diff to previous 1.202 (colored)

Add a mutex for global variables of if_ethersubr.c

To initialize the mutex, we introduce etherinit that is called from ifinit1.

Revision 1.202 / (download) - annotate - [select for diffs], Mon Jun 30 10:03:41 2014 UTC (8 years, 7 months ago) by ozaki-r
Branch: MAIN
Changes since 1.201: +5 -4 lines
Diff to previous 1.201 (colored)

Schedule pppoe_softintr only when a packet is enqueued

Revision 1.188.8.2.4.1 / (download) - annotate - [select for diffs], Wed Jun 18 09:35:39 2014 UTC (8 years, 7 months ago) by msaitoh
Branch: netbsd-6-0
CVS Tags: netbsd-6-0-6-RELEASE
Changes since 1.188.8.2: +4 -2 lines
Diff to previous 1.188.8.2 (colored)

Pull up following revision(s) (requested by bouyer in ticket #1067):
	sys/dist/ipf/netinet/ip_fil_netbsd.c	1.9 via patch
	sys/net/if_ethersubr.c			1.197 via patch
	sys/net/if_loop.c			1.77 via patch
	sys/net/if_vlan.c			1.70 via patch
	sys/netinet/if_arp.c			1.158
	sys/netinet/ip_carp.c			1.54 via patch
	sys/netinet6/ip6_flow.c			1.23 via patch
	sys/netinet6/nd6.c			1.150 via patch
	sys/rump/librump/rumpkern/klock.c	1.4

Make sure *(if_output)() is called with KERNEL_LOCK held to avoid mbuf leak.
See http://mail-index.netbsd.org/tech-net/2014/04/09/msg004511.html
for details. For netinet6, the problem report, fix and test were done
by njoly@ on current-users@

Revision 1.188.8.3.2.1 / (download) - annotate - [select for diffs], Wed Jun 18 09:34:27 2014 UTC (8 years, 7 months ago) by msaitoh
Branch: netbsd-6-1
CVS Tags: netbsd-6-1-5-RELEASE
Changes since 1.188.8.3: +4 -2 lines
Diff to previous 1.188.8.3 (colored)

Pull up following revision(s) (requested by bouyer in ticket #1067):
	sys/dist/ipf/netinet/ip_fil_netbsd.c	1.9 via patch
	sys/net/if_ethersubr.c			1.197 via patch
	sys/net/if_loop.c			1.77 via patch
	sys/net/if_vlan.c			1.70 via patch
	sys/netinet/if_arp.c			1.158
	sys/netinet/ip_carp.c			1.54 via patch
	sys/netinet6/ip6_flow.c			1.23 via patch
	sys/netinet6/nd6.c			1.150 via patch
	sys/rump/librump/rumpkern/klock.c	1.4

Make sure *(if_output)() is called with KERNEL_LOCK held to avoid mbuf leak.
See http://mail-index.netbsd.org/tech-net/2014/04/09/msg004511.html
for details. For netinet6, the problem report, fix and test were done
by njoly@ on current-users@

Revision 1.201 / (download) - annotate - [select for diffs], Tue Jun 17 10:39:46 2014 UTC (8 years, 7 months ago) by ozaki-r
Branch: MAIN
Changes since 1.200: +16 -42 lines
Diff to previous 1.200 (colored)

Restructure ether_input and bridge_input

The network stack of NetBSD is well organized and
layered. A packet reception is processed from a
lower layer to an upper layer one by one. However,
ether_input and bridge_input are not structured so.
bridge_input is called inside ether_input.

The new structure replaces ifnet#if_input of a bridge
member with bridge_input when the member is attached.
So a packet goes straight on a packet reception via
a bridge, bridge_input => ether_input => ip_input.

The change is part of a patch of Lloyd Parkes submitted
in PR 48104. Unlike the patch, the change doesn't
intend to change the behavior of the packet processing.
Another patch will fix PR 48104.

Revision 1.200 / (download) - annotate - [select for diffs], Tue Jun 10 09:38:30 2014 UTC (8 years, 7 months ago) by joerg
Branch: MAIN
Changes since 1.199: +70 -2 lines
Diff to previous 1.199 (colored)

Introduce new sysctls for obtaining interface-specific addresses:
- net.sdl for the active link-layer adddress (the MAC)
- net.ether.multicast for the Ethernet multicast addresses
- net.inet6.multicast for the IPv6 multicast groups
- net.inet6.multicast_kludge for temporarily removed multicast groups

Use this sysctls for replacing the kmem grovelling in ifmcstat(8).

Revision 1.199 / (download) - annotate - [select for diffs], Thu Jun 5 23:48:16 2014 UTC (8 years, 8 months ago) by rmind
Branch: MAIN
Changes since 1.198: +19 -7 lines
Diff to previous 1.198 (colored)

- Implement pktqueue interface for lockless IP input queue.
- Replace ipintrq and ip6intrq with the pktqueue mechanism.
- Eliminate kernel-lock from ipintr() and ip6intr().
- Some preparation work to push softnet_lock out of ipintr().

Discussed on tech-net.

Revision 1.188.8.4 / (download) - annotate - [select for diffs], Tue Jun 3 15:34:00 2014 UTC (8 years, 8 months ago) by msaitoh
Branch: netbsd-6
Changes since 1.188.8.3: +4 -2 lines
Diff to previous 1.188.8.3 (colored) to branchpoint 1.188 (colored)

Pull up following revision(s) (requested by bouyer in ticket #1067):
	sys/dist/ipf/netinet/ip_fil_netbsd.c	1.9 via patch
	sys/net/if_ethersubr.c			1.197 via patch
	sys/net/if_loop.c			1.77 via patch
	sys/net/if_vlan.c			1.70 via patch
	sys/netinet/if_arp.c			1.158
	sys/netinet/ip_carp.c			1.54 via patch
	sys/netinet6/ip6_flow.c			1.23 via patch
	sys/netinet6/nd6.c			1.150 via patch
	sys/rump/librump/rumpkern/klock.c	1.4

Make sure *(if_output)() is called with KERNEL_LOCK held to avoid mbuf leak.
See http://mail-index.netbsd.org/tech-net/2014/04/09/msg004511.html
for details. For netinet6, the problem report, fix and test were done
by njoly@ on current-users@

Revision 1.188.2.4 / (download) - annotate - [select for diffs], Thu May 22 11:41:09 2014 UTC (8 years, 8 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.188.2.3: +10 -138 lines
Diff to previous 1.188.2.3 (colored) to branchpoint 1.188 (colored) next main 1.189 (colored)

sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs.  ("Protocol error: too many arguments")

Revision 1.194.6.2 / (download) - annotate - [select for diffs], Sun May 18 17:46:12 2014 UTC (8 years, 8 months ago) by rmind
Branch: rmind-smpnet
Changes since 1.194.6.1: +19 -10 lines
Diff to previous 1.194.6.1 (colored) to branchpoint 1.194 (colored) next main 1.195 (colored)

sync with head

Revision 1.198 / (download) - annotate - [select for diffs], Thu May 15 07:35:38 2014 UTC (8 years, 8 months ago) by msaitoh
Branch: MAIN
CVS Tags: rmind-smpnet-nbase, rmind-smpnet-base
Changes since 1.197: +13 -10 lines
Diff to previous 1.197 (colored)

 Usually schednetisr() is called after enqueueing a packet with IF_ENQUEUE().
In some functions, they do it in reverse order. It's not a bug because
the pair is protected with splnet()/splx(s). It's not good for readability
and someone might mistake when modifing a code. Yes, I'm one of the person :-(

 Save a NETISR_* value in a variable and call schednetisr() after enqueue
a packet for readability and future modification.

Revision 1.197 / (download) - annotate - [select for diffs], Tue May 13 19:36:16 2014 UTC (8 years, 8 months ago) by bouyer
Branch: MAIN
Changes since 1.196: +4 -2 lines
Diff to previous 1.196 (colored)

Make sure *(if_output)() is called with KERNEL_LOCK held.
Add some KASSERT for this.
See http://mail-index.netbsd.org/tech-net/2014/04/09/msg004511.html
for details.

Revision 1.196.2.1 / (download) - annotate - [select for diffs], Mon Apr 7 02:24:31 2014 UTC (8 years, 10 months ago) by tls
Branch: tls-earlyentropy
Changes since 1.196: +9 -2 lines
Diff to previous 1.196 (colored)

Increase unpredictability of early output: mix in the headers of the
first 100 Ethernet packets received by the system (if we are really
short of entropy, keep mixing them though we don't count any entropy from
them; such systems are particularly likely to have guessable outputs).

Revision 1.196 / (download) - annotate - [select for diffs], Tue Feb 25 22:42:06 2014 UTC (8 years, 11 months ago) by pooka
Branch: MAIN
CVS Tags: yamt-pagecache-base9, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3
Branch point for: tls-earlyentropy
Changes since 1.195: +6 -2 lines
Diff to previous 1.195 (colored)

If the in6 domain was not attached, do not attempt to process IPv6 packets.

Revision 1.194.6.1 / (download) - annotate - [select for diffs], Wed Aug 28 23:59:36 2013 UTC (9 years, 5 months ago) by rmind
Branch: rmind-smpnet
Changes since 1.194: +4 -9 lines
Diff to previous 1.194 (colored)

sync with head

Revision 1.195 / (download) - annotate - [select for diffs], Sat Jun 29 21:06:58 2013 UTC (9 years, 7 months ago) by rmind
Branch: MAIN
CVS Tags: riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2
Changes since 1.194: +4 -9 lines
Diff to previous 1.194 (colored)

- Rewrite parts of pfil(9): use array to store hooks and thus be more cache
  friendly (there are only few hooks in the system).  Make the structures
  opaque and the interface more strict.
- Remove PFIL_HOOKS option by making pfil(9) mandatory.

Revision 1.190.2.2 / (download) - annotate - [select for diffs], Sun Jun 23 06:20:25 2013 UTC (9 years, 7 months ago) by tls
Branch: tls-maxphys
Changes since 1.190.2.1: +4 -131 lines
Diff to previous 1.190.2.1 (colored)

resync from head

Revision 1.194 / (download) - annotate - [select for diffs], Fri Mar 1 18:25:56 2013 UTC (9 years, 11 months ago) by joerg
Branch: MAIN
CVS Tags: khorben-n900, agc-symver-base, agc-symver
Branch point for: rmind-smpnet
Changes since 1.193: +4 -131 lines
Diff to previous 1.193 (colored)

Retire OSI network stack. OK core@

Revision 1.188.2.3 / (download) - annotate - [select for diffs], Wed Jan 16 05:33:48 2013 UTC (10 years ago) by yamt
Branch: yamt-pagecache
CVS Tags: yamt-pagecache-tag8
Changes since 1.188.2.2: +8 -2 lines
Diff to previous 1.188.2.2 (colored) to branchpoint 1.188 (colored)

sync with (a bit old) head

Revision 1.190.2.1 / (download) - annotate - [select for diffs], Tue Nov 20 03:02:46 2012 UTC (10 years, 2 months ago) by tls
Branch: tls-maxphys
Changes since 1.190: +17 -11 lines
Diff to previous 1.190 (colored)

Resync to 2012-11-19 00:00:00 UTC

Revision 1.188.8.3 / (download) - annotate - [select for diffs], Wed Oct 31 16:07:46 2012 UTC (10 years, 3 months ago) by riz
Branch: netbsd-6
CVS Tags: netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE
Branch point for: netbsd-6-1
Changes since 1.188.8.2: +3 -3 lines
Diff to previous 1.188.8.2 (colored) to branchpoint 1.188 (colored)

Pull up following revision(s) (requested by christos in ticket #638):
	sys/net/if_ppp.c: revision 1.137
	sys/netinet6/ip6_flow.c: revision 1.20
	sys/net/if_fddisubr.c: revision 1.82
	sys/net/if_ethersubr.c: revision 1.192
	sys/netinet6/in6_var.h: revision 1.66
	sys/net/if_atmsubr.c: revision 1.50
PR/47058: Antti Kantee: If the ipv6 flow code modifies the mbuf, pass the
change up to the caller.

Revision 1.193 / (download) - annotate - [select for diffs], Wed Oct 31 10:17:34 2012 UTC (10 years, 3 months ago) by msaitoh
Branch: MAIN
CVS Tags: yamt-pagecache-base8, yamt-pagecache-base7
Changes since 1.192: +8 -2 lines
Diff to previous 1.192 (colored)

Add SIOCGETHERCAP ioctl.
There was no way to know the setting of ec_capabilities and ec_capenable
other than grepping the source.

See http://mail-index.netbsd.org/tech-kern/2010/07/28/msg008613.html

Revision 1.188.2.2 / (download) - annotate - [select for diffs], Tue Oct 30 17:22:43 2012 UTC (10 years, 3 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.188.2.1: +20 -11 lines
Diff to previous 1.188.2.1 (colored) to branchpoint 1.188 (colored)

sync with head

Revision 1.192 / (download) - annotate - [select for diffs], Thu Oct 11 20:05:50 2012 UTC (10 years, 3 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pagecache-base6
Changes since 1.191: +3 -3 lines
Diff to previous 1.191 (colored)

PR/47058: Antti Kantee: If the ipv6 flow code modifies the mbuf, pass the
change up to the caller.

Revision 1.191 / (download) - annotate - [select for diffs], Fri Oct 5 04:26:06 2012 UTC (10 years, 4 months ago) by matt
Branch: MAIN
Changes since 1.190: +10 -10 lines
Diff to previous 1.190 (colored)

When setting a link address, don't bring up the interface automatically.

Revision 1.188.8.2 / (download) - annotate - [select for diffs], Mon Aug 20 19:23:07 2012 UTC (10 years, 5 months ago) by riz
Branch: netbsd-6
CVS Tags: netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus
Branch point for: netbsd-6-0
Changes since 1.188.8.1: +11 -2 lines
Diff to previous 1.188.8.1 (colored) to branchpoint 1.188 (colored)

Pull up following revision(s) (requested by christos in ticket #517):
	sys/net/if_ethersubr.c: revision 1.190
PR/46587: Roger Pau Monne: Prevent panic on shutdown on bridge teardown ->
ifpromisc-> if_ioctl -> if_init. Idea from dyoung.
XXX: Pullup to 6.

Revision 1.190 / (download) - annotate - [select for diffs], Tue Jul 17 18:08:20 2012 UTC (10 years, 6 months ago) by christos
Branch: MAIN
Branch point for: tls-maxphys
Changes since 1.189: +11 -2 lines
Diff to previous 1.189 (colored)

PR/46587: Roger Pau Monne: Prevent panic on shutdown on bridge teardown ->
ifpromisc-> if_ioctl -> if_init. Idea from dyoung.
XXX: Pullup to 6.

Revision 1.188.6.1 / (download) - annotate - [select for diffs], Sat Jun 2 11:09:37 2012 UTC (10 years, 8 months ago) by mrg
Branch: jmcneill-usbmp
Changes since 1.188: +3 -2 lines
Diff to previous 1.188 (colored) next main 1.189 (colored)

sync to latest -current.

Revision 1.188.2.1 / (download) - annotate - [select for diffs], Wed May 23 10:08:15 2012 UTC (10 years, 8 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.188: +3 -2 lines
Diff to previous 1.188 (colored)

sync with head.

Revision 1.188.8.1 / (download) - annotate - [select for diffs], Fri May 18 17:04:28 2012 UTC (10 years, 8 months ago) by riz
Branch: netbsd-6
Changes since 1.188: +3 -2 lines
Diff to previous 1.188 (colored)

Pull up following revision(s) (requested by chs in ticket #258):
	sys/net/if_ethersubr.c: revision 1.189
in ether_ifdetach(), clear if_mowner before releasing what it points to.
fixes PR 42982.

Revision 1.189 / (download) - annotate - [select for diffs], Fri May 11 04:05:54 2012 UTC (10 years, 8 months ago) by chs
Branch: MAIN
CVS Tags: yamt-pagecache-base5, jmcneill-usbmp-base10
Changes since 1.188: +3 -2 lines
Diff to previous 1.188 (colored)

in ether_ifdetach(), clear if_mowner before releasing what it points to.
fixes PR 42982.

Revision 1.187.2.1 / (download) - annotate - [select for diffs], Thu Jun 23 14:20:25 2011 UTC (11 years, 7 months ago) by cherry
Branch: cherry-xenmp
Changes since 1.187: +4 -3 lines
Diff to previous 1.187 (colored) next main 1.188 (colored)

Catchup with rmind-uvmplock merge.

Revision 1.188 / (download) - annotate - [select for diffs], Thu Jun 16 19:47:30 2011 UTC (11 years, 7 months ago) by kefren
Branch: MAIN
CVS Tags: yamt-pagecache-base4, yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, netbsd-6-base, jmcneill-usbmp-pre-base2, jmcneill-usbmp-base9, jmcneill-usbmp-base8, jmcneill-usbmp-base7, jmcneill-usbmp-base6, jmcneill-usbmp-base5, jmcneill-usbmp-base4, jmcneill-usbmp-base3, jmcneill-usbmp-base2, jmcneill-usbmp-base, jmcneill-audiomp3-base, jmcneill-audiomp3
Branch point for: yamt-pagecache, netbsd-6, jmcneill-usbmp
Changes since 1.187: +4 -3 lines
Diff to previous 1.187 (colored)

use ETHERTYPE_MPLS only for unicast packets (RFC3032)

Revision 1.185.2.1 / (download) - annotate - [select for diffs], Mon Jun 6 09:09:52 2011 UTC (11 years, 8 months ago) by jruoho
Branch: jruoho-x86intr
Changes since 1.185: +25 -8 lines
Diff to previous 1.185 (colored) next main 1.186 (colored)

Sync with HEAD.

Revision 1.176.4.4 / (download) - annotate - [select for diffs], Tue May 31 03:05:06 2011 UTC (11 years, 8 months ago) by rmind
Branch: rmind-uvmplock
Changes since 1.176.4.3: +23 -6 lines
Diff to previous 1.176.4.3 (colored) to branchpoint 1.176 (colored) next main 1.177 (colored)

sync with head

Revision 1.187 / (download) - annotate - [select for diffs], Tue May 24 17:16:43 2011 UTC (11 years, 8 months ago) by matt
Branch: MAIN
CVS Tags: rmind-uvmplock-nbase, rmind-uvmplock-base, cherry-xenmp-base
Branch point for: cherry-xenmp
Changes since 1.186: +24 -7 lines
Diff to previous 1.186 (colored)

Add code to auto-deencapsulate 0 tagged VLANs.

Revision 1.186 / (download) - annotate - [select for diffs], Mon Apr 25 22:14:45 2011 UTC (11 years, 9 months ago) by yamt
Branch: MAIN
Changes since 1.185: +3 -3 lines
Diff to previous 1.185 (colored)

use ETHER_IS_MULTICAST macro.  no functional changes.

Revision 1.176.4.3 / (download) - annotate - [select for diffs], Sat Mar 5 20:55:51 2011 UTC (11 years, 11 months ago) by rmind
Branch: rmind-uvmplock
Changes since 1.176.4.2: +10 -10 lines
Diff to previous 1.176.4.2 (colored) to branchpoint 1.176 (colored)

sync with head

Revision 1.185 / (download) - annotate - [select for diffs], Wed Jan 12 15:30:40 2011 UTC (12 years ago) by tsutsui
Branch: MAIN
CVS Tags: jruoho-x86intr-base, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2
Branch point for: jruoho-x86intr
Changes since 1.184: +3 -3 lines
Diff to previous 1.184 (colored)

Fix off by one in ether_aton_r().  Noticed by "arp info overwritten" warning.
(how could it be missed for months?)

Revision 1.184 / (download) - annotate - [select for diffs], Wed Nov 17 00:20:49 2010 UTC (12 years, 2 months ago) by dyoung
Branch: MAIN
CVS Tags: matt-mips64-premerge-20101231
Changes since 1.183: +9 -9 lines
Diff to previous 1.183 (colored)

Cosmetic: fix indentation.

Revision 1.176.2.2 / (download) - annotate - [select for diffs], Tue Aug 17 06:47:44 2010 UTC (12 years, 5 months ago) by uebayasi
Branch: uebayasi-xip
Changes since 1.176.2.1: +54 -31 lines
Diff to previous 1.176.2.1 (colored) to branchpoint 1.176 (colored) next main 1.177 (colored)

Sync with HEAD.

Revision 1.164.4.5 / (download) - annotate - [select for diffs], Wed Aug 11 22:54:53 2010 UTC (12 years, 5 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.164.4.4: +58 -36 lines
Diff to previous 1.164.4.4 (colored) to branchpoint 1.164 (colored) next main 1.165 (colored)

sync with head.

Revision 1.176.4.2 / (download) - annotate - [select for diffs], Sat Jul 3 01:19:59 2010 UTC (12 years, 7 months ago) by rmind
Branch: rmind-uvmplock
Changes since 1.176.4.1: +25 -4 lines
Diff to previous 1.176.4.1 (colored) to branchpoint 1.176 (colored)

sync with head

Revision 1.183 / (download) - annotate - [select for diffs], Sun Jun 27 13:39:11 2010 UTC (12 years, 7 months ago) by kefren
Branch: MAIN
CVS Tags: yamt-nfs-mp-base11, yamt-nfs-mp-base10, uebayasi-xip-base4, uebayasi-xip-base3, uebayasi-xip-base2
Changes since 1.182: +4 -3 lines
Diff to previous 1.182 (colored)

Don't assume that rt_tag family is AF_MPLS but verify it.
This way rt_tag can be used for other future work also, not only MPLS

Revision 1.182 / (download) - annotate - [select for diffs], Sat Jun 26 14:24:28 2010 UTC (12 years, 7 months ago) by kefren
Branch: MAIN
Changes since 1.181: +24 -4 lines
Diff to previous 1.181 (colored)

Add MPLS support, proposed on tech-net@ a couple of days ago

Welcome to 5.99.33

Revision 1.176.4.1 / (download) - annotate - [select for diffs], Sun May 30 05:18:01 2010 UTC (12 years, 8 months ago) by rmind
Branch: rmind-uvmplock
Changes since 1.176: +35 -34 lines
Diff to previous 1.176 (colored)

sync with head

Revision 1.181 / (download) - annotate - [select for diffs], Wed May 19 20:43:51 2010 UTC (12 years, 8 months ago) by christos
Branch: MAIN
Changes since 1.180: +3 -4 lines
Diff to previous 1.180 (colored)

delint previous

Revision 1.180 / (download) - annotate - [select for diffs], Wed May 19 20:41:59 2010 UTC (12 years, 8 months ago) by christos
Branch: MAIN
Changes since 1.179: +34 -41 lines
Diff to previous 1.179 (colored)

Replace ether_nonstatic_aton with a
- better named one
- not suffering from buffer oveflow
- simpler
- handling different separators
- returning error codes for errors

Some ideas from one posted on tech-net by Jonathan A. Kollasch

Revision 1.179 / (download) - annotate - [select for diffs], Wed May 19 18:58:22 2010 UTC (12 years, 8 months ago) by jakllsch
Branch: MAIN
Changes since 1.178: +41 -32 lines
Diff to previous 1.178 (colored)

Changes to ether_nonstatic_aton():

Be more leinent on input string format.  Each nibble pair may optionally be
followed by any of ':', '-', '.' or ' '.

Make source string const and work on a temporary copy.  The caller may not
expect their string to be destroyed.

Revision 1.178 / (download) - annotate - [select for diffs], Wed May 5 18:12:24 2010 UTC (12 years, 9 months ago) by dyoung
Branch: MAIN
Changes since 1.177: +4 -3 lines
Diff to previous 1.177 (colored)

Constify some ether_output() arguments so that it's clear that they
can never be re-assigned.

Revision 1.176.2.1 / (download) - annotate - [select for diffs], Fri Apr 30 14:44:18 2010 UTC (12 years, 9 months ago) by uebayasi
Branch: uebayasi-xip
Changes since 1.176: +4 -5 lines
Diff to previous 1.176 (colored)

Sync with HEAD.

Revision 1.169.8.1 / (download) - annotate - [select for diffs], Wed Apr 21 00:28:21 2010 UTC (12 years, 9 months ago) by matt
Branch: matt-nb5-mips64
CVS Tags: matt-nb5-mips64-premerge-20101231, matt-nb5-mips64-k15
Changes since 1.169: +15 -12 lines
Diff to previous 1.169 (colored) next main 1.170 (colored)

sync to netbsd-5

Revision 1.177 / (download) - annotate - [select for diffs], Mon Apr 5 07:22:23 2010 UTC (12 years, 10 months ago) by joerg
Branch: MAIN
CVS Tags: uebayasi-xip-base1
Changes since 1.176: +4 -5 lines
Diff to previous 1.176 (colored)

Push the bpf_ops usage back into bpf.h. Push the common ifp->if_bpf
check into the inline functions as well the fourth argument for
bpf_attach.

Revision 1.164.4.4 / (download) - annotate - [select for diffs], Thu Mar 11 15:04:26 2010 UTC (12 years, 10 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.164.4.3: +18 -21 lines
Diff to previous 1.164.4.3 (colored) to branchpoint 1.164 (colored)

sync with head

Revision 1.176 / (download) - annotate - [select for diffs], Tue Jan 19 22:08:00 2010 UTC (13 years ago) by pooka
Branch: MAIN
CVS Tags: yamt-nfs-mp-base9, uebayasi-xip-base
Branch point for: uebayasi-xip, rmind-uvmplock
Changes since 1.175: +5 -11 lines
Diff to previous 1.175 (colored)

Redefine bpf linkage through an always present op vector, i.e.
#if NBPFILTER is no longer required in the client.  This change
doesn't yet add support for loading bpf as a module, since drivers
can register before bpf is attached.  However, callers of bpf can
now be modularized.

Dynamically loadable bpf could probably be done fairly easily with
coordination from the stub driver and the real driver by registering
attachments in the stub before the real driver is loaded and doing
a handoff.  ... and I'm not going to ponder the depths of unload
here.

Tested with i386/MONOLITHIC, modified MONOLITHIC without bpf and rump.

Revision 1.175 / (download) - annotate - [select for diffs], Sat Nov 28 09:20:37 2009 UTC (13 years, 2 months ago) by mbalmer
Branch: MAIN
CVS Tags: matt-premerge-20091211
Changes since 1.174: +3 -3 lines
Diff to previous 1.174 (colored)

Fix function name that was changed by mistake in the previous whitespace
commit.

Revision 1.174 / (download) - annotate - [select for diffs], Sat Nov 28 02:58:21 2009 UTC (13 years, 2 months ago) by isaki
Branch: MAIN
Changes since 1.173: +11 -11 lines
Diff to previous 1.173 (colored)

white space -> tab.

Revision 1.169.6.1 / (download) - annotate - [select for diffs], Sat Nov 21 19:56:35 2009 UTC (13 years, 2 months ago) by snj
Branch: netbsd-5-0
CVS Tags: netbsd-5-0-2-RELEASE
Changes since 1.169: +6 -3 lines
Diff to previous 1.169 (colored) next main 1.170 (colored)

Pull up following revision(s) (requested by christos in ticket #1156):
	sys/net/if_arcsubr.c: revision 1.61
	sys/net/if_ethersubr.c: revision 1.173
	sys/net/if_fddisubr.c: revision 1.78
	sys/net/if_tokensubr.c: revision 1.58 via patch
	sys/netinet/if_arp.c: revision 1.149
ar_tha() can return NULL; treat this as an error.

Revision 1.169.4.2 / (download) - annotate - [select for diffs], Sat Nov 21 19:43:41 2009 UTC (13 years, 2 months ago) by snj
Branch: netbsd-5
CVS Tags: netbsd-5-2-RELEASE, netbsd-5-2-RC1, netbsd-5-2-3-RELEASE, netbsd-5-2-2-RELEASE, netbsd-5-2-1-RELEASE, netbsd-5-2, netbsd-5-1-RELEASE, netbsd-5-1-RC4, netbsd-5-1-RC3, netbsd-5-1-RC2, netbsd-5-1-RC1, netbsd-5-1-5-RELEASE, netbsd-5-1-4-RELEASE, netbsd-5-1-3-RELEASE, netbsd-5-1-2-RELEASE, netbsd-5-1-1-RELEASE, netbsd-5-1, matt-nb5-pq3-base, matt-nb5-pq3
Changes since 1.169.4.1: +6 -3 lines
Diff to previous 1.169.4.1 (colored) to branchpoint 1.169 (colored) next main 1.170 (colored)

Pull up following revision(s) (requested by christos in ticket #1156):
	sys/net/if_arcsubr.c: revision 1.61
	sys/net/if_ethersubr.c: revision 1.173
	sys/net/if_fddisubr.c: revision 1.78
	sys/net/if_tokensubr.c: revision 1.58 via patch
	sys/netinet/if_arp.c: revision 1.149
ar_tha() can return NULL; treat this as an error.

Revision 1.173 / (download) - annotate - [select for diffs], Fri Nov 20 02:14:56 2009 UTC (13 years, 2 months ago) by christos
Branch: MAIN
Changes since 1.172: +6 -3 lines
Diff to previous 1.172 (colored)

ar_tha() can return NULL; treat this as an error.

Revision 1.170.4.2 / (download) - annotate - [select for diffs], Thu Jul 23 23:32:47 2009 UTC (13 years, 6 months ago) by jym
Branch: jym-xensuspend
Changes since 1.170.4.1: +11 -11 lines
Diff to previous 1.170.4.1 (colored) to branchpoint 1.170 (colored) next main 1.171 (colored)

Sync with HEAD.

Revision 1.164.4.3 / (download) - annotate - [select for diffs], Sat Jun 20 07:20:33 2009 UTC (13 years, 7 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.164.4.2: +11 -11 lines
Diff to previous 1.164.4.2 (colored) to branchpoint 1.164 (colored)

sync with head

Revision 1.169.4.1 / (download) - annotate - [select for diffs], Fri Jun 5 18:49:42 2009 UTC (13 years, 8 months ago) by snj
Branch: netbsd-5
Changes since 1.169: +11 -11 lines
Diff to previous 1.169 (colored)

Pull up following revision(s) (requested by 792):
	sys/dev/pci/if_wm.c: revision 1.175 via patch
	sys/net/if_ethersubr.c: revision 1.172 via patch
	sys/net/agr/ieee8023ad_lacp.c: revision 1.9 via patch
	sys/net/agr/if_agr.c: revision 1.23 via patch
	sys/net/agr/if_agrether.c: revision 1.7 via patch
	sys/net/agr/if_agrvar_impl.h: revision 1.8 via patch
Add vlan support and hardware offload capabilities to agr.
These changes allow vlans to be layered above agr, with the attach
and detach propogated to the member ports in the aggregation.
Note the agr interface must be up before the vlan is attached.
Adds SIOCSIFADDR support to the wm driver for setting the AF_LINK
address, necessary for agr to be able to set the mac addresses of each
port to the agr address (i.e. so it can receive all intended traffic
at the hardware level).
Adds support for disabling the LACP protocol by setting LINK1 on the agr
interface (e.g. ifconfig agr0 link1).
In consultation with tls@.

Revision 1.172 / (download) - annotate - [select for diffs], Fri May 29 04:57:04 2009 UTC (13 years, 8 months ago) by darran
Branch: MAIN
CVS Tags: yamt-nfs-mp-base8, yamt-nfs-mp-base7, yamt-nfs-mp-base6, yamt-nfs-mp-base5, jymxensuspend-base, jym-xensuspend-nbase
Changes since 1.171: +11 -11 lines
Diff to previous 1.171 (colored)

Add vlan support and hardware offload capabilities to agr.
These changes allow vlans to be layered above agr, with the attach
and detach propogated to the member ports in the aggregation.
Note the agr interface must be up before the vlan is attached.

Adds SIOCINITIFADDR support to the wm driver for setting the AF_LINK
address, necessary for agr to be able to set the mac addresses of each
port to the agr address (i.e. so it can receive all intended traffic
at the hardware level).

Adds support for disabling the LACP protocol by setting LINK1 on the agr
interface (e.g. ifconfig agr0 link1).

In consultation with tls@.

Revision 1.170.4.1 / (download) - annotate - [select for diffs], Wed May 13 17:22:19 2009 UTC (13 years, 8 months ago) by jym
Branch: jym-xensuspend
Changes since 1.170: +8 -5 lines
Diff to previous 1.170 (colored)

Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.

Revision 1.164.4.2 / (download) - annotate - [select for diffs], Mon May 4 08:14:14 2009 UTC (13 years, 9 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.164.4.1: +48 -30 lines
Diff to previous 1.164.4.1 (colored) to branchpoint 1.164 (colored)

sync with head.

Revision 1.171 / (download) - annotate - [select for diffs], Tue Apr 28 21:26:51 2009 UTC (13 years, 9 months ago) by dyoung
Branch: MAIN
CVS Tags: yamt-nfs-mp-base4, yamt-nfs-mp-base3, nick-hppapmap-base4, jym-xensuspend-base
Changes since 1.170: +8 -5 lines
Diff to previous 1.170 (colored)

Let this build with 'no options INET'.

(I don't know why I bothered, either.)

Revision 1.169.2.1 / (download) - annotate - [select for diffs], Mon Jan 19 13:20:11 2009 UTC (14 years ago) by skrll
Branch: nick-hppapmap
Changes since 1.169: +43 -29 lines
Diff to previous 1.169 (colored) next main 1.170 (colored)

Sync with HEAD.

Revision 1.162.6.4 / (download) - annotate - [select for diffs], Sat Jan 17 13:29:31 2009 UTC (14 years ago) by mjf
Branch: mjf-devfs2
Changes since 1.162.6.3: +41 -27 lines
Diff to previous 1.162.6.3 (colored) to branchpoint 1.162 (colored) next main 1.163 (colored)

Sync with HEAD.

Revision 1.167.4.2 / (download) - annotate - [select for diffs], Sat Dec 13 01:15:25 2008 UTC (14 years, 1 month ago) by haad
Branch: haad-dm
Changes since 1.167.4.1: +43 -29 lines
Diff to previous 1.167.4.1 (colored) to branchpoint 1.167 (colored) next main 1.168 (colored)

Update haad-dm branch to haad-dm-base2.

Revision 1.170 / (download) - annotate - [select for diffs], Fri Nov 7 00:20:13 2008 UTC (14 years, 3 months ago) by dyoung
Branch: MAIN
CVS Tags: nick-hppapmap-base3, nick-hppapmap-base2, nick-hppapmap-base, mjf-devfs2-base, haad-nbase2, haad-dm-base2, haad-dm-base, ad-audiomp2-base, ad-audiomp2
Branch point for: jym-xensuspend
Changes since 1.169: +43 -29 lines
Diff to previous 1.169 (colored)

*** Summary ***

When a link-layer address changes (e.g., ifconfig ex0 link
02:de: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.

Revision 1.167.4.1 / (download) - annotate - [select for diffs], Sun Oct 19 22:17:41 2008 UTC (14 years, 3 months ago) by haad
Branch: haad-dm
Changes since 1.167: +3 -2 lines
Diff to previous 1.167 (colored)

Sync with HEAD.

Revision 1.162.6.3 / (download) - annotate - [select for diffs], Sun Sep 28 10:40:55 2008 UTC (14 years, 4 months ago) by mjf
Branch: mjf-devfs2
Changes since 1.162.6.2: +1 -0 lines
Diff to previous 1.162.6.2 (colored) to branchpoint 1.162 (colored)

Sync with HEAD.

Revision 1.164.6.2 / (download) - annotate - [select for diffs], Thu Sep 18 04:36:59 2008 UTC (14 years, 4 months ago) by wrstuden
Branch: wrstuden-revivesa
Changes since 1.164.6.1: +3 -2 lines
Diff to previous 1.164.6.1 (colored) to branchpoint 1.164 (colored) next main 1.165 (colored)

Sync with wrstuden-revivesa-base-2.

Revision 1.167.2.1 / (download) - annotate - [select for diffs], Mon Jul 28 14:37:36 2008 UTC (14 years, 6 months ago) by simonb
Branch: simonb-wapbl
Changes since 1.167: +3 -2 lines
Diff to previous 1.167 (colored) next main 1.168 (colored)

Sync with head.

Revision 1.169 / (download) - annotate - [select for diffs], Wed Jul 23 06:34:31 2008 UTC (14 years, 6 months ago) by dyoung
Branch: MAIN
CVS Tags: wrstuden-revivesa-base-4, wrstuden-revivesa-base-3, wrstuden-revivesa-base-2, simonb-wapbl-nbase, simonb-wapbl-base, netbsd-5-base, netbsd-5-0-RELEASE, netbsd-5-0-RC4, netbsd-5-0-RC3, netbsd-5-0-RC2, netbsd-5-0-RC1, netbsd-5-0-1-RELEASE, matt-nb5-mips64-u2-k2-k4-k7-k8-k9, matt-nb5-mips64-u1-k1-k5, matt-nb5-mips64-premerge-20091211, matt-nb4-mips64-k7-u2a-k9b, matt-mips64-base2, haad-dm-base1
Branch point for: nick-hppapmap, netbsd-5-0, netbsd-5, matt-nb5-mips64
Changes since 1.168: +28 -34 lines
Diff to previous 1.168 (colored)

Fix this another way: add the missing case statement.

Revision 1.168 / (download) - annotate - [select for diffs], Wed Jul 23 05:41:47 2008 UTC (14 years, 6 months ago) by gmcgarry
Branch: MAIN
Changes since 1.167: +36 -29 lines
Diff to previous 1.167 (colored)

Back out rev 1.163 which broke the logic for SIOCSIFFLAGS.  PR#38976.

Revision 1.164.6.1 / (download) - annotate - [select for diffs], Mon Jun 23 04:31:57 2008 UTC (14 years, 7 months ago) by wrstuden
Branch: wrstuden-revivesa
Changes since 1.164: +8 -22 lines
Diff to previous 1.164 (colored)

Sync w/ -current. 34 merge conflicts to follow.

Revision 1.162.6.2 / (download) - annotate - [select for diffs], Mon Jun 2 13:24:22 2008 UTC (14 years, 8 months ago) by mjf
Branch: mjf-devfs2
Changes since 1.162.6.1: +6 -20 lines
Diff to previous 1.162.6.1 (colored) to branchpoint 1.162 (colored)

Sync with HEAD.

Revision 1.164.2.1 / (download) - annotate - [select for diffs], Sun May 18 12:35:26 2008 UTC (14 years, 8 months ago) by yamt
Branch: yamt-pf42
Changes since 1.164: +8 -22 lines
Diff to previous 1.164 (colored) next main 1.165 (colored)

sync with head.

Revision 1.164.4.1 / (download) - annotate - [select for diffs], Fri May 16 02:25:40 2008 UTC (14 years, 8 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.164: +8 -22 lines
Diff to previous 1.164 (colored)

sync with head.

Revision 1.167 / (download) - annotate - [select for diffs], Tue May 13 17:58:52 2008 UTC (14 years, 8 months ago) by dyoung
Branch: MAIN
CVS Tags: yamt-pf42-base4, yamt-pf42-base3, yamt-pf42-base2, yamt-nfs-mp-base2, wrstuden-revivesa-base-1, wrstuden-revivesa-base, hpcarm-cleanup-nbase
Branch point for: simonb-wapbl, haad-dm
Changes since 1.166: +2 -15 lines
Diff to previous 1.166 (colored)

Delete unreachable SIOCSIFADDR/AF_LINK case.

Revision 1.166 / (download) - annotate - [select for diffs], Sun May 11 20:13:30 2008 UTC (14 years, 8 months ago) by dyoung
Branch: MAIN
Changes since 1.165: +8 -8 lines
Diff to previous 1.165 (colored)

Where applicable, s/0/NULL/, s/Bcmp/memcmp/.  Remove a gratuitous
cast from a call to nd6_storelladdr().

Revision 1.165 / (download) - annotate - [select for diffs], Fri May 9 06:08:19 2008 UTC (14 years, 9 months ago) by rumble
Branch: MAIN
Changes since 1.164: +2 -3 lines
Diff to previous 1.164 (colored)

Nix a tautological return introduced in 1.129.

Revision 1.162.6.1 / (download) - annotate - [select for diffs], Thu Apr 3 12:43:07 2008 UTC (14 years, 10 months ago) by mjf
Branch: mjf-devfs2
Changes since 1.162: +34 -44 lines
Diff to previous 1.162 (colored)

Sync with HEAD.

Revision 1.162.2.1 / (download) - annotate - [select for diffs], Mon Mar 24 07:16:23 2008 UTC (14 years, 10 months ago) by keiichi
Branch: keiichi-mipv6
Changes since 1.162: +34 -44 lines
Diff to previous 1.162 (colored) next main 1.163 (colored)

sync with head.

Revision 1.153.2.3 / (download) - annotate - [select for diffs], Sun Mar 23 02:05:04 2008 UTC (14 years, 10 months ago) by matt
Branch: matt-armv6
Changes since 1.153.2.2: +57 -57 lines
Diff to previous 1.153.2.2 (colored) next main 1.154 (colored)

sync with HEAD

Revision 1.126.2.9 / (download) - annotate - [select for diffs], Mon Mar 17 09:15:41 2008 UTC (14 years, 10 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.126.2.8: +34 -44 lines
Diff to previous 1.126.2.8 (colored) to branchpoint 1.126 (colored) next main 1.127 (colored)

sync with head.

Revision 1.164 / (download) - annotate - [select for diffs], Sat Mar 15 05:07:34 2008 UTC (14 years, 10 months ago) by matt
Branch: MAIN
CVS Tags: yamt-pf42-baseX, yamt-pf42-base, yamt-nfs-mp-base, yamt-lazymbuf-base15, yamt-lazymbuf-base14, matt-armv6-nbase, keiichi-mipv6-nbase, keiichi-mipv6-base, ad-socklock-base1
Branch point for: yamt-pf42, yamt-nfs-mp, wrstuden-revivesa
Changes since 1.163: +4 -4 lines
Diff to previous 1.163 (colored)

Make sure M_PROMISC isn't already set, before we need to see if we are going
to see if we need to set M_PROMISC.
Assume the interface is not CARP'ed.

Revision 1.163 / (download) - annotate - [select for diffs], Wed Mar 12 18:22:24 2008 UTC (14 years, 10 months ago) by dyoung
Branch: MAIN
Changes since 1.162: +32 -42 lines
Diff to previous 1.162 (colored)

Make some cosmetic changes:

        Use fewer 'error = ...; break;' statements and more 'return
        ...;'

        Make the SIOCSIFFLAGS case more clear by using a switch
        statement instead of an if-else if-else chain.

        Shorten a staircase, and remove two unnecessary curly
        braces.

Revision 1.126.2.8 / (download) - annotate - [select for diffs], Wed Feb 27 08:37:00 2008 UTC (14 years, 11 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.126.2.7: +20 -20 lines
Diff to previous 1.126.2.7 (colored) to branchpoint 1.126 (colored)

sync with head.

Revision 1.162 / (download) - annotate - [select for diffs], Wed Feb 20 17:05:53 2008 UTC (14 years, 11 months ago) by matt
Branch: MAIN
CVS Tags: nick-net80211-sync-base, nick-net80211-sync, hpcarm-cleanup-base
Branch point for: mjf-devfs2, keiichi-mipv6
Changes since 1.161: +20 -20 lines
Diff to previous 1.161 (colored)

s/u_\(int[0-9]*_t\)/u\1/g
(change u_int*_t to uint*_t)

Revision 1.156.4.1 / (download) - annotate - [select for diffs], Mon Feb 18 21:07:01 2008 UTC (14 years, 11 months ago) by mjf
Branch: mjf-devfs
Changes since 1.156: +21 -6 lines
Diff to previous 1.156 (colored) next main 1.157 (colored)

Sync with HEAD.

Revision 1.126.2.7 / (download) - annotate - [select for diffs], Mon Feb 11 14:59:59 2008 UTC (14 years, 11 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.126.2.6: +8 -5 lines
Diff to previous 1.126.2.6 (colored) to branchpoint 1.126 (colored)

sync with head.

Revision 1.161 / (download) - annotate - [select for diffs], Thu Feb 7 01:22:00 2008 UTC (15 years ago) by dyoung
Branch: MAIN
CVS Tags: mjf-devfs-base
Changes since 1.160: +8 -5 lines
Diff to previous 1.160 (colored)

Start patching up the kernel so that a network driver always has
the opportunity to handle an ioctl before generic ifioctl handling
occurs.  This will ease extending the kernel and sharing of code
between drivers.

First steps:  Make the signature of ifioctl_common() match struct
ifinet->if_ioctl.  Convert SIOCSIFCAP and SIOCSIFMTU to the new
ifioctl() regime, throughout the kernel.

Revision 1.126.2.6 / (download) - annotate - [select for diffs], Mon Jan 21 09:47:01 2008 UTC (15 years ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.126.2.5: +17 -10 lines
Diff to previous 1.126.2.5 (colored) to branchpoint 1.126 (colored)

sync with head

Revision 1.156.10.2 / (download) - annotate - [select for diffs], Sun Jan 20 17:51:44 2008 UTC (15 years ago) by bouyer
Branch: bouyer-xeni386
Changes since 1.156.10.1: +8 -1 lines
Diff to previous 1.156.10.1 (colored) to branchpoint 1.156 (colored) next main 1.157 (colored)

Sync with HEAD

Revision 1.160 / (download) - annotate - [select for diffs], Sat Jan 19 20:11:52 2008 UTC (15 years ago) by dyoung
Branch: MAIN
CVS Tags: bouyer-xeni386-nbase, bouyer-xeni386-base
Changes since 1.159: +10 -3 lines
Diff to previous 1.159 (colored)

Add default handling of SIOCSIFMEDIA/SIOCGIFMEDIA.

Revision 1.153.2.2 / (download) - annotate - [select for diffs], Wed Jan 9 01:57:10 2008 UTC (15 years, 1 month ago) by matt
Branch: matt-armv6
Changes since 1.153.2.1: +9 -9 lines
Diff to previous 1.153.2.1 (colored)

sync with HEAD

Revision 1.156.10.1 / (download) - annotate - [select for diffs], Wed Jan 2 21:57:04 2008 UTC (15 years, 1 month ago) by bouyer
Branch: bouyer-xeni386
CVS Tags: bouyer-xeni386-merge1
Changes since 1.156: +9 -9 lines
Diff to previous 1.156 (colored)

Sync with HEAD

Revision 1.159 / (download) - annotate - [select for diffs], Wed Jan 2 00:41:07 2008 UTC (15 years, 1 month ago) by dyoung
Branch: MAIN
CVS Tags: matt-armv6-base
Changes since 1.158: +2 -32 lines
Diff to previous 1.158 (colored)

Fix XEN2_DOMU (and amd64?) builds: move ether_mediastatus(),
ether_mediachange() to their own module that we compile only if
the kernel configuration demands support for both MII buses and
ethernet.  Thanks to Tom Spindler for suggesting that these routines
move to dev/mii/.

Revision 1.158 / (download) - annotate - [select for diffs], Mon Dec 31 22:48:41 2007 UTC (15 years, 1 month ago) by dyoung
Branch: MAIN
Changes since 1.157: +37 -2 lines
Diff to previous 1.157 (colored)

Add media-handling code for several ethernet drivers with MII buses
to share.

Revision 1.156.6.1 / (download) - annotate - [select for diffs], Wed Dec 26 19:57:31 2007 UTC (15 years, 1 month ago) by ad
Branch: vmlocking2
Changes since 1.156: +4 -9 lines
Diff to previous 1.156 (colored) next main 1.157 (colored)

Sync with head.

Revision 1.157 / (download) - annotate - [select for diffs], Thu Dec 20 21:08:21 2007 UTC (15 years, 1 month ago) by dyoung
Branch: MAIN
CVS Tags: vmlocking2-base3
Changes since 1.156: +4 -9 lines
Diff to previous 1.156 (colored)

Constify struct ifnet->if_sadl and every use throughout the tree.
Add if_set_sadl() that both sets the link-layer address length and
replaces the current link-layer address with a new one, and use it
throughout the tree.

Revision 1.153.2.1 / (download) - annotate - [select for diffs], Tue Nov 6 23:33:28 2007 UTC (15 years, 3 months ago) by matt
Branch: matt-armv6
CVS Tags: matt-armv6-prevmlocking
Changes since 1.153: +21 -21 lines
Diff to previous 1.153 (colored)

sync with HEAD

Revision 1.126.2.5 / (download) - annotate - [select for diffs], Sat Oct 27 11:36:00 2007 UTC (15 years, 3 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.126.2.4: +16 -18 lines
Diff to previous 1.126.2.4 (colored) to branchpoint 1.126 (colored)

sync with head.

Revision 1.151.4.4 / (download) - annotate - [select for diffs], Fri Oct 26 15:48:59 2007 UTC (15 years, 3 months ago) by joerg
Branch: jmcneill-pm
Changes since 1.151.4.3: +5 -5 lines
Diff to previous 1.151.4.3 (colored) to branchpoint 1.151 (colored) next main 1.152 (colored)

Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.

Revision 1.155.2.1 / (download) - annotate - [select for diffs], Sun Oct 14 11:48:58 2007 UTC (15 years, 3 months ago) by yamt
Branch: yamt-x86pmap
Changes since 1.155: +5 -5 lines
Diff to previous 1.155 (colored) next main 1.156 (colored)

sync with head.

Revision 1.148.2.5 / (download) - annotate - [select for diffs], Tue Oct 9 15:22:25 2007 UTC (15 years, 4 months ago) by ad
Branch: vmlocking
Changes since 1.148.2.4: +24 -24 lines
Diff to previous 1.148.2.4 (colored) to branchpoint 1.148 (colored) next main 1.149 (colored)

Sync with head.

Revision 1.156 / (download) - annotate - [select for diffs], Mon Oct 8 16:18:04 2007 UTC (15 years, 4 months ago) by ad
Branch: MAIN
CVS Tags: yamt-x86pmap-base4, yamt-x86pmap-base3, yamt-kmem-base3, yamt-kmem-base2, yamt-kmem-base, yamt-kmem, vmlocking2-base2, vmlocking2-base1, vmlocking-nbase, vmlocking-base, reinoud-bufcleanup-nbase, reinoud-bufcleanup-base, jmcneill-pm-base, jmcneill-base, cube-autoconf-base, cube-autoconf, bouyer-xenamd64-base2, bouyer-xenamd64-base, bouyer-xenamd64
Branch point for: vmlocking2, mjf-devfs, bouyer-xeni386
Changes since 1.155: +5 -5 lines
Diff to previous 1.155 (colored)

Use the softint API.

Revision 1.151.4.3 / (download) - annotate - [select for diffs], Tue Oct 2 18:29:14 2007 UTC (15 years, 4 months ago) by joerg
Branch: jmcneill-pm
Changes since 1.151.4.2: +13 -15 lines
Diff to previous 1.151.4.2 (colored) to branchpoint 1.151 (colored)

Sync with HEAD.

Revision 1.155 / (download) - annotate - [select for diffs], Wed Sep 19 05:25:33 2007 UTC (15 years, 4 months ago) by dyoung
Branch: MAIN
CVS Tags: yamt-x86pmap-base2, yamt-x86pmap-base
Branch point for: yamt-x86pmap
Changes since 1.154: +13 -15 lines
Diff to previous 1.154 (colored)

Constify sockaddr argument to ether_multiaddr().  Change struct
ifreq * arguments to ether_addmulti() and ether_delmulti() to const
struct sockaddr *, since ether_{add,del}multi() only ever read the
sockaddr ifreq member, ifr_addr.  Update uses in carp(4) and in
vlan(4).

Revision 1.151.4.2 / (download) - annotate - [select for diffs], Mon Sep 3 16:48:54 2007 UTC (15 years, 5 months ago) by jmcneill
Branch: jmcneill-pm
Changes since 1.151.4.1: +13 -11 lines
Diff to previous 1.151.4.1 (colored) to branchpoint 1.151 (colored)

Sync with HEAD.

Revision 1.126.2.4 / (download) - annotate - [select for diffs], Mon Sep 3 14:42:04 2007 UTC (15 years, 5 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.126.2.3: +31 -29 lines
Diff to previous 1.126.2.3 (colored) to branchpoint 1.126 (colored)

sync with head.

Revision 1.150.2.2 / (download) - annotate - [select for diffs], Mon Sep 3 10:23:08 2007 UTC (15 years, 5 months ago) by skrll
Branch: nick-csl-alignment
Changes since 1.150.2.1: +13 -11 lines
Diff to previous 1.150.2.1 (colored) to branchpoint 1.150 (colored) next main 1.151 (colored)

Sync with HEAD.

Revision 1.154 / (download) - annotate - [select for diffs], Thu Aug 30 02:17:35 2007 UTC (15 years, 5 months ago) by dyoung
Branch: MAIN
CVS Tags: nick-csl-alignment-base5
Changes since 1.153: +7 -5 lines
Diff to previous 1.153 (colored)

Use malloc(9) for sockaddrs instead of pool(9), and remove dom_sa_pool
and dom_sa_len members from struct domain.  Pools of fixed-size
objects are too rigid for sockaddr_dls, whose size can vary over
a wide range.

Return sockaddr_dl to its "historical" size.  Now that I'm using
malloc(9) instead of pool(9) to allocate sockaddr_dl, I can create
a sockaddr_dl of any size in the kernel, so expanding sockaddr_dl
is useless.

Avoid using sizeof(struct sockaddr_dl) in the kernel.

Introduce sockaddr_dl_alloc() for allocating & initializing an
arbitrary sockaddr_dl on the heap.

Add an argument, the sockaddr length, to sockaddr_alloc(),
sockaddr_copy(), and sockaddr_dl_setaddr().

Constify: LLADDR() -> CLLADDR().

Where the kernel overwrites LLADDR(), use sockaddr_dl_setaddr(),
instead.  Used properly, sockaddr_dl_setaddr() will not overrun
the end of the sockaddr.

Revision 1.153 / (download) - annotate - [select for diffs], Sun Aug 26 23:07:16 2007 UTC (15 years, 5 months ago) by dyoung
Branch: MAIN
Branch point for: matt-armv6
Changes since 1.152: +8 -8 lines
Diff to previous 1.152 (colored)

Constify: LLADDR -> CLLADDR.  I'm aiming here to make it easier to
identify sockaddr_dl abuse that remains in the kernel, especially
the potential for overwriting memory past the end of a sockaddr_dl
with, e.g., memcpy(LLADDR(), ...).

Use sockaddr_dl_setaddr() in a few places.

Revision 1.148.2.4 / (download) - annotate - [select for diffs], Mon Aug 20 21:27:53 2007 UTC (15 years, 5 months ago) by ad
Branch: vmlocking
Changes since 1.148.2.3: +8 -9 lines
Diff to previous 1.148.2.3 (colored) to branchpoint 1.148 (colored)

Sync with HEAD.

Revision 1.150.2.1 / (download) - annotate - [select for diffs], Wed Aug 15 13:49:39 2007 UTC (15 years, 5 months ago) by skrll
Branch: nick-csl-alignment
Changes since 1.150: +8 -9 lines
Diff to previous 1.150 (colored)

Sync with HEAD.

Revision 1.151.4.1 / (download) - annotate - [select for diffs], Thu Aug 9 02:37:23 2007 UTC (15 years, 6 months ago) by jmcneill
Branch: jmcneill-pm
Changes since 1.151: +7 -8 lines
Diff to previous 1.151 (colored)

Sync with HEAD.

Revision 1.152.2.2 / (download) - annotate - [select for diffs], Tue Aug 7 04:37:45 2007 UTC (15 years, 6 months ago) by dyoung
Branch: matt-mips64
Changes since 1.152.2.1: +1545 -0 lines
Diff to previous 1.152.2.1 (colored) to branchpoint 1.152 (colored) next main 1.153 (colored)

Constify.

Revision 1.152.2.1, Tue Aug 7 04:37:44 2007 UTC (15 years, 6 months ago) by dyoung
Branch: matt-mips64
Changes since 1.152: +0 -1545 lines
FILE REMOVED

file if_ethersubr.c was added on branch matt-mips64 on 2007-08-07 04:37:45 +0000

Revision 1.152 / (download) - annotate - [select for diffs], Tue Aug 7 04:37:44 2007 UTC (15 years, 6 months ago) by dyoung
Branch: MAIN
CVS Tags: matt-mips64-base
Branch point for: matt-mips64
Changes since 1.151: +7 -8 lines
Diff to previous 1.151 (colored)

Constify.

Revision 1.151 / (download) - annotate - [select for diffs], Sat Jul 21 02:24:11 2007 UTC (15 years, 6 months ago) by dyoung
Branch: MAIN
CVS Tags: hpcarm-cleanup
Branch point for: jmcneill-pm
Changes since 1.150: +3 -3 lines
Diff to previous 1.150 (colored)

Use NULL instead of 0 for null pointers.

Revision 1.148.2.3 / (download) - annotate - [select for diffs], Sun Jul 15 15:52:59 2007 UTC (15 years, 6 months ago) by ad
Branch: vmlocking
Changes since 1.148.2.2: +3 -9 lines
Diff to previous 1.148.2.2 (colored) to branchpoint 1.148 (colored)

Sync with head.

Revision 1.150 / (download) - annotate - [select for diffs], Sat Jul 14 21:02:39 2007 UTC (15 years, 6 months ago) by ad
Branch: MAIN
CVS Tags: nick-csl-alignment-base
Branch point for: nick-csl-alignment
Changes since 1.149: +2 -7 lines
Diff to previous 1.149 (colored)

Generic soft interrupts are mandatory.

Revision 1.148.4.1 / (download) - annotate - [select for diffs], Wed Jul 11 20:10:55 2007 UTC (15 years, 6 months ago) by mjf
Branch: mjf-ufs-trans
Changes since 1.148: +6 -4 lines
Diff to previous 1.148 (colored) next main 1.149 (colored)

Sync with head.

Revision 1.148.2.2 / (download) - annotate - [select for diffs], Sun Jun 17 21:31:49 2007 UTC (15 years, 7 months ago) by ad
Branch: vmlocking
Changes since 1.148.2.1: +4 -3 lines
Diff to previous 1.148.2.1 (colored) to branchpoint 1.148 (colored)

- Increase the number of thread priorities from 128 to 256. How the space
  is set up is to be revisited.
- Implement soft interrupts as kernel threads. A generic implementation
  is provided, with hooks for fast-path MD code that can run the interrupt
  threads over the top of other threads executing in the kernel.
- Split vnode::v_flag into three fields, depending on how the flag is
  locked (by the interlock, by the vnode lock, by the file system).
- Miscellaneous locking fixes and improvements.

Revision 1.148.2.1 / (download) - annotate - [select for diffs], Sat Jun 9 23:58:11 2007 UTC (15 years, 8 months ago) by ad
Branch: vmlocking
Changes since 1.148: +6 -4 lines
Diff to previous 1.148 (colored)

Sync with head.

Revision 1.149 / (download) - annotate - [select for diffs], Tue May 29 21:32:29 2007 UTC (15 years, 8 months ago) by christos
Branch: MAIN
CVS Tags: mjf-ufs-trans-base
Changes since 1.148: +6 -4 lines
Diff to previous 1.148 (colored)

Add a sockaddr_storage member to "struct ifreq" maintaining backwards
compatibility with the older ioctls. This avoids stack smashing and
abuse of "struct sockaddr" when ioctls placed "struct sockaddr_foo's" that
were longer than "struct sockaddr".
XXX: Some of the emulations might be broken; I tried to add code for
them but I did not test them.

Revision 1.144.2.2 / (download) - annotate - [select for diffs], Mon Mar 12 05:59:11 2007 UTC (15 years, 10 months ago) by rmind
Branch: yamt-idlelwp
Changes since 1.144.2.1: +11 -7 lines
Diff to previous 1.144.2.1 (colored) to branchpoint 1.144 (colored) next main 1.145 (colored)

Sync with HEAD.

Revision 1.148 / (download) - annotate - [select for diffs], Wed Mar 7 22:20:05 2007 UTC (15 years, 11 months ago) by liamjfoy
Branch: MAIN
CVS Tags: yamt-idlelwp-base8, thorpej-atomic-base, thorpej-atomic, reinoud-bufcleanup
Branch point for: vmlocking, mjf-ufs-trans
Changes since 1.147: +6 -2 lines
Diff to previous 1.147 (colored)

Add IPv6 Fast Forward - the IPv4 counterpart:

If ip6_forward successfully forwards a packet, a cache, in this case a
ip6flow struct entry, will be created. ether_input and friends will
then be able to call ip6flow_fastforward with the packet which will then
be passed to if_output (unless an issue is found - in that case the packet
is passed back to ip6_input).

ok matt@ christos@ dyoung@ and joerg@

Revision 1.147 / (download) - annotate - [select for diffs], Sun Mar 4 06:03:15 2007 UTC (15 years, 11 months ago) by christos
Branch: MAIN
Changes since 1.146: +7 -7 lines
Diff to previous 1.146 (colored)

Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.

Revision 1.139.2.2 / (download) - annotate - [select for diffs], Tue Feb 27 23:16:42 2007 UTC (15 years, 11 months ago) by riz
Branch: netbsd-4
CVS Tags: wrstuden-fixsa-newbase, wrstuden-fixsa-base-1, wrstuden-fixsa-base, wrstuden-fixsa, netbsd-4-0-RELEASE, netbsd-4-0-RC5, netbsd-4-0-RC4, netbsd-4-0-RC3, netbsd-4-0-RC2, netbsd-4-0-RC1, netbsd-4-0-1-RELEASE, netbsd-4-0, matt-nb4-arm-base, matt-nb4-arm
Changes since 1.139.2.1: +9 -4 lines
Diff to previous 1.139.2.1 (colored) to branchpoint 1.139 (colored) next main 1.140 (colored)

Pull up following revision(s) (requested by bouyer in ticket #465):
	sys/net/if_ethersubr.c: revision 1.144
Drop M_PROMISC before passing the packet to a carp device, for the same
reason it's dropped before passing to bridge: when a vlan interface is
in promisc mode, it will loop the packet back to ether_input() with
M_PROMISC set, and when carp calls ether_input again the flag is still
there and the packet is dropped. If the carp interface doesn't take
the packet M_PROMISC is set just after is needed anyway.
Tested on a box with multiple carp on vlans, no comments about this patch
on tech-net@

Revision 1.144.2.1 / (download) - annotate - [select for diffs], Tue Feb 27 16:54:41 2007 UTC (15 years, 11 months ago) by yamt
Branch: yamt-idlelwp
Changes since 1.144: +56 -58 lines
Diff to previous 1.144 (colored)

- sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.

Revision 1.126.2.3 / (download) - annotate - [select for diffs], Mon Feb 26 09:11:33 2007 UTC (15 years, 11 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.126.2.2: +68 -76 lines
Diff to previous 1.126.2.2 (colored) to branchpoint 1.126 (colored)

sync with head.

Revision 1.146 / (download) - annotate - [select for diffs], Tue Feb 20 08:55:54 2007 UTC (15 years, 11 months ago) by dyoung
Branch: MAIN
CVS Tags: ad-audiomp-base, ad-audiomp
Changes since 1.145: +42 -39 lines
Diff to previous 1.145 (colored)

Remove extraneous parentheses.  bcopy -> memcpy.

Revision 1.145 / (download) - annotate - [select for diffs], Sat Feb 17 22:34:08 2007 UTC (15 years, 11 months ago) by dyoung
Branch: MAIN
Changes since 1.144: +23 -28 lines
Diff to previous 1.144 (colored)

KNF: de-__P, bzero -> memset, bcmp -> memcmp.  Remove extraneous
   parentheses in return statements.

Cosmetic: don't open-code TAILQ_FOREACH().

Cosmetic: change types of variables to avoid oodles of casts: in
   in6_src.c, avoid casts by changing several route_in6 pointers
   to struct route pointers.  Remove unnecessary casts to caddr_t
   elsewhere.

Pave the way for eliminating address family-specific route caches:
   soon, struct route will not embed a sockaddr, but it will hold
   a reference to an external sockaddr, instead.  We will set the
   destination sockaddr using rtcache_setdst().  (I created a stub
   for it, but it isn't used anywhere, yet.)  rtcache_free() will
   free the sockaddr.  I have extracted from rtcache_free() a helper
   subroutine, rtcache_clear().  rtcache_clear() will "forget" a
   cached route, but it will not forget the destination by releasing
   the sockaddr.  I use rtcache_clear() instead of rtcache_free()
   in rtcache_update(), because rtcache_update() is not supposed
   to forget the destination.

Constify:

   1 Introduce const accessor for route->ro_dst, rtcache_getdst().

   2 Constify the 'dst' argument to ifnet->if_output().  This
     led me to constify a lot of code called by output routines.

   3 Constify the sockaddr argument to protosw->pr_ctlinput.  This
     led me to constify a lot of code called by ctlinput routines.

   4 Introduce const macros for converting from a generic sockaddr
     to family-specific sockaddrs, e.g., sockaddr_in: satocsin6,
     satocsin, et cetera.

Revision 1.136.2.2 / (download) - annotate - [select for diffs], Thu Feb 1 08:48:43 2007 UTC (16 years ago) by ad
Branch: newlock2
Changes since 1.136.2.1: +12 -20 lines
Diff to previous 1.136.2.1 (colored) to branchpoint 1.136 (colored) next main 1.137 (colored)

Sync with head.

Revision 1.144 / (download) - annotate - [select for diffs], Mon Jan 29 22:13:14 2007 UTC (16 years ago) by bouyer
Branch: MAIN
CVS Tags: post-newlock2-merge, newlock2-nbase, newlock2-base
Branch point for: yamt-idlelwp
Changes since 1.143: +11 -6 lines
Diff to previous 1.143 (colored)

Drop M_PROMISC before passing the packet to a carp device, for the same
reason it's dropped before passing to bridge: when a vlan interface is
in promisc mode, it will loop the packet back to ether_input() with
M_PROMISC set, and when carp calls ether_input again the flag is still
there and the packet is dropped. If the carp interface doesn't take
the packet M_PROMISC is set just after is needed anyway.
Tested on a box with multiple carp on vlans, no comments about this patch
on tech-net@

Revision 1.143 / (download) - annotate - [select for diffs], Sat Jan 27 07:12:16 2007 UTC (16 years ago) by cbiere
Branch: MAIN
Changes since 1.142: +3 -16 lines
Diff to previous 1.142 (colored)

Use a plain memcpy() instead of alignment- and endian-specific hacks.

Revision 1.136.2.1 / (download) - annotate - [select for diffs], Fri Jan 12 01:04:11 2007 UTC (16 years ago) by ad
Branch: newlock2
Changes since 1.136: +111 -71 lines
Diff to previous 1.136 (colored)

Sync with head.

Revision 1.139.2.1 / (download) - annotate - [select for diffs], Mon Jan 8 22:19:57 2007 UTC (16 years, 1 month ago) by tron
Branch: netbsd-4
Changes since 1.139: +4 -2 lines
Diff to previous 1.139 (colored)

Pull up following revision(s) (requested by bouyer in ticket #337):
	sys/net/if_ethersubr.c: revision 1.142
Don't define dropanyway: label unless ISO or NETATALK is defined. Fix
kern/35364 by Gene ENonymous

Revision 1.120.6.1 / (download) - annotate - [select for diffs], Mon Jan 8 20:42:35 2007 UTC (16 years, 1 month ago) by ghen
Branch: netbsd-3-1
CVS Tags: netbsd-3-1-1-RELEASE
Changes since 1.120: +4 -2 lines
Diff to previous 1.120 (colored) next main 1.121 (colored)

Pull up following revision(s) (requested by bouyer in ticket #1623):
	sys/net/if_ethersubr.c: revision 1.142 via patch
Don't define dropanyway: label unless ISO or NETATALK is defined. Fix
kern/35364 by Gene ENonymous

Revision 1.120.4.1 / (download) - annotate - [select for diffs], Mon Jan 8 20:38:32 2007 UTC (16 years, 1 month ago) by ghen
Branch: netbsd-3-0
CVS Tags: netbsd-3-0-3-RELEASE
Changes since 1.120: +4 -2 lines
Diff to previous 1.120 (colored) next main 1.121 (colored)

Pull up following revision(s) (requested by bouyer in ticket #1623):
	sys/net/if_ethersubr.c: revision 1.142 via patch
Don't define dropanyway: label unless ISO or NETATALK is defined. Fix
kern/35364 by Gene ENonymous

Revision 1.120.2.2 / (download) - annotate - [select for diffs], Mon Jan 8 16:59:04 2007 UTC (16 years, 1 month ago) by ghen
Branch: netbsd-3
Changes since 1.120.2.1: +4 -2 lines
Diff to previous 1.120.2.1 (colored) to branchpoint 1.120 (colored) next main 1.121 (colored)

Pull up following revision(s) (requested by bouyer in ticket #1623):
	sys/net/if_ethersubr.c: revision 1.142 via patch
Don't define dropanyway: label unless ISO or NETATALK is defined. Fix
kern/35364 by Gene ENonymous

Revision 1.142 / (download) - annotate - [select for diffs], Sat Jan 6 20:38:14 2007 UTC (16 years, 1 month ago) by bouyer
Branch: MAIN
Changes since 1.141: +4 -2 lines
Diff to previous 1.141 (colored)

Don't define dropanyway: label unless ISO or NETATALK is defined. Fix
kern/35364 by Gene ENonymous

Revision 1.126.2.2 / (download) - annotate - [select for diffs], Sat Dec 30 20:50:20 2006 UTC (16 years, 1 month ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.126.2.1: +110 -179 lines
Diff to previous 1.126.2.1 (colored) to branchpoint 1.126 (colored)

sync with head.

Revision 1.136.4.2 / (download) - annotate - [select for diffs], Mon Dec 18 11:42:15 2006 UTC (16 years, 1 month ago) by yamt
Branch: yamt-splraiseipl
Changes since 1.136.4.1: +5 -5 lines
Diff to previous 1.136.4.1 (colored) to branchpoint 1.136 (colored) next main 1.137 (colored)

sync with head.

Revision 1.141 / (download) - annotate - [select for diffs], Sun Dec 10 11:39:43 2006 UTC (16 years, 1 month ago) by is
Branch: MAIN
CVS Tags: yamt-splraiseipl-base5, yamt-splraiseipl-base4
Changes since 1.140: +5 -5 lines
Diff to previous 1.140 (colored)

explain XID constants, and fix a wrong one

Revision 1.140 / (download) - annotate - [select for diffs], Sun Dec 10 10:51:11 2006 UTC (16 years, 2 months ago) by is
Branch: MAIN
Changes since 1.139: +3 -3 lines
Diff to previous 1.139 (colored)

comment on llc class

Revision 1.136.4.1 / (download) - annotate - [select for diffs], Sun Dec 10 07:19:00 2006 UTC (16 years, 2 months ago) by yamt
Branch: yamt-splraiseipl
Changes since 1.136: +107 -69 lines
Diff to previous 1.136 (colored)

sync with head.

Revision 1.120.2.1 / (download) - annotate - [select for diffs], Sat Dec 2 13:07:43 2006 UTC (16 years, 2 months ago) by bouyer
Branch: netbsd-3
Changes since 1.120: +62 -58 lines
Diff to previous 1.120 (colored)

Pull up following revision(s) (requested by is in ticket #1597):
	sys/net/if_ethersubr.c: revision 1.139 via patch
	sys/netiso/clnp_input.c: revision 1.31
Remove an overlapping struct copy from ether_input, which caused address
corruption for incoming netiso packets with recent (at least NetBSD-3 and
later) compilers. This is done in a way that the copy is avoided totally.
Code path tested with tcp+udp/ipv4+ipv6, arp and ISO cltp/clnp.
Visually ok'd by Christos@.

Revision 1.139 / (download) - annotate - [select for diffs], Fri Dec 1 18:43:40 2006 UTC (16 years, 2 months ago) by is
Branch: MAIN
CVS Tags: yamt-splraiseipl-base3, netbsd-4-base
Branch point for: netbsd-4
Changes since 1.138: +57 -54 lines
Diff to previous 1.138 (colored)

Remove an overlapping struct copy from ether_input, which caused address
corruption for incoming netiso packets with recent (at least NetBSD-3 and
later) compilers. This is done in a way that the copy is avoided totally.
Code path tested with tcp+udp/ipv4+ipv6, arp and ISO cltp/clnp.
Visually ok'd by Christos@.

Revision 1.138 / (download) - annotate - [select for diffs], Fri Nov 24 01:04:30 2006 UTC (16 years, 2 months ago) by rpaulo
Branch: MAIN
Changes since 1.137: +41 -2 lines
Diff to previous 1.137 (colored)

The change I committed to etherip was wrong. ether_snprintf doesn't make
sense when chaning the MAC address of the virtual interface as pointed
out by Hans himself.
So, introduce ether_nonstatic_aton() and make etherip(4) and tap(4) use it.

Revision 1.137 / (download) - annotate - [select for diffs], Thu Nov 23 04:07:07 2006 UTC (16 years, 2 months ago) by rpaulo
Branch: MAIN
Changes since 1.136: +13 -17 lines
Diff to previous 1.136 (colored)

New EtherIP driver based on tap(4) and gif(4) by Hans Rosenfeld.
Notable changes:
	* Fixes PR 34268.
	* Separates the code from gif(4) (which is more cleaner).
	* Allows the usage of STP (Spanning Tree Protocol).
	* Removed EtherIP implementation from gif(4)/tap(4).

Some input from Christos.

Revision 1.128.8.5 / (download) - annotate - [select for diffs], Thu Sep 14 12:31:54 2006 UTC (16 years, 4 months ago) by yamt
Branch: yamt-pdpolicy
Changes since 1.128.8.4: +2 -110 lines
Diff to previous 1.128.8.4 (colored) to branchpoint 1.128 (colored) next main 1.129 (colored)

sync with head.

Revision 1.128.4.1 / (download) - annotate - [select for diffs], Sat Sep 9 02:58:06 2006 UTC (16 years, 5 months ago) by rpaulo
Branch: rpaulo-netinet-merge-pcb
Changes since 1.128: +71 -122 lines
Diff to previous 1.128 (colored) next main 1.129 (colored)

sync with head

Revision 1.136 / (download) - annotate - [select for diffs], Thu Sep 7 02:40:33 2006 UTC (16 years, 5 months ago) by dogcow
Branch: MAIN
CVS Tags: yamt-splraiseipl-base2, yamt-splraiseipl-base, yamt-pdpolicy-base9, rpaulo-netinet-merge-pcb-base
Branch point for: yamt-splraiseipl, newlock2
Changes since 1.135: +2 -110 lines
Diff to previous 1.135 (colored)

remove more vestiges of CCITT, LLC, HDLC, NS, and NSIP.

Revision 1.128.8.4 / (download) - annotate - [select for diffs], Fri Aug 11 15:46:14 2006 UTC (16 years, 5 months ago) by yamt
Branch: yamt-pdpolicy
Changes since 1.128.8.3: +3 -2 lines
Diff to previous 1.128.8.3 (colored) to branchpoint 1.128 (colored)

sync with head

Revision 1.135 / (download) - annotate - [select for diffs], Sat Aug 5 17:20:54 2006 UTC (16 years, 6 months ago) by pavel
Branch: MAIN
CVS Tags: yamt-pdpolicy-base8, yamt-pdpolicy-base7, abandoned-netbsd-4-base, abandoned-netbsd-4
Changes since 1.134: +3 -2 lines
Diff to previous 1.134 (colored)

defflag PPPOE_SERVER and PPPOE_TERM_UNKNOWN_SESSIONS.

Revision 1.128.8.3 / (download) - annotate - [select for diffs], Mon Jun 26 12:53:38 2006 UTC (16 years, 7 months ago) by yamt
Branch: yamt-pdpolicy
Changes since 1.128.8.2: +3 -3 lines
Diff to previous 1.128.8.2 (colored) to branchpoint 1.128 (colored)

sync with head.

Revision 1.126.2.1 / (download) - annotate - [select for diffs], Wed Jun 21 15:10:27 2006 UTC (16 years, 7 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.126: +75 -19 lines
Diff to previous 1.126 (colored)

sync with head.

Revision 1.133.2.1 / (download) - annotate - [select for diffs], Mon Jun 19 04:09:12 2006 UTC (16 years, 7 months ago) by chap
Branch: chap-midi
Changes since 1.133: +3 -3 lines
Diff to previous 1.133 (colored) next main 1.134 (colored)

Sync with head.

Revision 1.134 / (download) - annotate - [select for diffs], Wed Jun 7 22:33:42 2006 UTC (16 years, 8 months ago) by kardel
Branch: MAIN
CVS Tags: yamt-pdpolicy-base6, gdamore-uart-base, gdamore-uart, chap-midi-nbase, chap-midi-base
Changes since 1.133: +3 -3 lines
Diff to previous 1.133 (colored)

merge FreeBSD timecounters from branch simonb-timecounters
- struct timeval time is gone
  time.tv_sec -> time_second
- struct timeval mono_time is gone
  mono_time.tv_sec -> time_uptime
- access to time via
	{get,}{micro,nano,bin}time()
	get* versions are fast but less precise
- support NTP nanokernel implementation (NTP API 4)
- further reading:
  Timecounter Paper: http://phk.freebsd.dk/pubs/timecounter.pdf
  NTP Nanokernel: http://www.eecis.udel.edu/~mills/ntp/html/kern.html

Revision 1.128.6.3 / (download) - annotate - [select for diffs], Thu Jun 1 22:38:37 2006 UTC (16 years, 8 months ago) by kardel
Branch: simonb-timecounters
CVS Tags: simonb-timcounters-final
Changes since 1.128.6.2: +57 -8 lines
Diff to previous 1.128.6.2 (colored) to branchpoint 1.128 (colored) next main 1.129 (colored)

Sync with head.

Revision 1.129.2.1 / (download) - annotate - [select for diffs], Wed May 24 15:50:43 2006 UTC (16 years, 8 months ago) by tron
Branch: peter-altq
Changes since 1.129: +59 -10 lines
Diff to previous 1.129 (colored) next main 1.130 (colored)

Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.

Revision 1.128.8.2 / (download) - annotate - [select for diffs], Wed May 24 10:58:56 2006 UTC (16 years, 8 months ago) by yamt
Branch: yamt-pdpolicy
Changes since 1.128.8.1: +59 -10 lines
Diff to previous 1.128.8.1 (colored) to branchpoint 1.128 (colored)

sync with head.

Revision 1.133 / (download) - annotate - [select for diffs], Thu May 18 09:05:51 2006 UTC (16 years, 8 months ago) by liamjfoy
Branch: MAIN
CVS Tags: yamt-pdpolicy-base5, simonb-timecounters-base
Branch point for: chap-midi
Changes since 1.132: +50 -5 lines
Diff to previous 1.132 (colored)

Integrate Common Address Redundancy Procotol (CARP) from OpenBSD

'pseudo-device	carp'

Thanks to: joerg@ christos@ riz@ and others who tested
Ok: core@

Revision 1.132 / (download) - annotate - [select for diffs], Sun May 14 21:19:33 2006 UTC (16 years, 8 months ago) by elad
Branch: MAIN
Changes since 1.131: +3 -2 lines
Diff to previous 1.131 (colored)

integrate kauth.

Revision 1.131 / (download) - annotate - [select for diffs], Fri May 12 01:20:33 2006 UTC (16 years, 8 months ago) by mrg
Branch: MAIN
Changes since 1.130: +8 -5 lines
Diff to previous 1.130 (colored)

since ar_tha() can return NULL, don't pass it directly to functions
that expect real addresses.  explicitly KASSERT() that it is not
NULL in the kernel and just avoid using it userland.

(the kernel could be more defensive about this, but, until now it
would have just crashed anyway.)

Revision 1.128.10.2 / (download) - annotate - [select for diffs], Sat May 6 23:31:58 2006 UTC (16 years, 9 months ago) by christos
Branch: elad-kernelauth
Changes since 1.128.10.1: +3 -2 lines
Diff to previous 1.128.10.1 (colored) to branchpoint 1.128 (colored) next main 1.129 (colored)

- Move kauth_cred_t declaration to <sys/types.h>
- Cleanup struct ucred; forward declarations that are unused.
- Don't include <sys/kauth.h> in any header, but include it in the c files
  that need it.

Approved by core.

Revision 1.128.6.2 / (download) - annotate - [select for diffs], Sat Apr 22 11:40:06 2006 UTC (16 years, 9 months ago) by simonb
Branch: simonb-timecounters
Changes since 1.128.6.1: +17 -10 lines
Diff to previous 1.128.6.1 (colored) to branchpoint 1.128 (colored)

Sync with head.

Revision 1.128.10.1 / (download) - annotate - [select for diffs], Wed Apr 19 04:46:10 2006 UTC (16 years, 9 months ago) by elad
Branch: elad-kernelauth
Changes since 1.128: +17 -10 lines
Diff to previous 1.128 (colored)

sync with head.

Revision 1.130 / (download) - annotate - [select for diffs], Sat Apr 15 02:25:24 2006 UTC (16 years, 9 months ago) by christos
Branch: MAIN
CVS Tags: elad-kernelauth-base
Changes since 1.129: +4 -4 lines
Diff to previous 1.129 (colored)

Coverity CID 1145: Protect against NULL deref.

Revision 1.128.8.1 / (download) - annotate - [select for diffs], Sat Apr 1 12:07:43 2006 UTC (16 years, 10 months ago) by yamt
Branch: yamt-pdpolicy
Changes since 1.128: +15 -8 lines
Diff to previous 1.128 (colored)

sync with head.

Revision 1.129 / (download) - annotate - [select for diffs], Thu Mar 16 15:57:59 2006 UTC (16 years, 10 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pdpolicy-base4, yamt-pdpolicy-base3, peter-altq-base
Branch point for: peter-altq
Changes since 1.128: +15 -8 lines
Diff to previous 1.128 (colored)

Add a new function called ether_snprintf() which takes an external buffer
and a length. The buffer should be 3 * addrlen.
Remove local tap_ether_sprintf(), and use ether_snprintf() instead.

Revision 1.128.6.1 / (download) - annotate - [select for diffs], Sat Feb 4 14:18:52 2006 UTC (17 years ago) by simonb
Branch: simonb-timecounters
Changes since 1.128: +3 -3 lines
Diff to previous 1.128 (colored)

Adapt for timecounters: mostly use get*time(), use bintime's for timeout
calculations and use "time_second" instead of "time.tv_sec".

Revision 1.128 / (download) - annotate - [select for diffs], Sun Dec 11 23:05:24 2005 UTC (17 years, 1 month ago) by thorpej
Branch: MAIN
CVS Tags: yamt-uio_vmspace-base5, yamt-uio_vmspace, yamt-pdpolicy-base2, yamt-pdpolicy-base
Branch point for: yamt-pdpolicy, simonb-timecounters, rpaulo-netinet-merge-pcb, elad-kernelauth
Changes since 1.127: +5 -5 lines
Diff to previous 1.127 (colored)

ANSI function decls and application of static.

Revision 1.127 / (download) - annotate - [select for diffs], Sun Dec 11 12:24:51 2005 UTC (17 years, 1 month ago) by christos
Branch: MAIN
Changes since 1.126: +2 -2 lines
Diff to previous 1.126 (colored)

merge ktrace-lwp.

Revision 1.112.2.8 / (download) - annotate - [select for diffs], Thu Nov 10 14:10:32 2005 UTC (17 years, 2 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.112.2.7: +16 -16 lines
Diff to previous 1.112.2.7 (colored) next main 1.113 (colored)

Sync with HEAD. Here we go again...

Revision 1.126 / (download) - annotate - [select for diffs], Fri Jun 10 11:11:38 2005 UTC (17 years, 8 months ago) by bouyer
Branch: MAIN
CVS Tags: yamt-vop-base3, yamt-vop-base2, yamt-vop-base, yamt-vop, yamt-readahead-pervnode, yamt-readahead-perfile, yamt-readahead-base3, yamt-readahead-base2, yamt-readahead-base, yamt-readahead, thorpej-vnode-attr-base, thorpej-vnode-attr, ktrace-lwp-base
Branch point for: yamt-lazymbuf
Changes since 1.125: +2 -7 lines
Diff to previous 1.125 (colored)

As ether_input() is always called at IPL_NET, there is no need to
protect the IF_* operations with splnet()/splx().

Revision 1.125 / (download) - annotate - [select for diffs], Sun May 29 21:22:52 2005 UTC (17 years, 8 months ago) by christos
Branch: MAIN
Changes since 1.124: +4 -6 lines
Diff to previous 1.124 (colored)

- sprinkle const
- remove unneeded casts
- use more mem*() instead of b*() funcs.

Revision 1.124 / (download) - annotate - [select for diffs], Tue May 17 04:14:58 2005 UTC (17 years, 8 months ago) by christos
Branch: MAIN
Changes since 1.123: +4 -5 lines
Diff to previous 1.123 (colored)

Yes, it was a cool trick >20 years ago to use "0123456789abcdef"[a] to
implement, xtoa(), but I think defining the samestring 50 times is a bit
too much. Defined HEXDIGITS and hexdigits in subr_prf.c and use it...

Revision 1.123 / (download) - annotate - [select for diffs], Mon May 2 21:20:27 2005 UTC (17 years, 9 months ago) by matt
Branch: MAIN
Changes since 1.122: +12 -4 lines
Diff to previous 1.122 (colored)

rate limit the printfs for oversized ethernet packets.

Revision 1.118.2.1 / (download) - annotate - [select for diffs], Fri Apr 29 11:29:31 2005 UTC (17 years, 9 months ago) by kent
Branch: kent-audio2
Changes since 1.118: +92 -54 lines
Diff to previous 1.118 (colored) next main 1.119 (colored)

sync with -current

Revision 1.112.2.7 / (download) - annotate - [select for diffs], Fri Apr 1 14:31:34 2005 UTC (17 years, 10 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.112.2.6: +58 -24 lines
Diff to previous 1.112.2.6 (colored)

Sync with HEAD.

Revision 1.122 / (download) - annotate - [select for diffs], Thu Mar 31 15:48:13 2005 UTC (17 years, 10 months ago) by christos
Branch: MAIN
CVS Tags: kent-audio2-base
Changes since 1.121: +4 -24 lines
Diff to previous 1.121 (colored)

factor out the interface queueing code into two functions. One used by
the non point-to-point interfaces that has one queue, and one used by
the point to point interfaces that has two queues. No functional changes.
XXX: The ALTQ stuff makes the code ugly.
XXX: More cleanup to come

Revision 1.118.4.2 / (download) - annotate - [select for diffs], Sat Mar 19 08:36:31 2005 UTC (17 years, 10 months ago) by yamt
Branch: yamt-km
Changes since 1.118.4.1: +75 -21 lines
Diff to previous 1.118.4.1 (colored) to branchpoint 1.118 (colored) next main 1.119 (colored)

sync with head.  xen and whitespace.  xen part is not finished.

Revision 1.121 / (download) - annotate - [select for diffs], Fri Mar 18 11:11:50 2005 UTC (17 years, 10 months ago) by yamt
Branch: MAIN
CVS Tags: yamt-km-base4, yamt-km-base3
Changes since 1.120: +56 -2 lines
Diff to previous 1.120 (colored)

add agr(4), a pseudo network device driver for link aggregation.

Revision 1.112.2.6 / (download) - annotate - [select for diffs], Fri Mar 4 16:52:57 2005 UTC (17 years, 11 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.112.2.5: +21 -21 lines
Diff to previous 1.112.2.5 (colored)

Sync with HEAD.

Hi Perry!

Revision 1.120 / (download) - annotate - [select for diffs], Sat Feb 26 22:45:09 2005 UTC (17 years, 11 months ago) by perry
Branch: MAIN
CVS Tags: netbsd-3-base, netbsd-3-1-RELEASE, netbsd-3-1-RC4, netbsd-3-1-RC3, netbsd-3-1-RC2, netbsd-3-1-RC1, netbsd-3-0-RELEASE, netbsd-3-0-RC6, netbsd-3-0-RC5, netbsd-3-0-RC4, netbsd-3-0-RC3, netbsd-3-0-RC2, netbsd-3-0-RC1, netbsd-3-0-2-RELEASE, netbsd-3-0-1-RELEASE
Branch point for: netbsd-3-1, netbsd-3-0, netbsd-3
Changes since 1.119: +21 -21 lines
Diff to previous 1.119 (colored)

nuke trailing whitespace

Revision 1.118.4.1 / (download) - annotate - [select for diffs], Sat Feb 12 18:17:53 2005 UTC (17 years, 11 months ago) by yamt
Branch: yamt-km
Changes since 1.118: +17 -13 lines
Diff to previous 1.118 (colored)

sync with head.

Revision 1.112.2.5 / (download) - annotate - [select for diffs], Fri Feb 4 11:47:42 2005 UTC (18 years ago) by skrll
Branch: ktrace-lwp
Changes since 1.112.2.4: +17 -13 lines
Diff to previous 1.112.2.4 (colored)

Sync with HEAD.

Revision 1.119 / (download) - annotate - [select for diffs], Mon Jan 31 23:49:36 2005 UTC (18 years ago) by kim
Branch: MAIN
CVS Tags: yamt-km-base2
Changes since 1.118: +17 -13 lines
Diff to previous 1.118 (colored)

Add RFC 3378 EtherIP support, ported from OpenBSD to NetBSD by
Hans Rosenfeld (rosenfeld at grumpf.hope-2000.org)

This change makes it possible to add gif interfaces to bridges, which
will then send and receive IP protocol 97 packets. Packets are Ethernet
frames with an EtherIP header prepended.

Revision 1.112.2.4 / (download) - annotate - [select for diffs], Mon Jan 17 19:32:38 2005 UTC (18 years ago) by skrll
Branch: ktrace-lwp
Changes since 1.112.2.3: +12 -8 lines
Diff to previous 1.112.2.3 (colored)

Sync with HEAD.

Revision 1.118 / (download) - annotate - [select for diffs], Sat Jan 8 03:18:18 2005 UTC (18 years, 1 month ago) by yamt
Branch: MAIN
CVS Tags: yamt-km-base, kent-audio1-beforemerge
Branch point for: yamt-km, kent-audio2
Changes since 1.117: +12 -7 lines
Diff to previous 1.117 (colored)

constify broadcastaddr.

Revision 1.117 / (download) - annotate - [select for diffs], Sat Jan 8 03:13:09 2005 UTC (18 years, 1 month ago) by yamt
Branch: MAIN
Changes since 1.116: +2 -3 lines
Diff to previous 1.116 (colored)

remove an unused member, enm_ec from ether_multi.

Revision 1.112.2.3 / (download) - annotate - [select for diffs], Tue Sep 21 13:36:36 2004 UTC (18 years, 4 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.112.2.2: +2 -2 lines
Diff to previous 1.112.2.2 (colored)

Fix the sync with head I botched.

Revision 1.112.2.2 / (download) - annotate - [select for diffs], Sat Sep 18 14:54:16 2004 UTC (18 years, 4 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.112.2.1: +0 -0 lines
Diff to previous 1.112.2.1 (colored)

Sync with HEAD.

Revision 1.112.2.1 / (download) - annotate - [select for diffs], Tue Aug 3 10:54:12 2004 UTC (18 years, 6 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.112: +11 -12 lines
Diff to previous 1.112 (colored)

Sync with HEAD

Revision 1.114.2.2 / (download) - annotate - [select for diffs], Wed Jul 14 11:08:01 2004 UTC (18 years, 6 months ago) by tron
Branch: netbsd-2-0
CVS Tags: netbsd-2-base, netbsd-2-1-RELEASE, netbsd-2-1-RC6, netbsd-2-1-RC5, netbsd-2-1-RC4, netbsd-2-1-RC3, netbsd-2-1-RC2, netbsd-2-1-RC1, netbsd-2-1, netbsd-2-0-RELEASE, netbsd-2-0-RC5, netbsd-2-0-RC4, netbsd-2-0-RC3, netbsd-2-0-RC2, netbsd-2-0-RC1, netbsd-2-0-3-RELEASE, netbsd-2-0-2-RELEASE, netbsd-2-0-1-RELEASE, netbsd-2
Changes since 1.114.2.1: +4 -4 lines
Diff to previous 1.114.2.1 (colored) to branchpoint 1.114 (colored) next main 1.115 (colored)

Pull up revision 1.116 (requested by jonathan in ticket #648):
Rename MBUFTRACE helper function m_claim() to m_claimm(),
for consistency with M_FREE() and m_freem().  Affected files:
sys/mbuf.h
kern/uipc_socket2.c
kern/uipc_mbuf.c
net/if_ethersubr.c
netatalk/ddp_input.c
nfs/nfs_socket.c

Revision 1.116 / (download) - annotate - [select for diffs], Thu Jun 24 04:15:51 2004 UTC (18 years, 7 months ago) by jonathan
Branch: MAIN
CVS Tags: kent-audio1-base, kent-audio1
Changes since 1.115: +4 -4 lines
Diff to previous 1.115 (colored)

Rename MBUFTRACE helper function m_claim() to m_claimm(),
for consistency with M_FREE() and m_freem().  Affected files:

sys/mbuf.h
kern/uipc_socket2.c
kern/uipc_mbuf.c
net/if_ethersubr.c
netatalk/ddp_input.c
nfs/nfs_socket.c

Revision 1.114.2.1 / (download) - annotate - [select for diffs], Mon Jun 7 06:30:11 2004 UTC (18 years, 8 months ago) by jdc
Branch: netbsd-2-0
Changes since 1.114: +7 -2 lines
Diff to previous 1.114 (colored)

Pull up revision 1.115 (requested by dyoung in ticket #448).

Resolve kern/25721 by detaching ethernet(-like) devices from a
bridge in ether_ifdetach.

Revision 1.115 / (download) - annotate - [select for diffs], Sun Jun 6 04:44:05 2004 UTC (18 years, 8 months ago) by dyoung
Branch: MAIN
Changes since 1.114: +7 -2 lines
Diff to previous 1.114 (colored)

Resolve kern/25721 by detaching ethernet(-like) devices from a
bridge in ether_ifdetach.

Revision 1.114 / (download) - annotate - [select for diffs], Thu Oct 30 01:43:08 2003 UTC (19 years, 3 months ago) by simonb
Branch: MAIN
CVS Tags: netbsd-2-0-base
Branch point for: netbsd-2-0
Changes since 1.113: +3 -5 lines
Diff to previous 1.113 (colored)

Remove some assigned-to but otherwise unused variables.

Revision 1.113 / (download) - annotate - [select for diffs], Thu Aug 7 16:32:51 2003 UTC (19 years, 6 months ago) by agc
Branch: MAIN
Changes since 1.112: +3 -7 lines
Diff to previous 1.112 (colored)

Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.

Revision 1.95.2.5 / (download) - annotate - [select for diffs], Mon Jun 30 03:17:56 2003 UTC (19 years, 7 months ago) by grant
Branch: netbsd-1-6
CVS Tags: netbsd-1-6-PATCH002-RELEASE, netbsd-1-6-PATCH002-RC4, netbsd-1-6-PATCH002-RC3, netbsd-1-6-PATCH002-RC2, netbsd-1-6-PATCH002-RC1, netbsd-1-6-PATCH002
Changes since 1.95.2.4: +28 -21 lines
Diff to previous 1.95.2.4 (colored) to branchpoint 1.95 (colored) next main 1.96 (colored)

Pull up revision 1.106 (requested by bouyer in ticket #1356):

Make promiscous mode work on vlans: introduce a new link-layer m_flag
M_PROMISC. In ether_input(), flag packets comming from an interface in
promiscous mode which are not for us M_PROMISC instead of droping them.
Drop M_PROMISC packets which are not passed to vlan_input(). M_PROMISC
packets passed to vlan_input() will be looped back to ether_input()
the M_PROMISC flag will be handled appropriately.
Clear M_PROMISC before giving the packet to bridge, as bridge has its
own checks for local MAC addresses.
This also makes bridges on vlan working.

Revision 1.95.2.4 / (download) - annotate - [select for diffs], Tue Jun 24 08:17:22 2003 UTC (19 years, 7 months ago) by grant
Branch: netbsd-1-6
Changes since 1.95.2.3: +4 -2 lines
Diff to previous 1.95.2.3 (colored) to branchpoint 1.95 (colored)

Apply patch (requested by itojun in ticket #1325):

don't call if_free_sadl() until very end of if_detach() logic.  many of
routing table manipulation code assumes the presense of AF_LINK sockaddr.
should fix PR 21581

Revision 1.112 / (download) - annotate - [select for diffs], Mon Jun 23 11:02:10 2003 UTC (19 years, 7 months ago) by martin
Branch: MAIN
Branch point for: ktrace-lwp
Changes since 1.111: +4 -2 lines
Diff to previous 1.111 (colored)

Make sure to include opt_foo.h if a defflag option FOO is used.

Revision 1.111 / (download) - annotate - [select for diffs], Wed Jun 11 10:44:10 2003 UTC (19 years, 8 months ago) by martin
Branch: MAIN
Changes since 1.110: +3 -3 lines
Diff to previous 1.110 (colored)

Add NETATALK to the list to check if we bail because no ARP is configured.

Revision 1.110 / (download) - annotate - [select for diffs], Wed Jun 11 10:34:55 2003 UTC (19 years, 8 months ago) by martin
Branch: MAIN
Changes since 1.109: +3 -3 lines
Diff to previous 1.109 (colored)

Fix typpo in #error message. Noted by Pawel Chwalowski in PR 21853.

Revision 1.95.2.3 / (download) - annotate - [select for diffs], Mon Jun 2 14:49:47 2003 UTC (19 years, 8 months ago) by tron
Branch: netbsd-1-6
Changes since 1.95.2.2: +7 -0 lines
Diff to previous 1.95.2.2 (colored) to branchpoint 1.95 (colored)

Pull up revision 1.105 (requested by aymeric in ticket #1188):
ignore multicast PPPoE packets ASAP.
This improves performance a lot on slow machines behind a cable modem.
Protect it with PPPOE_SERVER as a reminder that this will have to be changed
if we add PPPoE server code in the kernel one day.

Revision 1.109 / (download) - annotate - [select for diffs], Fri May 23 10:06:17 2003 UTC (19 years, 8 months ago) by itojun
Branch: MAIN
Changes since 1.108: +4 -2 lines
Diff to previous 1.108 (colored)

don't call if_free_sadl() until very end of if_detach() logic.  many of
routing table manipulation code assumes the presense of AF_LINK sockaddr.
should fix PR 21581

Revision 1.108 / (download) - annotate - [select for diffs], Fri May 16 04:54:55 2003 UTC (19 years, 8 months ago) by itojun
Branch: MAIN
Changes since 1.107: +10 -6 lines
Diff to previous 1.107 (colored)

use strlcpy

Revision 1.107 / (download) - annotate - [select for diffs], Fri May 2 03:15:23 2003 UTC (19 years, 9 months ago) by itojun
Branch: MAIN
Changes since 1.106: +3 -3 lines
Diff to previous 1.106 (colored)

KNF

Revision 1.106 / (download) - annotate - [select for diffs], Tue Mar 25 13:29:39 2003 UTC (19 years, 10 months ago) by bouyer
Branch: MAIN
Changes since 1.105: +28 -21 lines
Diff to previous 1.105 (colored)

Make promiscous mode work on vlans: introduce a new link-layer m_flag
M_PROMISC. In ether_input(), flag packets comming from an interface in
promiscous mode which are not for us M_PROMISC instead of droping them.
Drop M_PROMISC packets which are not passed to vlan_input(). M_PROMISC
packets passed to vlan_input() will be looped back to ether_input()
the M_PROMISC flag will be handled appropriately.
Clear M_PROMISC before giving the packet to bridge, as bridge has its own
checks for local MAC addresses.
This also makes bridges on vlan working.

Revision 1.105 / (download) - annotate - [select for diffs], Sun Mar 2 10:50:14 2003 UTC (19 years, 11 months ago) by aymeric
Branch: MAIN
Changes since 1.104: +9 -2 lines
Diff to previous 1.104 (colored)

ignore multicast PPPoE packets ASAP.
This improves performance a lot on slow machines behind a cable modem.
Protect it with PPPOE_SERVER as a reminder that this will have to be changed
if we add PPPoE server code in the kernel one day.

Revision 1.104 / (download) - annotate - [select for diffs], Wed Feb 26 06:31:12 2003 UTC (19 years, 11 months ago) by matt
Branch: MAIN
Changes since 1.103: +22 -3 lines
Diff to previous 1.103 (colored)

Add MBUFTRACE kernel option.
Do a little mbuf rework while here.  Change all uses of MGET*(*, M_WAIT, *)
to m_get*(M_WAIT, *).  These are not performance critical and making them
call m_get saves considerable space.  Add m_clget analogue of MCLGET and
make corresponding change for M_WAIT uses.
Modify netinet, gem, fxp, tulip, nfs to support MBUFTRACE.
Begin to change netstat to use sysctl.

Revision 1.103 / (download) - annotate - [select for diffs], Mon Feb 3 23:51:03 2003 UTC (20 years ago) by thorpej
Branch: MAIN
Changes since 1.102: +3 -3 lines
Diff to previous 1.102 (colored)

Test callout_pending(), not callout_active(), and eliminate now-unnecessary
callout_deactivate() calls.

Revision 1.95.2.2 / (download) - annotate - [select for diffs], Sun Jan 26 10:32:57 2003 UTC (20 years ago) by jmc
Branch: netbsd-1-6
CVS Tags: netbsd-1-6-PATCH001-RELEASE, netbsd-1-6-PATCH001-RC3, netbsd-1-6-PATCH001-RC2, netbsd-1-6-PATCH001-RC1, netbsd-1-6-PATCH001
Changes since 1.95.2.1: +2 -2 lines
Diff to previous 1.95.2.1 (colored) to branchpoint 1.95 (colored)

Pullup revisions 1.101-1.102 (requested by jmmv in ticket #1102)
 Fix typo: realy -> really.  Okay'ed by wiz.

Revision 1.102 / (download) - annotate - [select for diffs], Wed Jan 22 11:47:05 2003 UTC (20 years ago) by jmmv
Branch: MAIN
Changes since 1.101: +4 -4 lines
Diff to previous 1.101 (colored)

Fix typo: realy -> really.  Okay'ed by wiz.

Revision 1.75.2.13 / (download) - annotate - [select for diffs], Fri Jan 17 16:37:16 2003 UTC (20 years ago) by thorpej
Branch: nathanw_sa
CVS Tags: nathanw_sa_end
Changes since 1.75.2.12: +4 -4 lines
Diff to previous 1.75.2.12 (colored) next main 1.76 (colored)

Sync with HEAD.

Revision 1.101 / (download) - annotate - [select for diffs], Fri Jan 17 08:11:55 2003 UTC (20 years ago) by itojun
Branch: MAIN
CVS Tags: nathanw_sa_before_merge, nathanw_sa_base
Changes since 1.100: +4 -4 lines
Diff to previous 1.100 (colored)

switch from kame-based m_aux mbuf auxiliary data, to openbsd m_tag
implementation.  it will simplify porting across *bsd (such as kame/altq),
and make us more synchronized.  from Joel Wilsson

Revision 1.75.2.12 / (download) - annotate - [select for diffs], Wed Jan 15 18:59:03 2003 UTC (20 years ago) by thorpej
Branch: nathanw_sa
Changes since 1.75.2.11: +3 -3 lines
Diff to previous 1.75.2.11 (colored)

Sync with HEAD.

Revision 1.100 / (download) - annotate - [select for diffs], Sun Jan 12 12:26:23 2003 UTC (20 years ago) by jdolecek
Branch: MAIN
Changes since 1.99: +3 -3 lines
Diff to previous 1.99 (colored)

Ethernet multicast entries are malloc'd M_IFMADDR, and thus should
be freed as M_IFMADDR too.
Fix supplied in PR kern/19037 by Sean Boudreau

Revision 1.95.2.1 / (download) - annotate - [select for diffs], Tue Nov 19 21:08:12 2002 UTC (20 years, 2 months ago) by tron
Branch: netbsd-1-6
Changes since 1.95: +17 -4 lines
Diff to previous 1.95 (colored)

Pull up revision 1.96-1.97 (requested by thorpej in ticket #702):
In ether_output(), don't bother calling memcpy() to plop the ethertype
into the packet: On system with no strict alignment constraints, just
assign the value, and on others, do an inline 2 byte copy.

Revision 1.86.2.6 / (download) - annotate - [select for diffs], Thu Oct 10 18:43:40 2002 UTC (20 years, 4 months ago) by jdolecek
Branch: kqueue
Changes since 1.86.2.5: +3 -3 lines
Diff to previous 1.86.2.5 (colored) next main 1.87 (colored)

sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work

Revision 1.75.2.11 / (download) - annotate - [select for diffs], Tue Sep 17 21:22:46 2002 UTC (20 years, 4 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.75.2.10: +1 -1 lines
Diff to previous 1.75.2.10 (colored)

Catch up to -current.

Revision 1.99 / (download) - annotate - [select for diffs], Wed Sep 11 05:36:26 2002 UTC (20 years, 5 months ago) by itojun
Branch: MAIN
CVS Tags: kqueue-beforemerge, kqueue-base, kqueue-aftermerge, gmcgarry_ucred_base, gmcgarry_ucred, gmcgarry_ctxsw_base, gmcgarry_ctxsw, fvdl_fs64_base
Changes since 1.98: +3 -3 lines
Diff to previous 1.98 (colored)

KNF - return is not a function.

Revision 1.86.2.5 / (download) - annotate - [select for diffs], Fri Sep 6 08:48:51 2002 UTC (20 years, 5 months ago) by jdolecek
Branch: kqueue
Changes since 1.86.2.4: +19 -6 lines
Diff to previous 1.86.2.4 (colored)

sync kqueue branch with HEAD

Revision 1.94.2.2 / (download) - annotate - [select for diffs], Thu Aug 29 00:56:41 2002 UTC (20 years, 5 months ago) by gehenna
Branch: gehenna-devsw
Changes since 1.94.2.1: +19 -6 lines
Diff to previous 1.94.2.1 (colored) next main 1.95 (colored)

catch up with -current.

Revision 1.75.2.10 / (download) - annotate - [select for diffs], Mon Aug 26 20:29:43 2002 UTC (20 years, 5 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.75.2.9: +5 -5 lines
Diff to previous 1.75.2.9 (colored)

Sync with rev 1.98 of -current.

Revision 1.98 / (download) - annotate - [select for diffs], Mon Aug 26 01:39:39 2002 UTC (20 years, 5 months ago) by thorpej
Branch: MAIN
CVS Tags: gehenna-devsw-base
Changes since 1.97: +4 -4 lines
Diff to previous 1.97 (colored)

Fix some signed/unsigned comparison warnings from GCC 3.3.

Revision 1.97 / (download) - annotate - [select for diffs], Tue Aug 20 03:32:08 2002 UTC (20 years, 5 months ago) by kristerw
Branch: MAIN
Changes since 1.96: +3 -3 lines
Diff to previous 1.96 (colored)

Make it compile for the __NO_STRICT_ALIGNMENT case.

Revision 1.75.2.9 / (download) - annotate - [select for diffs], Mon Aug 19 22:25:45 2002 UTC (20 years, 5 months ago) by thorpej
Branch: nathanw_sa
Changes since 1.75.2.8: +17 -4 lines
Diff to previous 1.75.2.8 (colored)

Sync with trunk.

Revision 1.96 / (download) - annotate - [select for diffs], Mon Aug 19 18:58:50 2002 UTC (20 years, 5 months ago) by thorpej
Branch: MAIN
Changes since 1.95: +17 -4 lines
Diff to previous 1.95 (colored)

In ether_output(), don't bother calling memcpy() to plop the ethertype
into the packet: On system with no strict alignment constraints, just
assign the value, and on others, do an inline 2 byte copy.

Revision 1.86.2.4 / (download) - annotate - [select for diffs], Sun Jun 23 17:50:23 2002 UTC (20 years, 7 months ago) by jdolecek
Branch: kqueue
Changes since 1.86.2.3: +17 -6 lines
Diff to previous 1.86.2.3 (colored)

catch up with -current on kqueue branch

Revision 1.75.2.8 / (download) - annotate - [select for diffs], Thu Jun 20 03:48:10 2002 UTC (20 years, 7 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.75.2.7: +9 -6 lines
Diff to previous 1.75.2.7 (colored)

Catch up to -current.

Revision 1.94.2.1 / (download) - annotate - [select for diffs], Thu May 30 13:52:24 2002 UTC (20 years, 8 months ago) by gehenna
Branch: gehenna-devsw
Changes since 1.94: +8 -5 lines
Diff to previous 1.94 (colored)

Catch up with -current.

Revision 1.95 / (download) - annotate - [select for diffs], Sat May 18 22:52:44 2002 UTC (20 years, 8 months ago) by itojun
Branch: MAIN
CVS Tags: netbsd-1-6-base, netbsd-1-6-RELEASE, netbsd-1-6-RC3, netbsd-1-6-RC2, netbsd-1-6-RC1
Branch point for: netbsd-1-6
Changes since 1.94: +8 -5 lines
Diff to previous 1.94 (colored)

sync with KAME.
- make altq_etherclassify() able to handle packets whose ethernet header
  is in a separate mbuf.  closes netbsd PR 16559

Revision 1.94 / (download) - annotate - [select for diffs], Sat Apr 27 02:38:47 2002 UTC (20 years, 9 months ago) by enami
Branch: MAIN
Branch point for: gehenna-devsw
Changes since 1.93: +3 -3 lines
Diff to previous 1.93 (colored)

Use ETHER_HDR_LEN instead of 14.

Revision 1.75.2.7 / (download) - annotate - [select for diffs], Wed Apr 17 00:06:23 2002 UTC (20 years, 9 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.75.2.6: +8 -0 lines
Diff to previous 1.75.2.6 (colored)

Catch up to -current.

Revision 1.93 / (download) - annotate - [select for diffs], Sun Apr 7 07:05:37 2002 UTC (20 years, 10 months ago) by martin
Branch: MAIN
Changes since 1.92: +10 -2 lines
Diff to previous 1.92 (colored)

XXX Explicitly make this fail to compile with a proper warning if we
do not have ARP configured.

This can be caused by configurations including bridge, ppppoe or vlan but
no ethernet interfaces - which does not make sense. We should add a way
to config(8) to issue this kind of warnings.

Revision 1.75.2.6 / (download) - annotate - [select for diffs], Mon Apr 1 07:48:20 2002 UTC (20 years, 10 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.75.2.5: +13 -7 lines
Diff to previous 1.75.2.5 (colored)

Catch up to -current.
(CVS: It's not just a program. It's an adventure!)

Revision 1.86.2.3 / (download) - annotate - [select for diffs], Sat Mar 16 16:02:04 2002 UTC (20 years, 10 months ago) by jdolecek
Branch: kqueue
Changes since 1.86.2.2: +15 -9 lines
Diff to previous 1.86.2.2 (colored)

Catch up with -current.

Revision 1.92 / (download) - annotate - [select for diffs], Tue Mar 5 04:13:00 2002 UTC (20 years, 11 months ago) by itojun
Branch: MAIN
CVS Tags: newlock-base, newlock, eeh-devprop-base, eeh-devprop
Changes since 1.91: +4 -2 lines
Diff to previous 1.91 (colored)

bring in latest ALTQ from kjc.  ALTQify some of the drivers.

Revision 1.91 / (download) - annotate - [select for diffs], Thu Feb 28 19:23:03 2002 UTC (20 years, 11 months ago) by thorpej
Branch: MAIN
CVS Tags: ifpoll-base
Changes since 1.90: +13 -9 lines
Diff to previous 1.90 (colored)

Don't call m_aux_find() to find a VLAN tag unless VLANs are configured
on the interface.

Revision 1.86.2.2 / (download) - annotate - [select for diffs], Thu Jan 10 20:02:03 2002 UTC (21 years, 1 month ago) by thorpej
Branch: kqueue
Changes since 1.86.2.1: +4 -6 lines
Diff to previous 1.86.2.1 (colored)

Sync kqueue branch with -current.

Revision 1.75.2.5 / (download) - annotate - [select for diffs], Wed Nov 14 19:17:20 2001 UTC (21 years, 2 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.75.2.4: +4 -1 lines
Diff to previous 1.75.2.4 (colored)

Catch up to -current.

Revision 1.90 / (download) - annotate - [select for diffs], Mon Nov 12 23:49:37 2001 UTC (21 years, 2 months ago) by lukem
Branch: MAIN
Changes since 1.89: +4 -1 lines
Diff to previous 1.89 (colored)

add RCSIDs

Revision 1.75.2.4 / (download) - annotate - [select for diffs], Mon Oct 22 20:41:54 2001 UTC (21 years, 3 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.75.2.3: +1 -6 lines
Diff to previous 1.75.2.3 (colored)

Catch up to -current.

Revision 1.89 / (download) - annotate - [select for diffs], Wed Oct 17 08:23:05 2001 UTC (21 years, 3 months ago) by itojun
Branch: MAIN
CVS Tags: thorpej-mips-cache-base, thorpej-mips-cache
Changes since 1.88: +1 -6 lines
Diff to previous 1.88 (colored)

unifdef OLDIP6OUTPUT

Revision 1.75.2.3 / (download) - annotate - [select for diffs], Fri Aug 24 00:12:09 2001 UTC (21 years, 5 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.75.2.2: +11 -4 lines
Diff to previous 1.75.2.2 (colored)

Catch up with -current.

Revision 1.86.2.1 / (download) - annotate - [select for diffs], Fri Aug 3 04:13:49 2001 UTC (21 years, 6 months ago) by lukem
Branch: kqueue
Changes since 1.86: +7 -2 lines
Diff to previous 1.86 (colored)

update to -current

Revision 1.88 / (download) - annotate - [select for diffs], Wed Jul 25 03:18:46 2001 UTC (21 years, 6 months ago) by thorpej
Branch: MAIN
CVS Tags: thorpej-devvp-base3, thorpej-devvp-base2, thorpej-devvp-base, thorpej-devvp, pre-chs-ubcperf, post-chs-ubcperf
Changes since 1.87: +6 -5 lines
Diff to previous 1.87 (colored)

Duh, braino in last -- only kick the interface if we actually set
the MTU.

Revision 1.87 / (download) - annotate - [select for diffs], Wed Jul 25 03:05:33 2001 UTC (21 years, 6 months ago) by thorpej
Branch: MAIN
Changes since 1.86: +5 -1 lines
Diff to previous 1.86 (colored)

If we change the MTU, kick the interface; it may have to reprogram
registers for the new MTU.

Revision 1.86 / (download) - annotate - [select for diffs], Fri Jun 29 18:12:09 2001 UTC (21 years, 7 months ago) by thorpej
Branch: MAIN
Branch point for: kqueue
Changes since 1.85: +5 -3 lines
Diff to previous 1.85 (colored)

When setting an address on an interface, for address families which
do not require changing the link-level address, only (*if_init)()
if the interface is not already RUNNING.

Revision 1.75.2.2 / (download) - annotate - [select for diffs], Thu Jun 21 20:08:00 2001 UTC (21 years, 7 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.75.2.1: +146 -23 lines
Diff to previous 1.75.2.1 (colored)

Catch up to -current.

Revision 1.85 / (download) - annotate - [select for diffs], Thu Jun 14 05:44:24 2001 UTC (21 years, 7 months ago) by itojun
Branch: MAIN
Changes since 1.84: +1 -3 lines
Diff to previous 1.84 (colored)

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.

Revision 1.84 / (download) - annotate - [select for diffs], Tue Jun 12 15:03:26 2001 UTC (21 years, 7 months ago) by thorpej
Branch: MAIN
Changes since 1.83: +21 -9 lines
Diff to previous 1.83 (colored)

On a non-simplex interface, check incoming multicast (this catches
the broadcast case as well) to see if they came from us, and drop
them if they did.

This fixed IPv6 DAD on non-simplex interfaces, e.g. the Seeq 8003
found on my SGI Indy.

Revision 1.58.2.2 / (download) - annotate - [select for diffs], Thu Jun 7 17:00:32 2001 UTC (21 years, 8 months ago) by he
Branch: netbsd-1-5
CVS Tags: netbsd-1-5-PATCH003, netbsd-1-5-PATCH002, netbsd-1-5-PATCH001
Changes since 1.58.2.1: +5 -3 lines
Diff to previous 1.58.2.1 (colored) to branchpoint 1.58 (colored) next main 1.59 (colored)

Pull up revision 1.83 (via patch, requested by thorpej):
  Consider the configured MTU of the interface when determining
  if a packet is too large.

Revision 1.83 / (download) - annotate - [select for diffs], Sun Jun 3 03:24:23 2001 UTC (21 years, 8 months ago) by thorpej
Branch: MAIN
Changes since 1.82: +3 -2 lines
Diff to previous 1.82 (colored)

Consider the configured MTU of the interface when determining
if a packet is too large.

Revision 1.82 / (download) - annotate - [select for diffs], Sun Jun 3 03:07:39 2001 UTC (21 years, 8 months ago) by thorpej
Branch: MAIN
Changes since 1.81: +11 -2 lines
Diff to previous 1.81 (colored)

Add a capability bit that indicates support for Gigabit Ethernet
jumbo frames, and use it in SIOCSIFMTU.

Revision 1.81 / (download) - annotate - [select for diffs], Sun Apr 29 09:50:37 2001 UTC (21 years, 9 months ago) by martin
Branch: MAIN
Changes since 1.80: +29 -1 lines
Diff to previous 1.80 (colored)

Add an in-kernel PPPoE (ppp over ethernet, RFC 2516) implementation,
based on the existing net/if_spppsubr.c stuff.

While there are completely userland (bpf based) implementations available,
those have a vastly larger per packet overhead thus causing major CPU
overhead and higher latency. On an i386 base router, running a 486DX at 50MHz
my line (768kBit/s downstream) was limited to something (varying) between 10
and 20 kByte/s effective download rate. With this implementation I get full
bandwidth (~85kByte/s).

This is client side only. Arguably the right way to add full PPPoE support
(including server side) would be a variation of the ppp line discipline and
appropriate modifications to pppd. I promise every help I can give to anyone
doing that - but I needed this realy fast. Besids, on low memory NAT boxes
with typically a single PPPoE connection, this implementation is more
lightweight than a pppd based one, which nicely fits my needs.

Revision 1.80 / (download) - annotate - [select for diffs], Fri Apr 27 00:14:02 2001 UTC (21 years, 9 months ago) by marcus
Branch: MAIN
Changes since 1.79: +2 -2 lines
Diff to previous 1.79 (colored)

STDC cleanup: label not allowed just before end of block.

Revision 1.50.2.6 / (download) - annotate - [select for diffs], Sat Apr 21 17:46:38 2001 UTC (21 years, 9 months ago) by bouyer
Branch: thorpej_scsipi
Changes since 1.50.2.5: +178 -16 lines
Diff to previous 1.50.2.5 (colored) to branchpoint 1.50 (colored) next main 1.51 (colored)

Sync with HEAD

Revision 1.79 / (download) - annotate - [select for diffs], Fri Apr 13 23:30:12 2001 UTC (21 years, 9 months ago) by thorpej
Branch: MAIN
CVS Tags: thorpej_scsipi_nbase, thorpej_scsipi_beforemerge, thorpej_scsipi_base
Changes since 1.78: +15 -7 lines
Diff to previous 1.78 (colored)

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.

Revision 1.78 / (download) - annotate - [select for diffs], Wed Apr 11 03:47:24 2001 UTC (21 years, 10 months ago) by thorpej
Branch: MAIN
Changes since 1.77: +58 -15 lines
Diff to previous 1.77 (colored)

Add hooks for bridging.

Revision 1.77 / (download) - annotate - [select for diffs], Tue Apr 10 21:47:36 2001 UTC (21 years, 10 months ago) by thorpej
Branch: MAIN
Changes since 1.76: +31 -7 lines
Diff to previous 1.76 (colored)

Process pfil hooks for Ethernet input and output.

Revision 1.75.2.1 / (download) - annotate - [select for diffs], Mon Apr 9 01:58:11 2001 UTC (21 years, 10 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.75: +88 -1 lines
Diff to previous 1.75 (colored)

Catch up with -current.

Revision 1.76 / (download) - annotate - [select for diffs], Sat Apr 7 18:01:48 2001 UTC (21 years, 10 months ago) by thorpej
Branch: MAIN
Changes since 1.75: +88 -1 lines
Diff to previous 1.75 (colored)

Add altq_etherclassify(), a slight hack modified from the kame/freebsd4
tree, which allows a packet with Ethernet headers already present to
run through the ALTQ packet classifier.  This is needed in order to
suport ALTQ on VLAN and bridge devices.

Revision 1.50.2.5 / (download) - annotate - [select for diffs], Thu Jan 18 09:23:49 2001 UTC (22 years ago) by bouyer
Branch: thorpej_scsipi
Changes since 1.50.2.4: +24 -12 lines
Diff to previous 1.50.2.4 (colored) to branchpoint 1.50 (colored)

Sync with head (for UBC+NFS fixes, mostly).

Revision 1.75 / (download) - annotate - [select for diffs], Wed Jan 17 00:30:51 2001 UTC (22 years ago) by thorpej
Branch: MAIN
Branch point for: nathanw_sa
Changes since 1.74: +25 -13 lines
Diff to previous 1.74 (colored)

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).

Revision 1.50.2.4 / (download) - annotate - [select for diffs], Fri Jan 5 17:36:49 2001 UTC (22 years, 1 month ago) by bouyer
Branch: thorpej_scsipi
Changes since 1.50.2.3: +23 -10 lines
Diff to previous 1.50.2.3 (colored) to branchpoint 1.50 (colored)

Sync with HEAD

Revision 1.58.2.1 / (download) - annotate - [select for diffs], Sun Dec 31 20:14:28 2000 UTC (22 years, 1 month ago) by jhawk
Branch: netbsd-1-5
Changes since 1.58: +124 -84 lines
Diff to previous 1.58 (colored)

Pull up revisions 1.59-1.60, 1.62-1.65, 1.70 via patch (requested by bouyer):
	Add support for 802.1Q virtual LANs.

Revision 1.74 / (download) - annotate - [select for diffs], Tue Dec 26 23:54:34 2000 UTC (22 years, 1 month ago) by augustss
Branch: MAIN
Changes since 1.73: +5 -4 lines
Diff to previous 1.73 (colored)

Simplify case statement a tiny bit.

Revision 1.73 / (download) - annotate - [select for diffs], Mon Dec 18 19:44:33 2000 UTC (22 years, 1 month ago) by thorpej
Branch: MAIN
Changes since 1.72: +2 -1 lines
Diff to previous 1.72 (colored)

Fill in if_dlt.

Revision 1.72 / (download) - annotate - [select for diffs], Wed Dec 13 22:07:50 2000 UTC (22 years, 1 month ago) by thorpej
Branch: MAIN
Changes since 1.71: +19 -8 lines
Diff to previous 1.71 (colored)

Add ALTQ glue.

Revision 1.50.2.3 / (download) - annotate - [select for diffs], Wed Dec 13 15:50:30 2000 UTC (22 years, 1 month ago) by bouyer
Branch: thorpej_scsipi
Changes since 1.50.2.2: +1 -1 lines
Diff to previous 1.50.2.2 (colored) to branchpoint 1.50 (colored)

Sync with HEAD (for UBC fixes).

Revision 1.71 / (download) - annotate - [select for diffs], Tue Dec 12 18:00:25 2000 UTC (22 years, 1 month ago) by thorpej
Branch: MAIN
Changes since 1.70: +2 -2 lines
Diff to previous 1.70 (colored)

Adapt to bpfattach() changes, and further centralize the bpfattach()
and bpfdetach() calls into link-type subroutines where possible.

Revision 1.50.2.2 / (download) - annotate - [select for diffs], Wed Nov 22 16:05:50 2000 UTC (22 years, 2 months ago) by bouyer
Branch: thorpej_scsipi
Changes since 1.50.2.1: +30 -1 lines
Diff to previous 1.50.2.1 (colored) to branchpoint 1.50 (colored)

Sync with HEAD.

Revision 1.50.2.1 / (download) - annotate - [select for diffs], Mon Nov 20 18:10:00 2000 UTC (22 years, 2 months ago) by bouyer
Branch: thorpej_scsipi
Changes since 1.50: +300 -114 lines
Diff to previous 1.50 (colored)

Update thorpej_scsipi to -current as of a month ago

Revision 1.70 / (download) - annotate - [select for diffs], Fri Nov 17 19:21:53 2000 UTC (22 years, 2 months ago) by bouyer
Branch: MAIN
Changes since 1.69: +18 -1 lines
Diff to previous 1.69 (colored)

Supports hardware 802.1q VLAN tagging, per discussion on tech-net. The tag is
stored in a m_aux mbuf defined by AF_LINK, ETHERTYPE_VLAN.
Thanks to Jason & Itojun for the feedback.

Revision 1.69 / (download) - annotate - [select for diffs], Wed Nov 15 01:02:15 2000 UTC (22 years, 2 months ago) by thorpej
Branch: MAIN
Changes since 1.68: +13 -1 lines
Diff to previous 1.68 (colored)

Move bpfattach()/bpfdetach() calls into ether_ifattach()/ether_ifdetach().

Revision 1.68 / (download) - annotate - [select for diffs], Sun Oct 15 19:49:55 2000 UTC (22 years, 3 months ago) by matt
Branch: MAIN
Changes since 1.67: +3 -2 lines
Diff to previous 1.67 (colored)

When discarding oversized frame, say how long it was.

Revision 1.67 / (download) - annotate - [select for diffs], Sun Oct 15 15:39:11 2000 UTC (22 years, 3 months ago) by itojun
Branch: MAIN
Changes since 1.66: +2 -3 lines
Diff to previous 1.66 (colored)

suppress warning on nd6_storelladdr failure.  the failure could happen
easily when we have routing table with too many entries.  sync with kame.

Revision 1.66 / (download) - annotate - [select for diffs], Wed Oct 11 16:53:41 2000 UTC (22 years, 3 months ago) by thorpej
Branch: MAIN
Changes since 1.65: +95 -2 lines
Diff to previous 1.65 (colored)

Implement ether_ioctl(), ioctl operations common to all Ethernet
interfaces.

Revision 1.65 / (download) - annotate - [select for diffs], Wed Oct 4 07:01:52 2000 UTC (22 years, 4 months ago) by enami
Branch: MAIN
Changes since 1.64: +3 -1 lines
Diff to previous 1.64 (colored)

Free mbuf when dropping VLAN frame due to no configured vlan interface.

Revision 1.64 / (download) - annotate - [select for diffs], Tue Oct 3 23:50:52 2000 UTC (22 years, 4 months ago) by thorpej
Branch: MAIN
Changes since 1.63: +6 -1 lines
Diff to previous 1.63 (colored)

When an Ethernet interface detaches, unconfigure any VLANs associated
with it.

Revision 1.63 / (download) - annotate - [select for diffs], Tue Oct 3 23:33:38 2000 UTC (22 years, 4 months ago) by thorpej
Branch: MAIN
Changes since 1.62: +28 -5 lines
Diff to previous 1.62 (colored)

Improve the VLAN support, in particular, handling of MTU:
- Add a macro to compute the max frame length based on Ethertype
  and presence of FCS, and use it to validate the packet size
  in ether_input().
- Add capabilites to struct ethercom, and allow hardware drivers
  to specify that they can handle the larger hardware MTU that
  VLANs require in order to strictly conform to 802.1Q.
- Make ether_ifdetach() clear out the link address and free all of
  the Ethernet multicast structures.

Also, rearrange the VLAN driver itself in preparation to supporting
other hardware types, including FDDI (which has 802.1Q VLAN capability).

Revision 1.62 / (download) - annotate - [select for diffs], Sun Oct 1 23:43:44 2000 UTC (22 years, 4 months ago) by thorpej
Branch: MAIN
Changes since 1.61: +4 -12 lines
Diff to previous 1.61 (colored)

Make the previous code path simpler (and possible easier for the
compiler to optimize), based on fddi_input().

Revision 1.61 / (download) - annotate - [select for diffs], Sun Oct 1 23:32:45 2000 UTC (22 years, 4 months ago) by thorpej
Branch: MAIN
Changes since 1.60: +16 -4 lines
Diff to previous 1.60 (colored)

Move the check for "promisc + unicast + not for us" into ether_input(),
and change Ethernet drivers to always pass all received frames to
ether_input() (with a few exceptions, which are documented in the
code).

Revision 1.60 / (download) - annotate - [select for diffs], Thu Sep 28 07:15:28 2000 UTC (22 years, 4 months ago) by enami
Branch: MAIN
Changes since 1.59: +46 -79 lines
Diff to previous 1.59 (colored)

Factor out and give a name to the common functionality to translate
sockaddr which represents a multicast address into an Ethernet address
or range of Etherenet addresses.

Revision 1.59 / (download) - annotate - [select for diffs], Wed Sep 27 22:58:21 2000 UTC (22 years, 4 months ago) by thorpej
Branch: MAIN
Changes since 1.58: +23 -1 lines
Diff to previous 1.58 (colored)

Glue VLANs into ether_input().

Revision 1.56.2.1 / (download) - annotate - [select for diffs], Thu Jun 22 17:09:41 2000 UTC (22 years, 7 months ago) by minoura
Branch: minoura-xpg4dl
Changes since 1.56: +14 -33 lines
Diff to previous 1.56 (colored) next main 1.57 (colored)

Sync w/ netbsd-1-5-base.

Revision 1.58 / (download) - annotate - [select for diffs], Sat Jun 17 20:57:20 2000 UTC (22 years, 7 months ago) by matt
Branch: MAIN
CVS Tags: netbsd-1-5-base, netbsd-1-5-RELEASE, netbsd-1-5-BETA2, netbsd-1-5-BETA, netbsd-1-5-ALPHA2
Branch point for: netbsd-1-5
Changes since 1.57: +12 -31 lines
Diff to previous 1.57 (colored)

Ansify before committing my next change.

Revision 1.57 / (download) - annotate - [select for diffs], Wed Jun 14 05:10:27 2000 UTC (22 years, 7 months ago) by mycroft
Branch: MAIN
Changes since 1.56: +3 -3 lines
Diff to previous 1.56 (colored)

Check the multicast bit in the header mbuf while interrupts are still blocked.
Otherwise we can run off into space if the packet was sent immediately and the
mbuf freed.
Pointed out by Boris Popov (not on our lists).

Revision 1.56 / (download) - annotate - [select for diffs], Fri May 12 16:22:36 2000 UTC (22 years, 8 months ago) by thorpej
Branch: MAIN
CVS Tags: minoura-xpg4dl-base
Branch point for: minoura-xpg4dl
Changes since 1.55: +34 -2 lines
Diff to previous 1.55 (colored)

- Fix a bug in the double-loop version of ether_crc32_le() -- we're not't
  supposed to bubble carry through.
- Disable the double-loop version of ether_crc32_le() and add a
  table-driven version of ether_crc32_le() -- the table-driven
  version is faster.

Revision 1.55 / (download) - annotate - [select for diffs], Wed Apr 12 10:36:43 2000 UTC (22 years, 9 months ago) by itojun
Branch: MAIN
Changes since 1.54: +1 -5 lines
Diff to previous 1.54 (colored)

revisit in6_ifattach().
- be persistent on initializing interfaces, even if there's manually-
  assigned linklocal, multicast/whatever initialization is necessary.
- do not cache mac addr in the kernel.  grab mac addr from existing cards
  (this is important when you swap ethernet cards back and forth)
now ppp6 works just fine!

call in6_ifattach() on ATM PVC interface to assign link-local, using
hardware MAC address as seed.

(the change is in sync with kame tree).

Revision 1.54 / (download) - annotate - [select for diffs], Mon Mar 6 21:03:46 2000 UTC (22 years, 11 months ago) by thorpej
Branch: MAIN
Changes since 1.53: +3 -2 lines
Diff to previous 1.53 (colored)

On second thought, only set a default baudrate for "ethernet" if one
isn't set already.

Revision 1.53 / (download) - annotate - [select for diffs], Mon Mar 6 20:54:41 2000 UTC (22 years, 11 months ago) by thorpej
Branch: MAIN
Changes since 1.52: +50 -1 lines
Diff to previous 1.52 (colored)

- Initialize ifp->if_baudrate to a sensible value when the interface is
  attached.
- Add ether_crc32_be() and ether_crc_le(), common functions for computing
  the Ethernet CRC on arbitrary length buffers.  Nothing uses them yet,
  and these should be double-checked and probably re-implemented as
  table-driven functions.

Revision 1.52 / (download) - annotate - [select for diffs], Tue Feb 1 22:52:05 2000 UTC (23 years ago) by thorpej
Branch: MAIN
CVS Tags: chs-ubc2-newbase
Changes since 1.51: +9 -1 lines
Diff to previous 1.51 (colored)

First-draft if_detach() implementation, originally from Bill Studnemund,
although this version has been changed somewhat:
- reference counting on ifaddrs isn't as complete as Bill's original
  work was.  This is hard to get right, and we should attack one
  protocol at a time.
- This doesn't do reference counting or dynamic allocation of ifnets yet.
- This version introduces a new PRU -- PRU_PURGEADDR, which is used to
  purge an ifaddr from a protocol.  The old method Bill used didn't work
  on all protocols, and it only worked on some because it was Very Lucky.

This mostly works ... i.e. works for my USB Ethernet, except for a dangling
ifaddr reference left by the IPv6 code; have not yet tracked this down.

Revision 1.49.2.1 / (download) - annotate - [select for diffs], Mon Dec 27 18:36:09 1999 UTC (23 years, 1 month ago) by wrstuden
Branch: wrstuden-devbsize
Changes since 1.49: +13 -8 lines
Diff to previous 1.49 (colored) next main 1.50 (colored)

Pull up to last week's -current.

Revision 1.51 / (download) - annotate - [select for diffs], Mon Dec 13 15:17:19 1999 UTC (23 years, 1 month ago) by itojun
Branch: MAIN
CVS Tags: wrstuden-devbsize-base, wrstuden-devbsize-19991221
Changes since 1.50: +9 -6 lines
Diff to previous 1.50 (colored)

sync IPv6 part with latest KAME tree.   IPsec part is left unmodified
due to massive changes in KAME side.
- IPv6 output goes through nd6_output
- faith can capture IPv4 packets as well - you can run IPv4-to-IPv6 translator
  using heavily modified DNS servers
- per-interface statistics (required for IPv6 MIB)
- interface autoconfig is revisited
- udp input handling has a big change for mapped address support.
- introduce in4_cksum() for non-overwriting checksumming
- introduce m_pulldown()
- neighbor discovery cleanups/improvements
- netinet/in.h strictly conforms to RFC2553 (no extra defs visible to userland)
- IFA_STATS is fixed a bit (not tested)
- and more more more.

TODO:
- cleanup os-independency #ifdef
- avoid rcvif dual use (for IPsec) to help ifdetach

(sorry for jumbo commit, I can't separate this any more...)

Revision 1.41.6.2 / (download) - annotate - [select for diffs], Tue Nov 30 13:35:02 1999 UTC (23 years, 2 months ago) by itojun
Branch: kame
CVS Tags: kame_141_19991130
Changes since 1.41.6.1: +49 -9 lines
Diff to previous 1.41.6.1 (colored) to branchpoint 1.41 (colored) next main 1.42 (colored)

bring in latest KAME (as of 19991130, KAME/NetBSD141) into kame branch
just for reference purposes.
This commit includes 1.4 -> 1.4.1 sync for kame branch.

The branch does not compile at all (due to the lack of ALTQ and some other
source code).  Please do not try to modify the branch, this is just for
referenre purposes.

synchronization to latest KAME will take place on HEAD branch soon.

Revision 1.50 / (download) - annotate - [select for diffs], Tue Oct 12 04:53:45 1999 UTC (23 years, 4 months ago) by matt
Branch: MAIN
CVS Tags: fvdl-softdep-base, fvdl-softdep, comdex-fall-1999-base, comdex-fall-1999
Branch point for: thorpej_scsipi
Changes since 1.49: +5 -3 lines
Diff to previous 1.49 (colored)

Fix appletalk over ethernet.

Revision 1.49 / (download) - annotate - [select for diffs], Tue Sep 21 22:18:51 1999 UTC (23 years, 4 months ago) by matt
Branch: MAIN
Branch point for: wrstuden-devbsize
Changes since 1.48: +4 -5 lines
Diff to previous 1.48 (colored)

Make NETATALK over FDDI.

Revision 1.48 / (download) - annotate - [select for diffs], Wed Sep 15 20:48:19 1999 UTC (23 years, 4 months ago) by is
Branch: MAIN
Changes since 1.47: +3 -1 lines
Diff to previous 1.47 (colored)

We only need the ether_ipmulticast_min and _max addresses if we have INET
compiled in.

Revision 1.47 / (download) - annotate - [select for diffs], Mon Sep 13 12:15:54 1999 UTC (23 years, 4 months ago) by itojun
Branch: MAIN
Changes since 1.46: +7 -3 lines
Diff to previous 1.46 (colored)

- Call in{,6}_pcbdetach if ipsec initialization is failed during PRU_ATTACH.
  This situation happens on severe memory shortage.  We may need more
  improvements here and there.
- Grab IEEE802 address from IFT_ETHER card, even if the card is
  inserted after bootup time.  Is there any other card that can be
  inserted afterwards?  pcmcia fddi card? :-P
- RFC2373 u bit handling suggests that we SHOULD NOT copy interface id from
  ethernet card to pseudo interface, when ethernet card has IEEE802/EUI64
  with u bit != 0 (this means that IEEE802/EUI64 is not universally unique).
  Do not use such address as, for example, interface id for gif interface.
  (I have such an ethernet card myself)
  This may change interface id for your gif interface.  be careful upgrading
  rc files.

(sync with recent KAME)

Revision 1.46 / (download) - annotate - [select for diffs], Thu Aug 5 02:07:39 1999 UTC (23 years, 6 months ago) by thorpej
Branch: MAIN
Changes since 1.45: +2 -2 lines
Diff to previous 1.45 (colored)

M_HASCRC -> M_HASFCS, as suggested by Christoph Badura.

Revision 1.45 / (download) - annotate - [select for diffs], Wed Aug 4 19:29:01 1999 UTC (23 years, 6 months ago) by thorpej
Branch: MAIN
Changes since 1.44: +5 -1 lines
Diff to previous 1.44 (colored)

In ether_input(), if M_HASCRC is set, trim the CRC off the packet.

Revision 1.41.4.2 / (download) - annotate - [select for diffs], Thu Jul 1 23:45:19 1999 UTC (23 years, 7 months ago) by thorpej
Branch: chs-ubc2
Changes since 1.41.4.1: +104 -1 lines
Diff to previous 1.41.4.1 (colored) to branchpoint 1.41 (colored) next main 1.42 (colored)

Sync w/ -current.

Revision 1.44 / (download) - annotate - [select for diffs], Thu Jul 1 08:12:48 1999 UTC (23 years, 7 months ago) by itojun
Branch: MAIN
CVS Tags: chs-ubc2-base
Changes since 1.43: +104 -1 lines
Diff to previous 1.43 (colored)

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.

Revision 1.41.6.1 / (download) - annotate - [select for diffs], Mon Jun 28 06:36:55 1999 UTC (23 years, 7 months ago) by itojun
Branch: kame
CVS Tags: kame_14_19990705, kame_14_19990628
Changes since 1.41: +104 -1 lines
Diff to previous 1.41 (colored)

KAME/NetBSD 1.4 SNAP kit, dated 19990628.

NOTE: this branch (kame) is used just for refernce.  this may not compile
due to multiple reasons.

Revision 1.41.2.1 / (download) - annotate - [select for diffs], Thu Jun 24 16:21:13 1999 UTC (23 years, 7 months ago) by perry
Branch: netbsd-1-4
CVS Tags: netbsd-1-4-PATCH003, netbsd-1-4-PATCH002, netbsd-1-4-PATCH001
Changes since 1.41: +2 -2 lines
Diff to previous 1.41 (colored) next main 1.42 (colored)

pullup 1.42->1.43 (bouyer): allocate mbuf with M_DONTWAIT in ether_output()

Revision 1.41.4.1 / (download) - annotate - [select for diffs], Mon Jun 21 01:27:33 1999 UTC (23 years, 7 months ago) by thorpej
Branch: chs-ubc2
Changes since 1.41: +21 -9 lines
Diff to previous 1.41 (colored)

Sync w/ -current.

Revision 1.43 / (download) - annotate - [select for diffs], Thu Jun 17 17:27:13 1999 UTC (23 years, 7 months ago) by bouyer
Branch: MAIN
Changes since 1.42: +2 -2 lines
Diff to previous 1.42 (colored)

mbuf should be allocated with M_DONTWAIT in ether_output(). This caused panics
when routing atalk.

Revision 1.42 / (download) - annotate - [select for diffs], Tue May 18 23:57:20 1999 UTC (23 years, 8 months ago) by thorpej
Branch: MAIN
Changes since 1.41: +20 -8 lines
Diff to previous 1.41 (colored)

Rework layer 2 protocol input routines.  Instead of calling e.g. ether_input()
directly, call the function pointer (*if_input)(ifp, m).  The input routine
expects the packet header to be at the head of the packet, and will adjust
as necessary.  Privatize the layer 2 input and output routines, allowing
*_ifattach() to set them up as appropriate.

Revision 1.41 / (download) - annotate - [select for diffs], Wed Mar 10 21:05:08 1999 UTC (23 years, 11 months ago) by thorpej
Branch: MAIN
CVS Tags: netbsd-1-4-base, netbsd-1-4-RELEASE
Branch point for: netbsd-1-4, kame, chs-ubc2
Changes since 1.40: +3 -3 lines
Diff to previous 1.40 (colored)

Const poison ether_ifattach().

Revision 1.40 / (download) - annotate - [select for diffs], Wed Mar 10 03:28:50 1999 UTC (23 years, 11 months ago) by thorpej
Branch: MAIN
Changes since 1.39: +2 -2 lines
Diff to previous 1.39 (colored)

Const poison ether_sprintf().

Revision 1.38.4.1 / (download) - annotate - [select for diffs], Fri Dec 11 04:53:04 1998 UTC (24 years, 2 months ago) by kenh
Branch: kenh-if-detach
Changes since 1.38: +4 -3 lines
Diff to previous 1.38 (colored) next main 1.39 (colored)

The beginnings of interface detach support.  Still some bugs, but mostly
works for me.

This work was originally by Bill Studenmund, and cleaned up by me.

Revision 1.39 / (download) - annotate - [select for diffs], Thu Dec 10 15:50:54 1998 UTC (24 years, 2 months ago) by christos
Branch: MAIN
Changes since 1.38: +3 -5 lines
Diff to previous 1.38 (colored)

IPX fixes.

Revision 1.38 / (download) - annotate - [select for diffs], Tue Oct 13 02:34:32 1998 UTC (24 years, 3 months ago) by kim
Branch: MAIN
CVS Tags: kenh-if-detach-base, chs-ubc-base, chs-ubc
Branch point for: kenh-if-detach
Changes since 1.37: +5 -5 lines
Diff to previous 1.37 (colored)

Use ETHERTYPE_ATALK instead of ETHERTYPE_AT.  The former seems more common.
Our other constants also use "ATALK".

Added many new ETHERTYPE constants to sys/net/ethertypes.h, including the
ones from libpcap and tcpdump "ethertype.h" files.

Revision 1.37 / (download) - annotate - [select for diffs], Sun Jul 5 06:49:16 1998 UTC (24 years, 7 months ago) by jonathan
Branch: MAIN
CVS Tags: eeh-paddr_t-base, eeh-paddr_t
Changes since 1.36: +2 -1 lines
Diff to previous 1.36 (colored)

defopt NS, NSIP.

Revision 1.36 / (download) - annotate - [select for diffs], Sun Jul 5 04:37:41 1998 UTC (24 years, 7 months ago) by jonathan
Branch: MAIN
Changes since 1.35: +2 -1 lines
Diff to previous 1.35 (colored)

defopt ISO TPIP.

Revision 1.35 / (download) - annotate - [select for diffs], Sun Jul 5 03:14:43 1998 UTC (24 years, 7 months ago) by jonathan
Branch: MAIN
Changes since 1.34: +2 -1 lines
Diff to previous 1.34 (colored)

defopt LLC

Revision 1.34 / (download) - annotate - [select for diffs], Sun Jul 5 02:12:33 1998 UTC (24 years, 7 months ago) by jonathan
Branch: MAIN
Changes since 1.33: +2 -1 lines
Diff to previous 1.33 (colored)

defopt CCITT.

Revision 1.33 / (download) - annotate - [select for diffs], Sun Jul 5 00:51:26 1998 UTC (24 years, 7 months ago) by jonathan
Branch: MAIN
Changes since 1.32: +3 -1 lines
Diff to previous 1.32 (colored)

defopt INET, NETATALK.

Revision 1.32 / (download) - annotate - [select for diffs], Mon May 4 12:54:22 1998 UTC (24 years, 9 months ago) by christos
Branch: MAIN
Changes since 1.31: +24 -1 lines
Diff to previous 1.31 (colored)

Add IPX bits.

Revision 1.31 / (download) - annotate - [select for diffs], Thu Apr 30 00:05:41 1998 UTC (24 years, 9 months ago) by thorpej
Branch: MAIN
Changes since 1.30: +15 -5 lines
Diff to previous 1.30 (colored)

In ether_output(), if the socket address family is pseudo_AF_HDRCMPLT,
use the Ethernet source address speficied in the sockaddr rather than
the interface's Ethernet address, and then fall through to the AF_UNSPEC
case.  From Greg Smith <greg@nas.nasa.gov>.

Revision 1.30 / (download) - annotate - [select for diffs], Wed Apr 29 21:37:53 1998 UTC (24 years, 9 months ago) by matt
Branch: MAIN
Changes since 1.29: +7 -1 lines
Diff to previous 1.29 (colored)

Add support for "fast" forwarding.  Add hooks in if_ethersubr.c and
if_fddisubr.c to fastpath IP forwarding.  If ip_forward successfully
forwards a packet, it will create a cache (ipflow) entry.  ether_input
and fddi_input will first call ipflow_fastforward with the received
packet and if the packet passes enough tests, it will be forwarded (the
ttl is decremented and the cksum is adjusted incrementally).

Revision 1.29 / (download) - annotate - [select for diffs], Sun Apr 26 06:17:20 1998 UTC (24 years, 9 months ago) by mrg
Branch: MAIN
Changes since 1.28: +21 -21 lines
Diff to previous 1.28 (colored)

remove some register.

Revision 1.28 / (download) - annotate - [select for diffs], Tue Mar 24 12:57:15 1998 UTC (24 years, 10 months ago) by kleink
Branch: MAIN
Changes since 1.27: +2 -2 lines
Diff to previous 1.27 (colored)

register -> register int

Revision 1.1.1.3 / (download) - annotate - [select for diffs] (vendor branch), Sun Mar 1 02:56:12 1998 UTC (24 years, 11 months ago) by fvdl
Branch: WFJ-920714, CSRG
CVS Tags: post-lite-2
Changes since 1.1.1.2: +14 -4 lines
Diff to previous 1.1.1.2 (colored)

Import some files that were changed after Lite2

Revision 1.27 / (download) - annotate - [select for diffs], Sun Mar 1 02:25:05 1998 UTC (24 years, 11 months ago) by fvdl
Branch: MAIN
Changes since 1.26: +15 -5 lines
Diff to previous 1.26 (colored)

Merge with Lite2 + local changes

Revision 1.1.1.2 / (download) - annotate - [select for diffs] (vendor branch), Sun Mar 1 02:10:05 1998 UTC (24 years, 11 months ago) by fvdl
Branch: WFJ-920714, CSRG
CVS Tags: lite-2, lite-1, date-03-may-96
Changes since 1.1.1.1: +428 -170 lines
Diff to previous 1.1.1.1 (colored)

Import 4.4BSD-Lite for reference

Revision 1.25.4.1 / (download) - annotate - [select for diffs], Tue Oct 14 10:29:09 1997 UTC (25 years, 3 months ago) by thorpej
Branch: marc-pcmcia
Changes since 1.25: +2 -1 lines
Diff to previous 1.25 (colored) next main 1.26 (colored)

Update marc-pcmcia branch from trunk.

Revision 1.26 / (download) - annotate - [select for diffs], Thu Oct 2 19:41:59 1997 UTC (25 years, 4 months ago) by is
Branch: MAIN
CVS Tags: netbsd-1-3-base, netbsd-1-3-RELEASE, netbsd-1-3-PATCH003-CANDIDATE2, netbsd-1-3-PATCH003-CANDIDATE1, netbsd-1-3-PATCH003-CANDIDATE0, netbsd-1-3-PATCH003, netbsd-1-3-PATCH002, netbsd-1-3-PATCH001, netbsd-1-3-BETA, netbsd-1-3, marc-pcmcia-base
Changes since 1.25: +2 -1 lines
Diff to previous 1.25 (colored)

Reimplement a test for broadcast addresses advertized, which was left out
when rewriting the ARP system.

Revision 1.25 / (download) - annotate - [select for diffs], Thu Apr 3 18:48:28 1997 UTC (25 years, 10 months ago) by christos
Branch: MAIN
CVS Tags: thorpej-signal-base, thorpej-signal, marc-pcmcia-bp, bouyer-scsipi
Branch point for: marc-pcmcia
Changes since 1.24: +2 -2 lines
Diff to previous 1.24 (colored)

Update for argument change in at_ifawithnet

Revision 1.24 / (download) - annotate - [select for diffs], Thu Apr 3 15:25:20 1997 UTC (25 years, 10 months ago) by christos
Branch: MAIN
Changes since 1.23: +7 -1 lines
Diff to previous 1.23 (colored)

PR/3444: Erik Bertelsen: Eliminate warnings when -UINET

Revision 1.23 / (download) - annotate - [select for diffs], Wed Apr 2 21:23:26 1997 UTC (25 years, 10 months ago) by christos
Branch: MAIN
Changes since 1.22: +101 -5 lines
Diff to previous 1.22 (colored)

Add netatalk stubs.

Revision 1.22 / (download) - annotate - [select for diffs], Sat Mar 15 18:12:26 1997 UTC (25 years, 10 months ago) by is
Branch: MAIN
Changes since 1.21: +69 -35 lines
Diff to previous 1.21 (colored)

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.

Revision 1.21.4.5 / (download) - annotate - [select for diffs], Sun Mar 9 20:59:03 1997 UTC (25 years, 11 months ago) by is
Branch: is-newarp
Changes since 1.21.4.4: +2 -2 lines
Diff to previous 1.21.4.4 (colored) to branchpoint 1.21 (colored) next main 1.22 (colored)

netinet/if_ether.h -> netinet/if_inarp.h

Revision 1.21.4.4 / (download) - annotate - [select for diffs], Tue Feb 18 13:27:42 1997 UTC (25 years, 11 months ago) by is
Branch: is-newarp
Changes since 1.21.4.3: +5 -4 lines
Diff to previous 1.21.4.3 (colored) to branchpoint 1.21 (colored)

Having converted everything, remove the struct ether_arp definition completely.
Some small cleanup.
STILLTODO: some sanity checks of the (now) variable link level address length
in incoming packets..

Revision 1.21.4.3 / (download) - annotate - [select for diffs], Wed Feb 12 16:52:14 1997 UTC (25 years, 11 months ago) by is
Branch: is-newarp
Changes since 1.21.4.2: +4 -2 lines
Diff to previous 1.21.4.2 (colored) to branchpoint 1.21 (colored)

Changed arprequest() to use AF_ARP sockaddr and NOT build its own Ethernet
header. Added some missing pieces in ether_output() to support this.

Revision 1.21.4.2 / (download) - annotate - [select for diffs], Tue Feb 11 20:21:12 1997 UTC (25 years, 11 months ago) by is
Branch: is-newarp
Changes since 1.21.4.1: +25 -1 lines
Diff to previous 1.21.4.1 (colored) to branchpoint 1.21 (colored)

- Add macros, to if_arp.h:struct arphdr, to access an ARP messages' variable
  fields based on the ar_hln and ar_pln fields.
- Add AR_ARP case to ether_output, using the ar_tha() macro defined above.

Revision 1.21.4.1 / (download) - annotate - [select for diffs], Fri Feb 7 18:06:58 1997 UTC (26 years ago) by is
Branch: is-newarp
Changes since 1.21: +39 -32 lines
Diff to previous 1.21 (colored)

Snapshot of new ARP code.

Our old ARP code was hardwired for 6-byte length medium
addresses, while the protocol is designed for any size.

This snapshot contains a first hack at getting rid of
Ethernet specific data structures. The ep driver is updated
(and tested on the PCI bus), the iy and fpa drivers have been
updated, but not real life tested yet.

If you want to test this with other drivers, you have to update
them first yourself, and probably tag the relevant directories.
Better contact me if you want to do this.

Revision 1.21 / (download) - annotate - [select for diffs], Sun Oct 13 02:11:00 1996 UTC (26 years, 3 months ago) by christos
Branch: MAIN
CVS Tags: thorpej-setroot, mrg-vm-swap, is-newarp-before-merge, is-newarp-base
Branch point for: is-newarp
Changes since 1.20: +10 -10 lines
Diff to previous 1.20 (colored)

backout previous kprintf change

Revision 1.20 / (download) - annotate - [select for diffs], Thu Oct 10 22:59:45 1996 UTC (26 years, 4 months ago) by christos
Branch: MAIN
Changes since 1.19: +10 -10 lines
Diff to previous 1.19 (colored)

- printf -> kprintf, sprintf -> ksprintf

Revision 1.19 / (download) - annotate - [select for diffs], Tue May 7 02:40:30 1996 UTC (26 years, 9 months ago) by thorpej
Branch: MAIN
CVS Tags: netbsd-1-2-base, netbsd-1-2-RELEASE, netbsd-1-2-PATCH001, netbsd-1-2-BETA, netbsd-1-2
Changes since 1.18: +2 -2 lines
Diff to previous 1.18 (colored)

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.

Revision 1.18 / (download) - annotate - [select for diffs], Tue Feb 13 22:00:14 1996 UTC (26 years, 11 months ago) by christos
Branch: MAIN
Changes since 1.17: +20 -14 lines
Diff to previous 1.17 (colored)

Net prototypes

Revision 1.17 / (download) - annotate - [select for diffs], Sun Dec 24 03:33:43 1995 UTC (27 years, 1 month ago) by mycroft
Branch: MAIN
Changes since 1.16: +8 -9 lines
Diff to previous 1.16 (colored)

Avoid extra byte-swapping in average cases.

Revision 1.16 / (download) - annotate - [select for diffs], Sun Dec 24 03:12:29 1995 UTC (27 years, 1 month ago) by mycroft
Branch: MAIN
Changes since 1.15: +2 -4 lines
Diff to previous 1.15 (colored)

Remove old comment regarding trailers.

Revision 1.15 / (download) - annotate - [select for diffs], Fri Sep 29 03:37:43 1995 UTC (27 years, 4 months ago) by phil
Branch: MAIN
CVS Tags: netbsd-1-1-base, netbsd-1-1-RELEASE, netbsd-1-1-PATCH001, netbsd-1-1
Changes since 1.14: +2 -2 lines
Diff to previous 1.14 (colored)

Move a #include to outside the #ifdef INET so it will compile without
INET defined.

Revision 1.14 / (download) - annotate - [select for diffs], Sat Aug 19 16:33:17 1995 UTC (27 years, 5 months ago) by mycroft
Branch: MAIN
Changes since 1.13: +2 -5 lines
Diff to previous 1.13 (colored)

Garbage collect useless `off' and `len' variables.

Revision 1.13 / (download) - annotate - [select for diffs], Mon Jun 12 00:46:52 1995 UTC (27 years, 8 months ago) by mycroft
Branch: MAIN
Changes since 1.12: +6 -9 lines
Diff to previous 1.12 (colored)

Various cleanup, including:
* Convert several data structures to use queue.h.
* Split in_pcbnotify() into two parts; one for notifying a specific PCB, and
one for notifying all PCBs for a particular foreign address.

Revision 1.12 / (download) - annotate - [select for diffs], Fri Apr 7 22:19:29 1995 UTC (27 years, 10 months ago) by mycroft
Branch: MAIN
Changes since 1.11: +2 -2 lines
Diff to previous 1.11 (colored)

Set if_output in ether_ifattach().

Revision 1.11 / (download) - annotate - [select for diffs], Wed Apr 5 21:38:50 1995 UTC (27 years, 10 months ago) by mycroft
Branch: MAIN
Changes since 1.10: +7 -7 lines
Diff to previous 1.10 (colored)

Make OSI and X.25 work on little-endian machines.

Revision 1.10 / (download) - annotate - [select for diffs], Wed Mar 8 02:56:55 1995 UTC (27 years, 11 months ago) by cgd
Branch: MAIN
Changes since 1.9: +3 -3 lines
Diff to previous 1.9 (colored)

fixed sized types, where appropriate.  when casting pointers to
integers to do math on them, cast to long.  ioctl commands are
u_longs.

Revision 1.9 / (download) - annotate - [select for diffs], Wed Jun 29 06:36:11 1994 UTC (28 years, 7 months ago) by cgd
Branch: MAIN
CVS Tags: netbsd-1-0-base, netbsd-1-0-RELEASE, netbsd-1-0-PATCH1, netbsd-1-0-PATCH06, netbsd-1-0-PATCH05, netbsd-1-0-PATCH04, netbsd-1-0-PATCH03, netbsd-1-0-PATCH02, netbsd-1-0-PATCH0, netbsd-1-0
Changes since 1.8: +2 -0 lines
Diff to previous 1.8 (colored)

New RCS ID's, take two.  they're more aesthecially pleasant, and use 'NetBSD'

Revision 1.8 / (download) - annotate - [select for diffs], Fri May 13 06:02:36 1994 UTC (28 years, 9 months ago) by mycroft
Branch: MAIN
Changes since 1.7: +244 -164 lines
Diff to previous 1.7 (colored)

Update to 4.4-Lite networking code, with a few local changes.

Revision 1.7 / (download) - annotate - [select for diffs], Mon Apr 18 06:18:10 1994 UTC (28 years, 9 months ago) by glass
Branch: MAIN
Changes since 1.6: +5 -1 lines
Diff to previous 1.6 (colored)

revised nfs diskless support.  uses bootp+rpc to gather parameters

Revision 1.6 / (download) - annotate - [select for diffs], Wed Feb 2 01:21:36 1994 UTC (29 years ago) by hpeyerl
Branch: MAIN
Changes since 1.5: +1 -15 lines
Diff to previous 1.5 (colored)

Multicast is no longer optional

Revision 1.5 / (download) - annotate - [select for diffs], Sun Jan 23 23:41:14 1994 UTC (29 years ago) by deraadt
Branch: MAIN
Changes since 1.4: +10 -7 lines
Diff to previous 1.4 (colored)

ether_output() & ether_input() take ether_type as a net-short.
AF_UNSPEC does not swap byte order of ether_type.
NOTE: this requires driver changes

Revision 1.4 / (download) - annotate - [select for diffs], Fri Dec 17 00:12:11 1993 UTC (29 years, 1 month ago) by mycroft
Branch: MAIN
Changes since 1.3: +28 -28 lines
Diff to previous 1.3 (colored)

From magnum branch:
Remove Jolitz's netisr kluge.  Make sure cpl == 0 really means base priority.
Other minor cleanup.

Revision 1.3 / (download) - annotate - [select for diffs], Mon Dec 6 04:50:19 1993 UTC (29 years, 2 months ago) by hpeyerl
Branch: MAIN
Changes since 1.2: +198 -5 lines
Diff to previous 1.2 (colored)

multicast support.
>From Chris Maeda, cmaeda@cs.washington.edu
These patches are derived from the IP Multicast patches for BSDI.

Revision 1.2.4.2 / (download) - annotate - [select for diffs], Fri Oct 29 04:32:15 1993 UTC (29 years, 3 months ago) by mycroft
Branch: magnum
Changes since 1.2.4.1: +28 -26 lines
Diff to previous 1.2.4.1 (colored) to branchpoint 1.2 (colored) next main 1.3 (colored)

#include machine/cpu.h

Revision 1.2.4.1 / (download) - annotate - [select for diffs], Sat Oct 16 10:49:24 1993 UTC (29 years, 3 months ago) by mycroft
Branch: magnum
Changes since 1.2: +1 -3 lines
Diff to previous 1.2 (colored)

Nuke references to machine/mtpr.h.

Revision 1.2 / (download) - annotate - [select for diffs], Thu May 20 03:05:59 1993 UTC (29 years, 8 months ago) by cgd
Branch: MAIN
CVS Tags: netbsd-0-9-patch-001, netbsd-0-9-base, netbsd-0-9-RELEASE, netbsd-0-9-BETA, netbsd-0-9-ALPHA2, netbsd-0-9-ALPHA, netbsd-0-9, magnum-base
Branch point for: magnum
Changes since 1.1: +2 -1 lines
Diff to previous 1.1 (colored)

add rcs ids to everything, and clean up headers

Revision 1.1.1.1 / (download) - annotate - [select for diffs] (vendor branch), Sun Mar 21 09:45:37 1993 UTC (29 years, 10 months ago) by cgd
Branch: WFJ-920714, CSRG
CVS Tags: patchkit-0-2-2, netbsd-alpha-1, netbsd-0-8, WFJ-386bsd-01
Changes since 1.1: +0 -0 lines
Diff to previous 1.1 (colored)

initial import of 386bsd-0.1 sources

Revision 1.1 / (download) - annotate - [select for diffs], Sun Mar 21 09:45:37 1993 UTC (29 years, 10 months ago) by cgd
Branch: MAIN

Initial revision

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.




CVSweb <webmaster@jp.NetBSD.org>