#
c3e94237 |
| 31-May-2024 |
Gordon Tetlow <gordon@FreeBSD.org> |
Move print_bits to ifconfig.c and make available to other src files.
Reviewed by: emaste Event: Kitchener-Waterloo Hackathon 202406 Differential Revision: https://reviews.freebsd.org/D45441
|
Revision tags: release/14.1.0, release/13.3.0 |
|
#
cd201c09 |
| 28-Nov-2023 |
Mike Karels <karels@FreeBSD.org> |
ifconfig: add -D option to print driver name for interface
Add -D option to add the drivername and unit number to ifconfig output for normal display, including -a. Use ifconfig_get_orig_name() from
ifconfig: add -D option to print driver name for interface
Add -D option to add the drivername and unit number to ifconfig output for normal display, including -a. Use ifconfig_get_orig_name() from libifconfig to fetch the name. Note that this is the original name for many drivers, but not for some exceptions like epair (which appends 'a' or 'b' to the unit number). epair interface pairs both display as "epair0", etc. Make -v imply -D; might as well be fully verbose.
MFC after: 1 week Reviewed by: zlei, kp Differential Revision: https://reviews.freebsd.org/D42721
show more ...
|
Revision tags: release/14.0.0 |
|
#
31016aa0 |
| 25-Aug-2023 |
Gleb Smirnoff <glebius@FreeBSD.org> |
ifconfig: fix 'ifconfig -l ether'
When matching interfaces for being Ethernet, use same trick that the link module does - pass if_type through convert_iftype(). That restores historicaly behaviour o
ifconfig: fix 'ifconfig -l ether'
When matching interfaces for being Ethernet, use same trick that the link module does - pass if_type through convert_iftype(). That restores historicaly behaviour of listing lagg(4) ports.
Reviewed by: melifaro Differential Revision: https://reviews.freebsd.org/D41585
show more ...
|
#
b3e76948 |
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
Remove $FreeBSD$: two-line .h pattern
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
|
#
08992b20 |
| 19-Jun-2023 |
John Baldwin <jhb@FreeBSD.org> |
ifconfig: Avoid issues with trying to negate unsigned values.
The if_flags and if_cap fields hold a bitmask of flags. If a flag is the MSB of the field, then the logic in setifflags and setifcap wh
ifconfig: Avoid issues with trying to negate unsigned values.
The if_flags and if_cap fields hold a bitmask of flags. If a flag is the MSB of the field, then the logic in setifflags and setifcap which uses a < 0 check does the wrong thing (it tries to clear the flag rather than setting it). Also, trying to use -<FOO> doesn't actually work as the result is a nop. To fix, stop overloading setifcap and setifflags and instead add new dedicated action functions clearifcap and clearifflags for clearing a flag. The value passed in the argument to the command is now always the raw flag.
This was reported by a GCC warning after raising WARNS:
sbin/ifconfig/ifconfig.c:2061:33: error: integer overflow in expression '-2147483648' of type 'int' results in '-2147483648' [-Werror=overflow] 2061 | DEF_CMD("-txtlsrtlmt", -IFCAP_TXTLS_RTLMT, setifcap), | ^
Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D40608
show more ...
|
#
c344eff9 |
| 16-Jun-2023 |
Alexander V. Chernikov <melifaro@FreeBSD.org> |
netlink: dump interface capabilities with other interface data.
This change exports interface capabilities using the standard Netlink attribute type, bitset, and switches `ifconfig(8)` to use it whe
netlink: dump interface capabilities with other interface data.
This change exports interface capabilities using the standard Netlink attribute type, bitset, and switches `ifconfig(8)` to use it when displaying interface data. Bitset comes in two representations. The first one is "compact", where the bits are exported via two arrays - "mask" listing the "valid" bits and "values, providing the values for those bits. The second one is more verbose, listing each bit as a separate item, with its name, id and value. The latter option is handy when submitting update requests.
The support for setting capabilities will be added in the upcoming diffs.
Differential Revision: https://reviews.freebsd.org/D40331
show more ...
|
#
a3930cd4 |
| 14-Jun-2023 |
Alexander V. Chernikov <melifaro@FreeBSD.org> |
ifconfig: use default (more rigid) WARNS level.
It helps catch more errors at compile time.
Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D40536 MFC after: 2 weeks
|
#
f414f37e |
| 14-Jun-2023 |
Alexander V. Chernikov <melifaro@FreeBSD.org> |
ifconfig: remove global 'ifr' usage from ifmedia.c & remove 'ifr'.
Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D40535 MFC after: 2 weeks
|
#
7fa282e6 |
| 14-Jun-2023 |
Alexander V. Chernikov <melifaro@FreeBSD.org> |
ifconfig: remove (most of) the usages of global 'struct ifreq ifr'.
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
ifconfig: remove (most of) the usages of global 'struct ifreq ifr'.
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
show more ...
|
#
3927d0fb |
| 14-Jun-2023 |
Alexander V. Chernikov <melifaro@FreeBSD.org> |
ifconfig: fix -Wunused warnings
MFC after: 2 weeks
|
#
a6094f84 |
| 14-Jun-2023 |
Alexander V. Chernikov <melifaro@FreeBSD.org> |
ifconfig: remove 'newaddr' global variable
Differential Revision: https://reviews.freebsd.org/D40441 MFC after: 2 weeks
|
#
bbad5525 |
| 14-Jun-2023 |
Alexander V. Chernikov <melifaro@FreeBSD.org> |
ifconfig: start ifconfig context from main()
Differential Revision: https://reviews.freebsd.org/D40440 MFC after: 2 weeks
|
#
ea73ff97 |
| 13-Jun-2023 |
Alexander V. Chernikov <melifaro@FreeBSD.org> |
ifconfig: remove global_args variable.
This variable was temporarily introduced in the beginning of the code cleanup. Use on-stack instance in main() instead.
Reviewed By: kp Differential Revision:
ifconfig: remove global_args variable.
This variable was temporarily introduced in the beginning of the code cleanup. Use on-stack instance in main() instead.
Reviewed By: kp Differential Revision: https://reviews.freebsd.org/D40439 MFC after: 2 weeks
show more ...
|
#
85e0016a |
| 13-Jun-2023 |
Alexander V. Chernikov <melifaro@FreeBSD.org> |
ifconfig: remove global 'name' variable.
Consistenly use newly-added 'ctx->ifname' as the name of the current target interface.
Reviewed By: kp Differential Revision: https://reviews.freebsd.org/D4
ifconfig: remove global 'name' variable.
Consistenly use newly-added 'ctx->ifname' as the name of the current target interface.
Reviewed By: kp Differential Revision: https://reviews.freebsd.org/D40438 MFC after: 2 weeks
show more ...
|
#
c6f0602f |
| 13-Jun-2023 |
Alexander V. Chernikov <melifaro@FreeBSD.org> |
ifconfig: pass if_ctx instead of socket to the tunnel handlers.
This is a pre-requisite for the global 'name' variable removal.
Reviewed By: kp Differential Revision: https://reviews.freebsd.org/D4
ifconfig: pass if_ctx instead of socket to the tunnel handlers.
This is a pre-requisite for the global 'name' variable removal.
Reviewed By: kp Differential Revision: https://reviews.freebsd.org/D40432 MFC after: 2 weeks
show more ...
|
#
4106282e |
| 13-Jun-2023 |
Alexander V. Chernikov <melifaro@FreeBSD.org> |
ifconfig: remove global 'printifname' variable.
This variable was used to print the created interface name in the atexit(3) handler. The interface name was calculated in the ifclonecreate() by match
ifconfig: remove global 'printifname' variable.
This variable was used to print the created interface name in the atexit(3) handler. The interface name was calculated in the ifclonecreate() by matching old & new names.
This change alter the implementation the following way: 1) the function responsible for the interface creation (ifcreate_ioctl) updates all necessary state internally. This removes the need for the name manipulation hack in wlan_create(). 2) As atexit(3) handler does not accept any parameters, explicitly store the name to print in the ifname_to_print variable read by the atexit(3) handler.
Reviewed By: kp Differential Revision: https://reviews.freebsd.org/D40431 MFC after: 2 weeks
show more ...
|
#
c6885dbd |
| 13-Jun-2023 |
Alexander V. Chernikov <melifaro@FreeBSD.org> |
ifconfig: eliminate global 'verbose' and 'printkey' variables
Reviewed By: kp Differential Revision: https://reviews.freebsd.org/D40427 MFC after: 2 weeks
|
#
74b42611 |
| 13-Jun-2023 |
Alexander V. Chernikov <melifaro@FreeBSD.org> |
ifconfig: add if_ctx argument to the generic and ifclone callbacks.
This is the continuation of the ifconfig cleanup work. This change is a pre-requsite for the next changes removing some of the glo
ifconfig: add if_ctx argument to the generic and ifclone callbacks.
This is the continuation of the ifconfig cleanup work. This change is a pre-requsite for the next changes removing some of the global variables. It will also help in implementing functionality via Netlink instead of ioctl. No functional changes intended. * vxlan_cb() was removed as it contained no code * ioctl_ifcreate() was renamed to ifcreate_ioctl() to follow the other netlink/ioctl function naming. Netlink and ioctl provide _different_ interfaces and it's not possible to have a unified interface object that can be filled by either netlink or ioctl implementations. With that in mind, I'm leaning more to the function_<nl|ioctl> postfix pattern, than doing ioctl_ or netlink_ prefix.
Reviewed By: kp Differential Revision: https://reviews.freebsd.org/D40426 MFC after: 2 weeks
show more ...
|
#
b66b2c4d |
| 02-Jun-2023 |
Elyes Haouas <ehaouas@noos.fr> |
ifconfig: Fix typos
Signed-off-by: Elyes Haouas <ehaouas@noos.fr> Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/653
|
#
0c2beef7 |
| 01-Jun-2023 |
Alexander V. Chernikov <melifaro@FreeBSD.org> |
ifconfig: fix warnings #2
Fix all -Wparameter-unused and cast alignment
Differential Revision: https://reviews.freebsd.org/D40303 MFC after: 2 weeks
|
#
6d204407 |
| 25-May-2023 |
Alexander V. Chernikov <melifaro@FreeBSD.org> |
ifconfig: fix ifconfig IFX inet[6] ADDR -alias
Internally, inet and inet6 family handlers store state for address addition and deletion separately, as, for example, "ifconfig lo0 inet 127.0.0.2/32
ifconfig: fix ifconfig IFX inet[6] ADDR -alias
Internally, inet and inet6 family handlers store state for address addition and deletion separately, as, for example, "ifconfig lo0 inet 127.0.0.2/32" triggers a) deletion of the first interface address and b) addition of a new one. The current logic behind handling "-alias" being the last argument is to copy the address from "addition" state to the "deletion" state. It is done by the generic ifconfig code, which explicitly typecasts opaque handler state pointers to "struct ifreq", which doesn't work in the Netlink case.
Fix this by introducing family-specific "af_copyaddr" handler, which removes the peeking & typecasting logic from the generic code.
Reported by: otis Tested by: otis
show more ...
|
#
4bf44dd7 |
| 20-May-2023 |
Alexander V. Chernikov <melifaro@FreeBSD.org> |
ifconfig: switch IPv4/IPv6 address manipulations to Netlink.
Differential Revision: https://reviews.freebsd.org/D40182
|
#
6e3a9d7f |
| 23-May-2023 |
Alexander V. Chernikov <melifaro@FreeBSD.org> |
ifconfig: introduce `ifconfig_context` to store current global state.
The structure consists of all current context - arguments, open sockets, current family and so on.
Pass this structure as a fir
ifconfig: introduce `ifconfig_context` to store current global state.
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
show more ...
|
#
44cd85d4 |
| 23-May-2023 |
Alexander V. Chernikov <melifaro@FreeBSD.org> |
ifconfig: cleanup warnings #1
Cleanup compiler warnings in preparation to set Wextra and remove WARNS?=2
Differential Revision: https://reviews.freebsd.org/D40238 MFC after: 2 weeks
|
#
7e49aa86 |
| 23-May-2023 |
Yan Ka Chiu <nyan@myuji.xyz> |
ifconfig(8): Teach ifconfig to attach and run itself in a jail
Add -j <jail> flag to ifconfig to allow ifconfig to attach and run inside a jail. This allow parent to configure network interfaces of
ifconfig(8): Teach ifconfig to attach and run itself in a jail
Add -j <jail> flag to ifconfig to allow ifconfig to attach and run inside a jail. This allow parent to configure network interfaces of its children even if ifconfig is not available in child's tree (e.g. Linux Jails)
Reviewed by: emaste, khng, melifaro Event: Kitchener-Waterloo Hackathon 202305 MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D40213
show more ...
|