]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
ifconfig: introduce `ifconfig_context` to store current global state.
authorAlexander V. Chernikov <melifaro@FreeBSD.org>
Tue, 23 May 2023 17:02:12 +0000 (17:02 +0000)
committerAlexander V. Chernikov <melifaro@FreeBSD.org>
Wed, 24 May 2023 10:40:34 +0000 (10:40 +0000)
commit6e3a9d7f2c8dc18dc901d4f860a65028c0a82a64
tree2aadbdd46f837dc467e89f11e2345daa2e6c3e4d
parent44cd85d42e5ddb1d5811b388218e14582e078bf8
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
23 files changed:
sbin/ifconfig/af_inet.c
sbin/ifconfig/af_inet6.c
sbin/ifconfig/af_link.c
sbin/ifconfig/af_nd6.c
sbin/ifconfig/carp.c
sbin/ifconfig/ifbridge.c
sbin/ifconfig/ifclone.c
sbin/ifconfig/ifconfig.c
sbin/ifconfig/ifconfig.h
sbin/ifconfig/ifconfig_netlink.c
sbin/ifconfig/iffib.c
sbin/ifconfig/ifgif.c
sbin/ifconfig/ifgre.c
sbin/ifconfig/ifgroup.c
sbin/ifconfig/ifieee80211.c
sbin/ifconfig/ifipsec.c
sbin/ifconfig/iflagg.c
sbin/ifconfig/ifmac.c
sbin/ifconfig/ifmedia.c
sbin/ifconfig/ifpfsync.c
sbin/ifconfig/ifstf.c
sbin/ifconfig/ifvlan.c
sbin/ifconfig/ifvxlan.c