Home | History | Annotate | Download | only in ifwatchd
History log of /src/usr.sbin/ifwatchd/ifwatchd.c
RevisionDateAuthorComments
 1.47  01-Jul-2023  mlelstv Don't call UP script when an IP address becomes deprecated.
 1.46  04-Oct-2020  roy branches: 1.46.6;
ifwatchd: Enable SO_RERROR to re-sync interface state.

Interface arrival, departure and link state changes will sync
and if different will be actioned.

Currently we do not track addresses, so any changes there are still lost.
 1.45  27-Sep-2020  roy ifwatchd: remove SIOCGIFDATA and SIOCGIFMEDIA ioctls

getifaddrs(3) and route(4) provide all the data we need.
 1.44  23-Sep-2020  roy ifwatchd: Check link state if no media is supported on initial ups.

We can check this via SIOCGIFDATA and ifi_link_state.
 1.43  07-Mar-2018  roy Remove case labels we will never trigger due to filtering.
 1.42  11-Apr-2017  roy branches: 1.42.10;
Use RO_MSGFILTER.
 1.41  07-Oct-2016  christos branches: 1.41.2;
CID 1373516: Missing breaks
Also delete perror, fix fprintf to be syslog.
 1.40  06-Oct-2016  roy Inhibit initial up should only apply at program start, not for hot plugged interfaces while it's running.
 1.39  06-Oct-2016  roy Remove rescan_interfaces as the interface announcement message
contains the interface index.
 1.38  06-Oct-2016  roy Simplify logic - invoke script when address is added and ready or
when removed.
 1.37  06-Oct-2016  roy We already know the interface name, so don't bother calling if_indextoname
to work it out again.
 1.36  29-Sep-2016  roy Sprinkle some RCSID loving.
 1.35  29-Sep-2016  roy Now that sppp announces address additions and removals with state
flags, we no longer need the custom sppp code to detect if we are
connected or not.

Add commentary on if we really need to handle RTM_DELADDR only when
detached.
 1.34  29-Sep-2016  roy Don't invoke scripts for INADDR_ANY or INADDR_BROADCAST addresses.
 1.33  21-Sep-2016  roy Check address is not tentative, duplicated or detached before running
scripts.

XXX Do we want new script actions for detached or duplicated addresses?
 1.32  21-Sep-2016  roy We should always know the interface the address message was for.
 1.31  21-Sep-2016  roy Add some consistency for dispatching .... always send the whole message.
 1.30  21-Sep-2016  roy Sprinkle some const.
 1.29  21-Sep-2016  roy Skip message if not our RTM_VERSION and silently ignore old message types.
 1.28  21-Sep-2016  roy Use recvmsg to ensure we get every message rather than potentially overflowing our buffer.
 1.27  27-Jan-2016  riastradh branches: 1.27.2;
Use unsigned, not signed, int for shifting 1 left until zero.

Signed shift into sign bit and beyond is undefined behaviour.

From Michael McConville.
 1.26  30-Aug-2011  joerg static + __dead
 1.25  04-Feb-2011  martin Use RT_ROUNDUP() and friends from sys/route.h instead of homegrown
variants.
 1.24  15-Apr-2009  lukem branches: 1.24.2;
Fix -Wshadow and 'setjmp clobber' warnings.
 1.23  24-May-2008  joerg branches: 1.23.6;
Just ignore a bunch of well-known routing socket messages ifwatchd
doesn't care about to make verbose mode less noisy. When it does print
an unknown header type, also say which one it doesn't like.
 1.22  28-Apr-2008  martin branches: 1.22.2;
Remove clause 3 and 4 from TNF licenses
 1.21  22-Dec-2007  dyoung branches: 1.21.4;
Cosmetic: KNF. Shorten staircases. Delete some whitespace at line
ends (makes navigation with vi more reliable).
 1.20  25-Nov-2004  martin branches: 1.20.16;
In the initial interface scan at start time, query the link status of
the interfaces and call the CARRIER script if a link is already there.
This allows me to boot my notebook with the cable pluged and
fixes PR bin/26830.
 1.19  04-Jan-2004  martin branches: 1.19.4;
Add support to call scripts at carrier detect/drop time (on network
interfaces that report this).
Basically from Brian Grayson, fixes his PR bin/23191.
 1.18  27-Dec-2003  martin Use the new SPPPGETSTATUSNCP ioctl, if supported, to avoid reporting
intermitent changes on "volatile" interfaces based on if_spppsubr.c.
This interfaces used to cause ifwatchd to call the up and down scripts
with 0.0.0.0 addresses between entering PPP phase network and IPCP
completition.
 1.17  12-Nov-2003  grant s/netbsd.org/NetBSD.org/i
 1.16  04-Jul-2003  abs Fix typo in last change (misplaced ');')
 1.15  04-Jul-2003  wiz Sync usage with man page.
 1.14  23-Jun-2003  martin Improve diagnostics a bit, log to syslog.
 1.13  17-May-2003  itojun KNF
 1.12  16-Apr-2003  wiz Sync usage with man page.
 1.11  06-Mar-2003  martin Run "arrival" scripts too in the inital pass on startup.
Open the routing socket before this pass to close a small window where
we would miss messages at startup (and get state kept by the scripts
out of sync).
Patch supplied by KOIE Hidetaka in private mail.
 1.10  05-Mar-2003  martin Add support for watching coming/going pccard interfaces.
Patch from KOIE Hidetaka in PR bin/20584.
 1.9  15-Apr-2002  tron Use vfork(2) and exec(2) instead of system for performance and security
reasons.
 1.8  15-Apr-2002  tron Don't invoke the up- and down-script for link local IPv6 addresses.
 1.7  15-Apr-2002  tron Invoke "ip-up" and "ip-down" script with parameters exactly matching
those used by pppd(8).
 1.6  14-Apr-2002  martin Fix copyright notice, sprinkle some $NetBSD$.
 1.5  10-Jan-2002  martin Add, #ifdef SPPP_IF_SUPPORT, special case treatment for sys/net/if_spppsubr.c
based interfaces. Note: all other interface types work the same as before,
and no names are hardcoded.

When a if_spppsubr.c based interface is marked IFF_UP, but has not yet
reached phase NETWORK (i.e. it didn't connect yet or authentication has not
yet completed) do not call the ip-up script for it on the initial pass
over all IFF_UP interfaces.

This fixes a race condition on startup when ip-up/ip-down are statefull
and need to be called pairwise (for example if ip-up adds and ip-down
removes a default route).
 1.4  10-Jan-2002  martin Pass the remote address (or broadcast addres) to the up/down scripts as
well. This is very usefull for setting up the right routes ;-)

Thanks to Bjoern Labitzke for pointing out this missing feature.
 1.3  10-Dec-2001  martin Call up-scripts for interface already up on startup to account for the
late start of this daemon on system boot.
Add and document an option to prevent this.
 1.2  19-Nov-2001  martin Add $NetBSD$, remove unneeded includes.
 1.1  19-Nov-2001  martin New utility: ifwatchd.
Monitors the routing socket for address changes of autonomous (kernel only)
interfaces (like PPPoE) and runs up/down scripts similar to what pppd
does for its interfaces.
 1.19.4.1  23-Feb-2005  he Pull up revision 1.20 (requested by martin in ticket #1003):
In the initial interface scan at start time, query the link
status of the interfaces and call the CARRIER script if a link
is already there. Fixes PR#26830.
 1.20.16.1  09-Jan-2008  matt sync with HEAD
 1.21.4.2  04-Jun-2008  yamt sync with head
 1.21.4.1  18-May-2008  yamt sync with head.
 1.22.2.1  23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.23.6.1  13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.24.2.1  08-Feb-2011  bouyer Sync with HEAD
 1.27.2.2  26-Apr-2017  pgoyette Sync with HEAD
 1.27.2.1  04-Nov-2016  pgoyette Sync with HEAD
 1.41.2.1  21-Apr-2017  bouyer Sync with HEAD
 1.42.10.1  15-Mar-2018  pgoyette Synch with HEAD
 1.46.6.1  21-Sep-2024  martin Pull up following revision(s) (requested by rin in ticket #907):

usr.sbin/ifwatchd/ifwatchd.c: revision 1.47

Don't call UP script when an IP address becomes deprecated.

RSS XML Feed