#
294dd290 |
| 08-Dec-2006 |
Luigi Rizzo <luigi@FreeBSD.org> |
Fix an oscure bug triggered by a recent change in kern_socket.c. The symptoms were that outgoing DHCP requests for diskless kernels had the IP header corrupt. After long investigations, the source of
Fix an oscure bug triggered by a recent change in kern_socket.c. The symptoms were that outgoing DHCP requests for diskless kernels had the IP header corrupt. After long investigations, the source of the problem was found in ether_output() - for SIMPLEX interfaces and broadcast traffic, a copy of the packet is passed back to the kernel through if_simloop(). However if_simloop() modifies the mbuf, while the copy obtained through m_copym() is a readonly one.
The bug has been there forever, but it has been triggered only recently by a change in sosend_dgram() which passed down mbufs with sufficient space to prepend the header.
This fix is trivial - use m_dup() instead of m_copy() to create the copy. As an alternative, we could try and modify if_simloop() to play safely with readonly mbufs, but i don't think it is worthwhile because 1) this is a relatively infrequent code path so we do not need to worry too much about performance, and 2) the cost of doing an extra m_pullup in if_simloop() is probably the same as doing the copy of the cluster, anyways.
MFC after: 1 week
show more ...
|
#
52f1277e |
| 19-Nov-2006 |
Christian S.J. Peron <csjp@FreeBSD.org> |
Currently, drivers that support hardware offload of VLAN tag processing are forced to toggle this functionality when the card is put in and out of promiscuous mode. The main reason for this is becau
Currently, drivers that support hardware offload of VLAN tag processing are forced to toggle this functionality when the card is put in and out of promiscuous mode. The main reason for this is because the hardware strips the VLAN tag, making it impossible for the tag information to show up in network diagnostic tools like tcpdump(1).
This change introduces ether_vlan_mtap(), which is called if the mbuf has M_VLANTAG set. VLAN information is extracted from the mbuf and inserted into a stack allocated ether vlan header which is then inserted through the bpf machinery via bpf_mtap2(). The original mbuf's data pointer and lengths are temporarily adjusted to eliminate the original Ethernet header for the duration of the tap operation. This should have no long term effects on the mbuf.
Also, define a new macro, ETHER_BPF_MTAP which should be used by drivers which support hardware offload of VLAN tag processing.
The fixes for the relevant drivers will follow shortly.
Discussed with: rwatson, andre, jhb (and others) Much feedback from: sam, ru MFC after: 1 month [1]
[1] The version that is eventually MFCed will be somewhat different then this, as there has been significant work done to the VLAN code in HEAD.
show more ...
|
#
aed55708 |
| 22-Oct-2006 |
Robert Watson <rwatson@FreeBSD.org> |
Complete break-out of sys/sys/mac.h into sys/security/mac/mac_framework.h begun with a repo-copy of mac.h to mac_framework.h. sys/mac.h now contains the userspace and user<->kernel API and definitio
Complete break-out of sys/sys/mac.h into sys/security/mac/mac_framework.h begun with a repo-copy of mac.h to mac_framework.h. sys/mac.h now contains the userspace and user<->kernel API and definitions, with all in-kernel interfaces moved to mac_framework.h, which is now included across most of the kernel instead.
This change is the first step in a larger cleanup and sweep of MAC Framework interfaces in the kernel, and will not be MFC'd.
Obtained from: TrustedBSD Project Sponsored by: SPARTA
show more ...
|
#
3f7d1396 |
| 25-Aug-2006 |
Andrew Thompson <thompsa@FreeBSD.org> |
Move the bridge hook after the loopback check so that IFF_SIMPLEX is honoured on member interfaces. This makes us the same as OpenBSD/NetBSD.
MFC after: 3 days
|
#
9674cf0e |
| 27-Jul-2006 |
Andrew Thompson <thompsa@FreeBSD.org> |
Remove the dependency of bridgestp.h on if_bridgevar.h by moving a couple of private structures to if_bridge.c.
|
#
da87ff86 |
| 27-Jul-2006 |
Tai-hwa Liang <avatar@FreeBSD.org> |
Fixing compilation bustage: net/if_bridgevar.h depends on net/bridgestp.h.
|
Revision tags: release/5.5.0_cvs, release/5.5.0, release/6.1.0_cvs, release/6.1.0 |
|
#
de572b37 |
| 03-Mar-2006 |
Christian S.J. Peron <csjp@FreeBSD.org> |
Unbreak byte counters when network interfaces are in monitor mode by re-organizing the monitor return logic. We perform interface monitoring checks after we have determined if the CRC is still on the
Unbreak byte counters when network interfaces are in monitor mode by re-organizing the monitor return logic. We perform interface monitoring checks after we have determined if the CRC is still on the packet, if it is, m_adj() is called which will adjust the packet length. This ensures that we are not including CRC lengths in the byte counters for each packet.
Discussed with: andre, glebius
show more ...
|
#
3ecf1851 |
| 04-Feb-2006 |
Oleg Bulyzhin <oleg@FreeBSD.org> |
Properly initialize args structure before passing it to ipfw_chk(): having uninitialized args.inp is unhealthy for uid/gid/jail ipfw rules.
PR: kern/92589 Approved by: glebius (mentor) MFC after: 1
Properly initialize args structure before passing it to ipfw_chk(): having uninitialized args.inp is unhealthy for uid/gid/jail ipfw rules.
PR: kern/92589 Approved by: glebius (mentor) MFC after: 1 week
show more ...
|
#
75ee267c |
| 30-Jan-2006 |
Gleb Smirnoff <glebius@FreeBSD.org> |
Merge the //depot/user/yar/vlan branch into CVS. It contains some collective work by yar, thompsa and myself. The checksum offloading part also involves work done by Mihail Balikov.
The most importa
Merge the //depot/user/yar/vlan branch into CVS. It contains some collective work by yar, thompsa and myself. The checksum offloading part also involves work done by Mihail Balikov.
The most important changes:
o Instead of global linked list of all vlan softc use a per-trunk hash. The size of hash is dynamically adjusted, depending on number of entries. This changes struct ifnet, replacing counter of vlans with a pointer to trunk structure. This change is an improvement for setups with big number of VLANs, several interfaces and several CPUs. It is a small regression for a setup with a single VLAN interface. An alternative to dynamic hash is a per-trunk static array with 4096 entries, which is a compile time option - VLAN_ARRAY. In my experiments the array is not an improvement, probably because such a big trunk structure doesn't fit into CPU cache. o Introduce an UMA zone for VLAN tags. Since drivers depend on it, the zone is declared in kern_mbuf.c, not in optional vlan(4) driver. This change is a big improvement for any setup utilizing vlan(4). o Use rwlock(9) instead of mutex(9) for locking. We are the first ones to do this! :) o Some drivers can do hardware VLAN tagging + hardware checksum offloading. Add an infrastructure for this. Whenever vlan(4) is attached to a parent or parent configuration is changed, the flags on vlan(4) interface are updated.
In collaboration with: yar, thompsa In collaboration with: Mihail Balikov <mihail.balikov interbgc.com>
show more ...
|
#
5d691e6d |
| 18-Jan-2006 |
Andre Oppermann <andre@FreeBSD.org> |
Return mbuf pointer or NULL from ip_fastforward() as the mbuf pointer may have changed by m_pullup() during fastforward processing.
While this is a bug it is actually never triggered in real world s
Return mbuf pointer or NULL from ip_fastforward() as the mbuf pointer may have changed by m_pullup() during fastforward processing.
While this is a bug it is actually never triggered in real world situations and it is not remotely exploitable.
Found by: Coverity Prevent(tm) Coverity ID: CID780 Sponsored by: TCP/IP Optimization Fundraise 2005
show more ...
|
#
c54c76cc |
| 22-Dec-2005 |
Oleg Bulyzhin <oleg@FreeBSD.org> |
1) remove useless check of loop_copy - corresponding code was removed in rev. 1.70 five years ago. 2) convert loop_copy to "non-negative" flag
Approved by: glebius (mentor) MFC after: 2 weeks
|
#
e0a87e8a |
| 17-Dec-2005 |
Andrew Thompson <thompsa@FreeBSD.org> |
Change from a callback in if_ethersubr to using EVENTHANDLER in order to detach span ports when they disappear. The span port does not have a pointer to the softc so revert r1.31 and bring back the s
Change from a callback in if_ethersubr to using EVENTHANDLER in order to detach span ports when they disappear. The span port does not have a pointer to the softc so revert r1.31 and bring back the softc linked-list.
MFC after: 2 weeks
show more ...
|
#
147f74d1 |
| 18-Nov-2005 |
Andre Oppermann <andre@FreeBSD.org> |
Purge layer specific mbuf flags on layer crossings to avoid confusing upper or lower layers.
Sponsored by: TCP/IP Optimization Fundraise 2005
|
#
4a0d6638 |
| 11-Nov-2005 |
Ruslan Ermilov <ru@FreeBSD.org> |
- Store pointer to the link-level address right in "struct ifnet" rather than in ifindex_table[]; all (except one) accesses are through ifp anyway. IF_LLADDR() works faster, and all (except on
- Store pointer to the link-level address right in "struct ifnet" rather than in ifindex_table[]; all (except one) accesses are through ifp anyway. IF_LLADDR() works faster, and all (except one) ifaddr_byindex() users were converted to use ifp->if_addr.
- Stop storing a (pointer to) Ethernet address in "struct arpcom", and drop the IFP2ENADDR() macro; all users have been converted to use IF_LLADDR() instead.
show more ...
|
#
d09ed26f |
| 11-Nov-2005 |
Ruslan Ermilov <ru@FreeBSD.org> |
- Make IFP2ENADDR() a pointer to IF_LLADDR() rather than another copy of Ethernet address.
- Change iso88025_ifattach() and fddi_ifattach() to accept MAC address as an argument, similar to ether
- Make IFP2ENADDR() a pointer to IF_LLADDR() rather than another copy of Ethernet address.
- Change iso88025_ifattach() and fddi_ifattach() to accept MAC address as an argument, similar to ether_ifattach(), to make this work.
show more ...
|
Revision tags: release/6.0.0_cvs, release/6.0.0 |
|
#
fd6238a6 |
| 14-Oct-2005 |
Andrew Thompson <thompsa@FreeBSD.org> |
Further clean up the bridge hooks in if_ethersubr.c and ng_ether.c
- move the function pointer definitions to if_bridgevar.h - move most of the logic to the new BRIDGE_INPUT and BRIDGE_OUTPUT macros
Further clean up the bridge hooks in if_ethersubr.c and ng_ether.c
- move the function pointer definitions to if_bridgevar.h - move most of the logic to the new BRIDGE_INPUT and BRIDGE_OUTPUT macros - remove unneeded functions from if_bridgevar.h and sort a little.
show more ...
|
#
20a65f37 |
| 14-Oct-2005 |
Andrew Thompson <thompsa@FreeBSD.org> |
From 101 ways to panic your kernel.
Use bridge_ifdetach() to notify the bridge that a member has been detached. The bridge can then remove it from its interface list and not try to send out via a de
From 101 ways to panic your kernel.
Use bridge_ifdetach() to notify the bridge that a member has been detached. The bridge can then remove it from its interface list and not try to send out via a dead pointer.
show more ...
|
#
d0a2acd4 |
| 13-Oct-2005 |
Julian Elischer <julian@FreeBSD.org> |
Consolidate two adjacent conditional blocks I actually believe the code in question should be elsewhere (in the preceding function).
MFC after: 1 week
|
#
199474fd |
| 13-Oct-2005 |
Ruslan Ermilov <ru@FreeBSD.org> |
Remove a stale comment.
|
#
9cff52f7 |
| 13-Oct-2005 |
Andrew Thompson <thompsa@FreeBSD.org> |
Clean up the if_bridge hooks a bit in if_ethersubr.c and ng_ether.c, move the broadcast/multicast test to bridge_input().
Requested by: glebius
|
#
6512768b |
| 07-Oct-2005 |
Gleb Smirnoff <glebius@FreeBSD.org> |
A deja vu of:
http://lists.freebsd.org/pipermail/cvs-src/2004-October/033496.html
The same problem applies to if_bridge(4), too.
- Copy-and-paste the if_bridge(4) related block from if_ethersu
A deja vu of:
http://lists.freebsd.org/pipermail/cvs-src/2004-October/033496.html
The same problem applies to if_bridge(4), too.
- Copy-and-paste the if_bridge(4) related block from if_ethersubr.c to ng_ether.c - Add XXXs, so that copy-and-paste would be noticed by any future editors of this code. - Also add XXXs near if_bridge(4) declarations.
Silence from: thompsa
show more ...
|
#
64465c6b |
| 06-Oct-2005 |
Andrew Thompson <thompsa@FreeBSD.org> |
Fix KASSERT function name in ether_output, use __func__ while I am here.
|
#
b6de9e91 |
| 27-Sep-2005 |
Max Laier <mlaier@FreeBSD.org> |
Remove bridge(4) from the tree. if_bridge(4) is a full functional replacement and has additional features which make it superior.
Discussed on: -arch Reviewed by: thompsa X-MFC-after: never (RELENG
Remove bridge(4) from the tree. if_bridge(4) is a full functional replacement and has additional features which make it superior.
Discussed on: -arch Reviewed by: thompsa X-MFC-after: never (RELENG_6 as transition period)
show more ...
|
#
59280079 |
| 06-Sep-2005 |
Andrew Thompson <thompsa@FreeBSD.org> |
Add support for multicast to the bridge and allow inet6 addresses to be assigned to the interface.
IPv6 auto-configuration is disabled. An IPv6 link-local address has a link-local scope within one l
Add support for multicast to the bridge and allow inet6 addresses to be assigned to the interface.
IPv6 auto-configuration is disabled. An IPv6 link-local address has a link-local scope within one link, the spec is unclear for the bridge case and it may cause scope violation.
An address can be assigned in the usual way; ifconfig bridge0 inet6 xxxx:...
Tested by: bmah Reviewed by: ume (netinet6) Approved by: mlaier (mentor) MFC after: 1 week
show more ...
|
#
0bdf5171 |
| 23-Aug-2005 |
Max Laier <mlaier@FreeBSD.org> |
Don't loop back packets that have been routed by pf. This fixes an endless loop where the same packet is sent over and over again.
Obtained from: OpenBSD Reported by: Sergey Lapin Tested by: Sergey
Don't loop back packets that have been routed by pf. This fixes an endless loop where the same packet is sent over and over again.
Obtained from: OpenBSD Reported by: Sergey Lapin Tested by: Sergey Lapin MFC after: 7 days
show more ...
|