summaryrefslogtreecommitdiffstats
path: root/sys/net
Commit message (Collapse)AuthorAgeFilesLines
* MFC r321306:dim2018-02-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | Fix printf format warning in iflib.c Clang 5.0.0 got better warnings about printf format strings using %zd, and this leads to the following -Werror warning on e.g. arm: sys/net/iflib.c:1517:8: error: format specifies type 'ssize_t' (aka 'int') but the argument has type 'bus_size_t' (aka 'unsigned long') [-Werror,-Wformat] sctx->isc_tx_maxsize, nsegments, sctx->isc_tx_maxsegsize); ^~~~~~~~~~~~~~~~~~~~ sys/net/iflib.c:1517:41: error: format specifies type 'ssize_t' (aka 'int') but the argument has type 'bus_size_t' (aka 'unsigned long') [-Werror,-Wformat] sctx->isc_tx_maxsize, nsegments, sctx->isc_tx_maxsegsize); ^~~~~~~~~~~~~~~~~~~~~~~ Fix this by casting bus_size_t arguments to uintmax_t, and using %ju instead. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D11679 (cherry picked from commit 58bfec3f9f30e99a0addd75812351da4d35fd9ba)
* Do not reuse the same bit for different flags.Luiz Souza2018-01-241-2/+2
| | | | | | | | Fixes a crash when dummynet is used with pfsync. Ticket #4310 (cherry picked from commit 92b0a4e58e8a89eb6be7714dcd59b30fd0615352)
* Make a small improvement in if_lagg.Luiz Souza2017-10-311-3/+7
| | | | | | When the lagg is being destroyed it is not necessary update the lladdr of all the lagg members every time we update the primary interface. (cherry picked from commit 256df827458c3e4e6719fae34999e3d7b9064b42)
* Convert if_bridge.c back to if_start() to re-add the ALTQ support.Luiz Souza2017-10-301-32/+24
| | | | | | Ticket #7936 (cherry picked from commit 50319f09eeed57085eb665ce6f82de3c12ba18ee)
* bridge: Set module versionkp2017-10-271-0/+1
| | | | | | | | | | | This ensures that the loader will not load the module if it's also built in to the kernel. PR: 220860 Submitted by: Eugene Grosbein <eugen@freebsd.org> Reported by: Marie Helene Kvello-Aune <marieheleneka@gmail.com> (cherry picked from commit deed61f436ecad351fabada7d9d0a80d9cd37b25)
* Make if_bridge complain if it can't disable some capabilities.mav2017-10-271-2/+6
| | | | | | | MFC after: 2 weeks Sponsored by: iXsystems, Inc. (cherry picked from commit 08f5e30a7cf6b3be2f5b82b2780940b8299cd1ea)
* Remove excess CTLFLAG_VNETbdrewery2017-10-271-1/+1
| | | | | | Sponsored by: Dell EMC Isilon (cherry picked from commit 271abc089d73da5713a474e89b4150bf6f14326c)
* net/vlan: Revert 305177sephe2017-10-181-1/+1
| | | | | | | | | | | Miss read the parentheses. Reported by: oleg@ Reviewed by: hps@ MFC after: 3 days Sponsored by: Microsoft (cherry picked from commit bd9a963c1666164c8a15c436307497019ba41da4)
* Revert "Increase the interface size to 64 bytes (including the terminating ↵Luiz Souza2017-10-081-1/+1
| | | | | | NULL)." This reverts commit 74ffe70f496b45f72a1f37a53f81c346efd327c3.
* Increase the interface size to 64 bytes (including the terminating NULL).Luiz Souza2017-10-071-1/+1
| | | | (cherry picked from commit aabe6b2e2913f231f5136574a7ef665a1d48220b)
* IFQ_POLL_NOLOCK() cannot be used without locks.Luiz Souza2017-09-251-6/+0
| | | | | | | Ticket #7879 Ticket #7877 (cherry picked from commit 3e2118820ae6f7dbe953f0a6333e82fdba0b6053)
* Improve debug, remove some unnecessary messages.Luiz Souza2017-08-231-19/+10
| | | | (cherry picked from commit 316530deb8bcf9c3f9dafdb814c73f1c7ec6b9e9)
* Fix the address encoding algorithm when the v4 prefixlen is not 0 or 32.Luiz Souza2017-08-231-11/+8
| | | | (cherry picked from commit 4ca30a279eec9a6d08825ec4deba707c8a9d359c)
* Set the IFF_DRV_RUNNING on if_stf, otherwise the DAD timer will force the ↵Luiz Souza2017-08-221-0/+8
| | | | | | tentative flag on interface address. (cherry picked from commit cc11287496510575f2f0e07e93e28cb81316d70f)
* Fix the counter values for VLAN interfaces. The packet bytes are already ↵Luiz Souza2017-08-171-6/+2
| | | | | | | | counted in IFQ_HANDOFF(). Ticket #7751 (cherry picked from commit 327d0a443586caf89a7d663c081f536cb4bba770)
* Fix the import of 6rd to accept inet6 addresses other than 2002::.Luiz Souza2017-08-111-9/+4
| | | | (cherry picked from commit c7cb7c5dd18db88217dd3fc69cbd48beceac7ae3)
* Fix the build. Set the variables before use.Luiz Souza2017-08-101-4/+5
| | | | (cherry picked from commit a49dcfe92933091515b9df7272f9f2d37d7137b6)
* Fix a mismerge/infinite recursion in the recent import of the 6rd.patch.Luiz Souza2017-08-101-2/+0
| | | | (cherry picked from commit 2e8d3ef621d72c1673969bec47744def87033b15)
* Add to if_enc(4) ability to capture packets via BPF after pfil processing.ae2017-08-091-16/+33
| | | | | | | | | | | | New flag 0x4 can be configured in net.enc.[in|out].ipsec_bpf_mask. When it is set, if_enc(4) additionally captures a packet via BPF after invoking pfil hook. This may be useful for debugging. MFC after: 2 weeks Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D11804 (cherry picked from commit 6dd69d60f664b5687f5b7eb3a77f079dac3df6c2)
* Import the pfSense patch stf_6rd.diffLuiz Souza2017-08-032-121/+580
| | | | | | | | Update the patch to -head and stable/11. Ticket #7272 (cherry picked from commit 9b4f61fbff06039b57566ba7332b763188d6d301)
* Add inpcb pointer to struct ipsec_ctx_data and pass it to the pfil hookae2017-08-012-1/+2
| | | | | | | | | | | | | | | | | | | | from enc_hhook(). This should solve the problem when pf is used with if_enc(4) interface, and outbound packet with existing PCB checked by pf, and this leads to deadlock due to pf does its own PCB lookup and tries to take rlock when wlock is already held. Now we pass PCB pointer if it is known to the pfil hook, this helps to avoid extra PCB lookup and thus rlock acquiring is not needed. For inbound packets it is safe to pass NULL, because we do not held any PCB locks yet. PR: 220217 MFC after: 3 weeks Sponsored by: Yandex LLC (cherry picked from commit 4c7d86cbec231dc1fe6814f0e5e2db63394a2bcb)
* Import pfSense patch if_vlan_altq.diffLuiz Otavio O Souza2017-07-201-87/+92
| | | | | | Ticket #7219 (cherry picked from commit 5c1daa5ea1098b67d4c331d5e21b39178d616031)
* Fix the structure padding to work on 32bits platforms.Luiz Otavio O Souza2017-07-201-2/+4
| | | | | | Ticket #7026 (cherry picked from commit aa25003286b43c3710fe1a98b09b15385b736944)
* Round up the struct pfloghdr size to the next byte boundary.Luiz Otavio O Souza2017-07-201-1/+1
| | | | | | | | Fixes the tcpdump decoding on pflog interface. Reported as a secondary bug in Ticket #4723 (cherry picked from commit 58df8b93be71a46ae8829e57ca1bfd94c4179e59)
* MFC 305177sephe2017-07-201-1/+1
| | | | | | | | | | net/vlan: Shift for pri is 13 (pri mask 0xe000) not 1. Reviewed by: araujo, hps Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7710 (cherry picked from commit 860932ee33fe82330891c9acc939827c05f20999)
* Fix a bug where existing CARP alias addresses cannot be changed.Luiz Otavio O Souza2017-07-201-1/+1
| | | | | | | | When a existent address is delete with carp_detach() if it is the last address for that CARP vhid, the CARP vhid will be destroyed and the subsequent carp_attach() to add the new IP will fail. Ticket #6892 (cherry picked from commit 77805aa5fa51dbd2ed0b6c363c6235c892caee76)
* pf: Fix possible shutdown racekp2017-07-201-0/+2
| | | | | | | | | | | | | | | Prevent possible races in the pf_unload() / pf_purge_thread() shutdown code. Lock the pf_purge_thread() with the new pf_end_lock to prevent these races. Use a shared/exclusive lock, as we need to also acquire another sx lock (VNET_LIST_RLOCK). It's fine for both pf_purge_thread() and pf_unload() to sleep, Pointed out by: eri, glebius, jhb Differential Revision: https://reviews.freebsd.org/D10026 (cherry picked from commit 6f8b05d841a4f034b227995ff8e33cbe42c9cd30)
* Update the interface name before return and fix the kernel panic when pf is ↵Luiz Otavio O Souza2017-07-201-1/+20
| | | | | | | | loaded and the stf interface is created without the unit number: Ticket #7124 (cherry picked from commit c050d42a2646d2e582c46cc6f61531150ffb6cb9)
* Add l2 support to ipfw fwd.Luiz Otavio O Souza2017-07-201-1/+6
| | | | (cherry picked from commit e384dd50b923cdb01b401f4ab943cec5d61fbd7d)
* Merge remote-tracking branch 'origin/releng/11.1' into RELENG_2_5Renato Botelho2017-07-0314-1470/+1744
|\
| * MFC r319895:ae2017-06-202-7/+19
| | | | | | | | | | | | | | | | | | | | | | | | Resurrect RTF_RNH_LOCKED flag and restore ability to call rtalloc1_fib() with acquired RIB lock. This fixes a possible panic due to trying to acquire RIB rlock when it is already exclusive locked. PR: 215963, 215122 Sponsored by: Yandex LLC Approved by: re (delphij)
| * MFC r318970: Call VLAN_CAPABILITIES() when LAGG capabilities change.mav2017-06-081-0/+5
| | | | | | | | | | | | | | This makes VLAN on top of LAGG to expose proper capabilities if they are changed after creation. Approved by: re (marius)
| * MFC r318966: Improve applying unified capabilities to the lagg ports.mav2017-06-081-11/+24
| | | | | | | | | | | | | | | | Some NICs have some capabilities dependent, so that disabling one require disabling some other (TXCSUM/RXCSUM on em). This code tries to reach the consensus more insistently. Approved by: re (marius)
| * MFC r318907: Remove some code, dead from the day one.mav2017-06-082-25/+0
| | | | | | | | Approved by: re (marius)
| * MFC r313695, r313760, r314769, r314863, r314865, r316125delphij2017-05-312-1050/+1340
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r313695: MFV r313676: libpcap 1.8.1 r313760: MFV r313759: license change for a few headers (4 clause BSD to 3 clause BSD). X-MFC-with: r313695 r314769: Remove compatibility with old libpcap. Differential Revision: https://reviews.freebsd.org/D9606 r314863: Stop installing pcap-int.h, which is the internal interface for libpcap. Reference: https://github.com/the-tcpdump-group/libpcap/issues/560 PR: 217221 r314865: Bump __FreeBSD_version for removal of pcap-int.h. PR: 217221 r316125: MFV r316124: Fix build when WITHOUT_INET6. Reported by: Randy Westlund <rwestlun gmail com>
| * MFC r318689: Add parent interface reference counting to if_vlan.mav2017-05-301-14/+26
| | | | | | | | Using plain ifunit() looks like a request for troubles.
| * MFC 318512sephe2017-05-221-1/+1
| | | | | | | | | | | | | | | | | | | | net/vlan: Revert 305177 Miss read the parentheses. Reported by: oleg@ Reviewed by: hps@ Sponsored by: Microsoft
| * Persistently store NIC's hardware MAC address, and add a way to retrive itrpokala2017-05-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | jhb pointed out that (struct ifnet) is part of the network driver KBI, and thus the offsets of internal fields must not change. Therefore, move the new "if_hw_addr" field to the end, and consume one of the "if_pspare"s; that's what they're there for. The new field replaces the *last* element of that array; that way, offsetof(if_pspare) and offsetof(if_ispare) are unchanged compared to before r318397. PR: 194386 Reviewed by: jhb Pointyhat to: rpokala Sponsored by: Panasas
| * MFC r318160, 318176: Persistently store NIC's hardware MAC address, and addrpokala2017-05-173-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a way to retrive it The MAC address reported by `ifconfig ${nic} ether' does not always match the address in the hardware, as reported by the driver during attach. In particular, NICs which are components of a lagg(4) interface all report the same MAC. When attaching, the NIC driver passes the MAC address it read from the hardware as an argument to ether_ifattach(). Keep a second copy of it, and create ioctl(SIOCGHWADDR) to return it. Teach `ifconfig' to report it along with the active MAC address. PR: 194386
| * MFC r318147: Add several new media types to if_media.herj2017-05-162-0/+16
| | | | | | | | | | | | | | These include several 25G types (for active direct attach cables and LR modules), and a missing type for 10G active direct attach. Sponsored by: Intel Corporation
| * MFC r317585: Propagate IFCAP_LRO from trunk to vlan interface.mav2017-05-161-0/+10
| | | | | | | | | | False positive here cost nothing, while false negative may lead to some confusions.
| * MFC r317547: Allow some control over enabled capabilities for if_vlan.mav2017-05-161-19/+45
| | | | | | | | | | | | | | It improves interoperability with if_bridge, which may need to disable some capabilities not supported by other members. IMHO there is still open question about LRO capability, which may need to be disabled on physical interface.
| * MFC r317696, r317723, r317836: Introduce sleepable locks into if_lagg.mav2017-05-162-344/+221
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this change if_lagg was using nonsleepable rmlocks to protect its internal state. This patch introduces another sx lock to protect code paths that require sleeping, while still uses old rmlock to protect hot nonsleepable data paths. This change allows to remove taskqueue decoupling used before to change interface addresses without holding the lock. Instead it uses sx lock to protect direct if_ioctl() calls. As another bonus, the new code synchronizes enabled capabilities of member interfaces, and allows to control them with ifconfig laggX, that was impossible before. This part should fix interoperation with if_bridge, that may need to disable some capabilities, such as TXCSUM or LRO, to allow bridging with noncapable interfaces.
| * MFC r318015:bz2017-05-121-1/+0
| | | | | | | | Adjust a comment.
* | Merge remote-tracking branch 'origin/stable/11' into devel-11Renato Botelho2017-05-1116-71/+1138
|\ \ | |/
| * MFC r317279: Remove unneeded conditions.mav2017-05-021-8/+4
| |
| * MFC r317253: Add interface reference counting to if_lagg.mav2017-05-021-3/+13
| | | | | | | | Using plain ifunit() looks like request for troubles.
| * MFC r312979 (by loos):mav2017-05-022-7/+12
| | | | | | | | | | | | | | | | | | | | Do not update the lagg link layer address when destroying a lagg clone. This would enqueue an event to send the gratuitous arp on a dying lagg interface without any physical ports attached to it. Apart from that, the taskqueue_drain() on lagg_clone_destroy() runs too late, when the ifp data structure is already freed. Fix that too.
| * MFC r316699:ae2017-04-253-14/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | Do not adjust interface MTU automatically. Leave this task to the system administrator. Before r274246 interface MTU was adjusted only when GRE key is configured. The r274246 has changed this behavior to automatically adjust MTU when any option, that changes the size of GRE header is configured. This patch removes automatic MTU adjustment from if_gre(4) and if_me(4), and restores the behavior that was prior to r274246. Differential Revision: https://reviews.freebsd.org/D10215
| * MFC r316716:ae2017-04-181-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | Inherit IPv6 checksum offloading flags to vlan interfaces. if_vlan(4) interfaces inherit IPv4 checksum offloading flags from the parent when VLAN_HWCSUM and VLAN_HWTAGGING flags are present on the parent interface. Do the same for IPv6 checksum offloading flags. Reported by: Harry Schmalzbauer Reviewed by: np, gnn Differential Revision: https://reviews.freebsd.org/D10356
OpenPOWER on IntegriCloud