summaryrefslogtreecommitdiffstats
path: root/sys/net
Commit message (Collapse)AuthorAgeFilesLines
* Ignore interface renames instead of removing the interface from the bridgemarkj2013-03-281-0/+3
| | | | | | | | | group. Reviewed by: rstone Approved by: rstone (co-mentor) Sponsored by: Sandvine Incorporated MFC after: 1 week
* Remove __FreeBSD_version ifdefs.glebius2013-03-223-12/+0
|
* Fix style and comments.ae2013-03-192-12/+19
|
* Use m_get/m_gethdr instead of compat macros.glebius2013-03-152-4/+3
| | | | Sponsored by: Nginx, Inc.
* - Use m_getcl() instead of hand allocating.glebius2013-03-151-11/+8
| | | | | | | | - Convert panic() to KASSERT. - Remove superfluous cleaning of mbuf fields after allocation. - Add comment on possible use of m_get2() here. Sponsored by: Nginx, Inc.
* Functions m_getm2() and m_get2() have different order of arguments,glebius2013-03-121-1/+1
| | | | | | | and that can drive someone crazy. While m_get2() is young and not documented yet, change its order of arguments to match m_getm2(). Sorry for churn, but better now than later.
* Reinitialize eh after pfil(9) processing.glebius2013-03-111-0/+1
| | | | | PR: 176764 Submitted by: adri
* Fix long-standing issue with interface routes being unprotected:melifaro2013-03-083-4/+41
| | | | | | | | | | Use RTM_PINNED flag to mark route as immutable. Forbid deleting immutable routes without special rtrequest1_fib() flag. Adding interface address with prefix already in route table is handled by atomically deleting old prefix and adding interface one. Discussed with: andre, eri MFC after: 3 weeks
* Write lock is not required for find&compare operation.melifaro2013-03-051-2/+2
| | | | MFC after: 2 weeks
* Finish the r244185. This fixes ever growing counter of pfsync badglebius2013-02-151-12/+0
| | | | | | | | | | length packets, which was actually harmless. Note that peers with different version of head/ may grow this counter, but it is harmless - all pfsync data is processed. Reported & tested by: Anton Yuzhaninov <citrin citrin.ru> Sponsored by: Nginx, Inc
* Resolve source address selection in presense of CARP. Add a coupleglebius2013-02-112-4/+22
| | | | | | | | | | | | | | | | | | of helper functions: - carp_master() - boolean function which is true if an address is in the MASTER state. - ifa_preferred() - boolean function that compares two addresses, and is aware of CARP. Utilize ifa_preferred() in ifa_ifwithnet(). The previous version of patch also changed source address selection logic in jails using carp_master(), but we failed to negotiate this part with Bjoern. May be we will approach this problem again later. Reported & tested by: Anton Yuzhaninov <citrin citrin.ru> Sponsored by: Nginx, Inc
* This fixes a out-of-order problem with severalrrs2013-02-071-1/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | of the newer drivers. The basic problem was that the driver was pulling the mbuf off the drbr ring and then when sending with xmit(), encounting a full transmit ring. Thus the lower layer xmit() function would return an error, and the drivers would then append the data back on to the ring. For TCP this is a horrible scenario sure to bring on a fast-retransmit. The fix is to use drbr_peek() to pull the data pointer but not remove it from the ring. If it fails then we either call the new drbr_putback or drbr_advance method. Advance moves it forward (we do this sometimes when the xmit() function frees the mbuf). When we succeed we always call advance. The putback will always copy the mbuf back to the top of the ring. Note that the putback *cannot* be used with a drbr_dequeue() only with drbr_peek(). We most of the time, in putback, would not need to copy it back since most likey the mbuf is still the same, but sometimes xmit() functions will change the mbuf via a pullup or other call. So the optimial case for the single consumer is to always copy it back. If we ever do a multiple_consumer (for lagg?) we will need a test and atomic in the put back possibly a seperate putback_mc() in the ring buf. Reviewed by: jhb@freebsd.org, jlv@freebsd.org
* Retire struct sockaddr_inarp.glebius2013-01-312-29/+5
| | | | | | | | | | | | | | | Since ARP and routing are separated, "proxy only" entries don't have any meaning, thus we don't need additional field in sockaddr to pass SIN_PROXY flag. New kernel is binary compatible with old tools, since sizes of sockaddr_inarp and sockaddr_in match, and sa_family are filled with same value. The structure declaration is left for compatibility with third party software, but in tree code no longer use it. Reviewed by: ru, andre, net@
* route_output() always supplies info with RTAX_GATEWAY member thatglebius2013-01-291-4/+3
| | | | | points to a sockaddr of AF_LINK family. Assert this instead of checking.
* Move lle_event to if_llatbl.hnp2013-01-251-0/+10
| | | | | | | | | | | | lle_event replaced arp_update_event after the ARP rewrite and ended up in if_ether.h simply because arp_update_event used to be there too. IPv6 neighbor discovery is going to grow lle_event support and this is a good time to move it to if_llatbl.h. The two in-tree consumers of this event - OFED and toecore - are not affected. Reviewed by: bz@
* - Utilize m_get2(), accidentially fixing some signedness bugs.glebius2013-01-241-20/+3
| | | | | - Return EMSGSIZE in both cases if uio_resid is oversized or undersized. - No need to clear rcvif.
* leftover from r245579... flags for semi transparent mode and directluigi2013-01-231-8/+41
| | | | forwarding through a VALE switch
* If lagg(4) can't forward a packet due to underlying port problems,glebius2013-01-211-2/+2
| | | | return much more meaningful ENETDOWN to the stack, instead of EBUSY.
* - Add dashes before copyright notices.glebius2013-01-071-18/+8
| | | | | - Add $FreeBSD$. - Remove unused define.
* Juggle some internal symbols from our antique zlib (that originally camepeter2013-01-062-2/+9
| | | | | | | in from kernel-pppd which is long gone) so that ZFS and DTRACE play nice. This is a horrible hack to get freefall to compile, and is in dire need of reconciliation. This antique zlib-1.04 code needs to go away.
* Add an ability to set net.link.stf.permit_rfc1918 from the loader.ae2012-12-271-1/+2
| | | | MFC after: 2 weeks
* Add net.link.stf.permit_rfc1918 sysctl variable. It can be used to allowae2012-12-271-2/+7
| | | | | | the use of private IPv4 addresses with stf(4). MFC after: 2 weeks
* Fix typo in comment.kevlo2012-12-181-1/+1
| | | | Reviewed by: thompsa
* Fix problem in r238990. The LLE_LINKED flag should be tested prior toglebius2012-12-131-6/+0
| | | | | | | | | entering llentry_free(), and in case if we lose the race, we should simply perform LLE_FREE_LOCKED(). Otherwise, if the race is lost by the thread performing arptimer(), it will remove two references from the lle instead of one. Reported by: Ian FREISLICH <ianf clue.co.za>
* Changes to resolve races in bpfread() and catchpacket() that, at worst,ghelmer2012-12-104-12/+38
| | | | | | | | | | | | cause kernel panics. Add a flag to the bpf descriptor to indicate whether the hold buffer is in use. In bpfread(), set the "hold buffer in use" flag before dropping the descriptor lock during the call to bpf_uiomove(). Everywhere else the hold buffer is used or changed, wait while the hold buffer is in use by bpfread(). Add a KASSERT in bpfread() after re-acquiring the descriptor lock to assist uncovering any additional hold buffer races.
* - Move definition of V_deembed_scopeid to scope6_var.h.hrs2012-12-051-63/+51
| | | | | | - Deembed scope id in L3 address in in6_lltable_dump(). - Simplify scope id recovery in rtsock routines. - Remove embedded scope id handling in ndp(8) and route(8) completely.
* Mechanically substitute flags from historic mbuf allocator withglebius2012-12-0518-56/+56
| | | | | | | | | malloc(9) flags within sys. Exceptions: - sys/contrib not touched - sys/mbuf.h edited manually
* - Fix LOR in sa6_recoverscope() in rt_msg2()[1].hrs2012-12-041-39/+32
| | | | | | | - Check V_deembed_scopeid before checking if sa_family == AF_INET6. - Fix scope id handing in route(8)[2] and ifconfig(8). Reported by: rpaulo[1], Mateusz Guzik[1], peter[2]
* Fix bpf_if structure leak introduced in r235745.melifaro2012-12-021-52/+66
| | | | | | | Move all such structures to delayed-free lists and delete all matching on interface departure event. MFC after: 1 week
* - Use more appropriate loop (do { } while()) when generating ethernet addresspjd2012-11-291-3/+5
| | | | | | | | | for bridge interface. - If we found a collision we can break the loop - only one collision is possible and one is exactly enough to need to renegerate. Obtained from: WHEEL Systems MFC after: 1 week
* Remove unused and unnecessary CSUM_IP_FRAGS checksumming capability.andre2012-11-271-1/+1
| | | | | | | | Checksumming the IP header of fragments is no different from doing normal IP headers. Discussed with: yongari MFC after: 1 week
* Pass allocated unit number to make_dev, otherwise kernel panics later whiledavidxu2012-11-271-1/+1
| | | | | | cloning second tap. Reviewed by: kevlo,ed
* Better safe than sorry: reinitialize eh after ng_ether(4) andglebius2012-11-271-0/+2
| | | | | | if_bridge(4) processing, since mbuf may be modified there. Submitted by: youngari
* Re-initialize eh pointer after m_adj()glebius2012-11-261-0/+1
| | | | | Submitted by: Kohji Okuno <okuno.kohji jp.panasonic.com> Reviewed by: yongari
* Fix up a compile time warning if INET6 isn't defined.adrian2012-11-181-1/+1
|
* Fill sin6_scope_id in sockaddr_in6 before passing it from the kernel tohrs2012-11-171-0/+90
| | | | | | | | | | | | userland via routing socket or sysctl. This eliminates the following KAME-specific sin6_scope_id handling routine from each userland utility: sin6.sin6_scope_id = ntohs(*(u_int16_t *)&sin6.sin6_addr.s6_addr[2]); This behavior can be controlled by net.inet6.ip6.deembed_scopeid. This is set to 1 by default (sin6_scope_id will be filled in the kernel). Reviewed by: bz
* Work around a race in bpfread() by validating the hold buffer pointerghelmer2012-11-061-4/+7
| | | | | before freeing it. Otherwise, we can lose a buffer and cause a panic in catchpacket().
* Remove the recently added sysctl variable net.pfil.forward.ae2012-11-022-9/+0
| | | | | | | | | Instead, add protocol specific mbuf flags M_IP_NEXTHOP and M_IP6_NEXTHOP. Use them to indicate that the mbuf's chain contains the PACKET_TAG_IPFORWARD tag. And do a tag lookup only when this flag is set. Suggested by: andre
* o Remove last argument to ip_fragment(), and obtain all needed informationglebius2012-10-261-2/+2
| | | | | | | | | | | on checksums directly from mbuf flags. This simplifies code. o Clear CSUM_IP from the mbuf in ip_fragment() if we did checksums in hardware. Some driver may not announce CSUM_IP in theur if_hwassist, although try to do checksums if CSUM_IP set on mbuf. Example is em(4). o While here, consistently use CSUM_IP instead of its alias CSUM_DELAY_IP. After this change CSUM_DELAY_IP vanishes from the stack. Submitted by: Sebastian Kuzminsky <seb lineratesystems.com>
* Remove the IPFIREWALL_FORWARD kernel option and make possible to turnae2012-10-252-0/+9
| | | | | | | | | on the related functionality in the runtime via the sysctl variable net.pfil.forward. It is turned off by default. Sponsored by: Yandex LLC Discussed with: net@ MFC after: 2 weeks
* Fix fallout from r240071. If destination interface lookup fails,glebius2012-10-241-6/+5
| | | | | | we should broadcast a packet, not try to deliver it to NULL. Reported by: rpaulo
* Switch the entire IPv4 stack to keep the IP packet headerglebius2012-10-222-4/+4
| | | | | | | | | | | | | | | | | | | | | | | in network byte order. Any host byte order processing is done in local variables and host byte order values are never[1] written to a packet. After this change a packet processed by the stack isn't modified at all[2] except for TTL. After this change a network stack hacker doesn't need to scratch his head trying to figure out what is the byte order at the given place in the stack. [1] One exception still remains. The raw sockets convert host byte order before pass a packet to an application. Probably this would remain for ages for compatibility. [2] The ip_input() still subtructs header len from ip->ip_len, but this is planned to be fixed soon. Reviewed by: luigi, Maxim Dounin <mdounin mdounin.ru> Tested by: ray, Olivier Cochard-Labbe <olivier cochard.me>
* Make PFIL use per-VNET lock instead of per-AF lock. Since most used packetmelifaro2012-10-222-10/+94
| | | | | | | | | | | | | | | | | | | | | | filters (ipfw and PF) use the same ruleset with the same lock for both AF_INET and AF_INET6 there is no need in more fine-grade locking. However, it is possible to request personal lock by specifying PFIL_FLAG_PRIVATE_LOCK flag in pfil_head structure (see pfil.9 for more details). Export PFIL lock via rw_lock(9)/rm_lock(9)-like API permitting pfil consumers to use this lock instead of own lock. This help reducing locks on main traffic path. pfil_assert() is currently not implemented due to absense of rm_assert(). Waiting for some kind of r234648 to be merged in HEAD. This change is part of bigger patch reducing routing locking. Sponsored by: Yandex LLC Reviewed by: glebius, ae OK'd by: silence on net@ MFC after: 3 weeks
* Update to previous r241688 to use __func__ instead of spelled out functionandre2012-10-191-2/+2
| | | | | | name in log(9) message. Suggested by: glebius
* Use LOG_WARNING level in in_attachdomain1() instead of printf().andre2012-10-181-2/+2
| | | | Submitted by: vijju.singh-at-gmail.com
* Mechanically remove the last stray remains of spl* calls from net*/*.andre2012-10-186-99/+13
| | | | They have been Noop's for a long time now.
* Utilize new macro to initialize if_baudrate().glebius2012-10-181-2/+2
|
* Fix VIMAGE build.glebius2012-10-171-1/+1
| | | | | Reported by: Nikolai Lifanov <lifanov mail.lifanov.com> Pointy hat to: glebius
* provide helper if_initbaudrate() to set if_baudrate_pf and if_baudrate_pf.emax2012-10-172-1/+13
| | | | | | | again, use ixgbe(4) as an example of how to use new helper function. Reviewed by: jhb MFC after: 1 week
* Fix build.delphij2012-10-171-1/+1
|
OpenPOWER on IntegriCloud