aboutsummaryrefslogtreecommitdiff
path: root/sbin/ifconfig/ifpfsync.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-161-2/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* pfsync: transport over IPv6Luiz Amaral2023-07-131-5/+10
| | | | | | | | | | Implement pfsync over IPv6. Submitted by: Luiz Amaral <email@luiz.eng.br> Submitted by: Naman Sood <naman@freebsdfoundation.org> Reviewed by: kp Sponsored by: InnoGames GmbH Differential Revision: https://reviews.freebsd.org/D40102
* ping: low-effort fix to make it compilable without inetMateusz Guzik2023-07-051-0/+4
|
* ifconfig: remove (most of) the usages of global 'struct ifreq ifr'.Alexander V. Chernikov2023-06-161-17/+18
| | | | | | | | | | | It is hard to reason about the contents of 'ifr' at any given time as nearly every function sets random fields or pointers in this structure. Use local on-stack clean 'struct ifreq' for each function instead. Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D40534 MFC after: 2 weeks
* ifconfig: fix warnings #2Alexander V. Chernikov2023-06-011-5/+4
| | | | | | | Fix all -Wparameter-unused and cast alignment Differential Revision: https://reviews.freebsd.org/D40303 MFC after: 2 weeks
* pf: make contents of struct pfsync_state configurableKajetan Staszkiewicz2023-05-301-1/+27
| | | | | | | | | | | | | | | | | | Make struct pfsync_state contents configurable by sending out new versions of the structure in separate subheader actions. Both old and new version of struct pfsync_state can be understood, so replication of states from a system running an older kernel is possible. The version being sent out is configured using ifconfig pfsync0 … version XXXX. The version is an user-friendly string - 1301 stands for FreeBSD 13.1 (I have checked synchronization against a host running 13.1), 1400 stands for 14.0. A host running an older kernel will just ignore the messages and count them as "packets discarded for bad action". Reviewed by: kp Sponsored by: InnoGames GmbH Differential Revision: https://reviews.freebsd.org/D39392
* ifconfig: introduce `ifconfig_context` to store current global state.Alexander V. Chernikov2023-05-241-41/+27
| | | | | | | | | | | | | | | | | The structure consists of all current context - arguments, open sockets, current family and so on. Pass this structure as a first argument to most of the af_ menthods. This allows to propagate and update shared data without using global variables. The diff is pretty large, but de-facto mechanical. All changes except the structure setup in ifconfig[_netlink].c are one-line mechanical changes. Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D40239 MFC after: 2 weeks
* ifconfig: cleanup warnings #1Alexander V. Chernikov2023-05-241-5/+3
| | | | | | | Cleanup compiler warnings in preparation to set Wextra and remove WARNS?=2 Differential Revision: https://reviews.freebsd.org/D40238 MFC after: 2 weeks
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-121-1/+1
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* pfsync: prepare code to accommodate AF_INET6 familyLuiz Amaral2022-11-091-77/+245
| | | | | | | | | | | | Work is ongoing to add support for pfsync over IPv6. This required some changes to allow for differentiating between the two families in a more generic way. This patch converts the relevant ioctls to using nvlists, making future extensions (such as supporting IPv6 addresses) easier. Sponsored by: InnoGames GmbH Differential Revision: https://reviews.freebsd.org/D36277
* pfsync: fix incorrect enabling of defer modeKristof Provost2021-12-061-1/+1
| | | | | | | | | | | | | When we exposed the PFSYNCF_OK flag to userspace in 5f5bf88949d we unintentionally caused defer mode to always be enabled. The ioctl check only looked for nonzero, not for the PFSYNCF_DEFER flag. Fix this check and ensure ifconfig sets the flag. Reviewed by: glebius MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D33244
* pfsync: Expose PFSYNCF_OK flag to userspaceKristof Provost2021-04-261-1/+4
| | | | | | | | | | | Add 'syncok' field to ifconfig's pfsync interface output. This allows userspace to figure out when pfsync has completed the initial bulk import. Reviewed by: donner MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D29948
* ifconfig: fix endianness bug displaying pfsync interfacesAlan Somers2019-01-281-3/+3
| | | | | | | | | Reviewed by: kp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D19005 Notes: svn path=/head/; revision=343530
* various: general adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-1/+3
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. No functional change intended. Notes: svn path=/head/; revision=326276
* Various Coverity fixes in ifconfig(8)Alan Somers2017-05-031-0/+1
| | | | | | | | | | | | | | | | | | | * Exit early if kldload(2) fails (1011259). This is the only change that affects ifconfig's behavior. * Close memory and resource leaks (1305624, 1305205, 1007100) * Mark usage() as _Noreturn (1305806, 1305750) * Fix some dereference after null checks (1011474, 270774) Reported by: Coverity CID: 1305624, 1305205, 1007100, 1305806, 1305750, 1011474, CID: 270774, 1011259 Reviewed by: cem MFC after: 3 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D10587 Notes: svn path=/head/; revision=317755
* Replace N #defines with nitems to simplify ifconfig code slightlyEnji Cooper2015-09-271-4/+2
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=288305
* Make it possible to switch pfsync(4) deferral mechanism on/off.Gleb Smirnoff2012-04-031-3/+25
| | | | | | | Obtained from: OpenBSD Notes: svn path=/head/; revision=233847
* Print pfsync interface status if either syncpeer or syncdev is configured.Gleb Smirnoff2006-06-061-6/+11
| | | | Notes: svn path=/head/; revision=159336
* Update ifconfig's pfsync module for 3.7 pfsync(4)Max Laier2005-05-031-14/+80
| | | | Notes: svn path=/head/; revision=145842
* Use afswch->af_other_status for carp_status() and pfsync_status().Gleb Smirnoff2005-02-221-3/+3
| | | | | | | Sponsored by: Rambler Notes: svn path=/head/; revision=142224
* Add CARP (Common Address Redundancy Protocol), which allows multipleGleb Smirnoff2005-02-221-0/+144
hosts to share an IP address, providing high availability and load balancing. Original work on CARP done by Michael Shalayeff, with many additions by Marco Pfatschbacher and Ryan McBride. FreeBSD port done solely by Max Laier. Patch by: mlaier Obtained from: OpenBSD (mickey, mcbride) Notes: svn path=/head/; revision=142215