Commit Graph

62 Commits

Author SHA1 Message Date
roy
1914784e96 Remove case labels we will never trigger due to filtering. 2018-03-07 10:06:41 +00:00
roy
f2128fd5cf Use RO_MSGFILTER. 2017-04-11 14:15:08 +00:00
christos
ec9f40cce0 CID 1373516: Missing breaks
Also delete perror, fix fprintf to be syslog.
2016-10-07 15:49:58 +00:00
roy
bfbe23745b Inhibit initial up should only apply at program start, not for hot plugged interfaces while it's running. 2016-10-06 11:13:57 +00:00
roy
5bf9473939 Remove rescan_interfaces as the interface announcement message
contains the interface index.
2016-10-06 11:08:55 +00:00
roy
10e2b68c80 Simplify logic - invoke script when address is added and ready or
when removed.
2016-10-06 10:33:05 +00:00
roy
ef126e0d1a We already know the interface name, so don't bother calling if_indextoname
to work it out again.
2016-10-06 10:30:31 +00:00
roy
06a737b41a Sprinkle some RCSID loving. 2016-09-29 15:25:28 +00:00
roy
18cd17b80a 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.
2016-09-29 15:21:09 +00:00
roy
547a909ccc Don't invoke scripts for INADDR_ANY or INADDR_BROADCAST addresses. 2016-09-29 13:36:30 +00:00
roy
ebe6b5a845 Check address is not tentative, duplicated or detached before running
scripts.

XXX Do we want new script actions for detached or duplicated addresses?
2016-09-21 21:07:29 +00:00
roy
f095b6732c We should always know the interface the address message was for. 2016-09-21 20:31:31 +00:00
roy
3281aec338 Add some consistency for dispatching .... always send the whole message. 2016-09-21 18:18:10 +00:00
roy
4ed3a4f995 Sprinkle some const. 2016-09-21 16:47:35 +00:00
roy
4862748bc4 Skip message if not our RTM_VERSION and silently ignore old message types. 2016-09-21 14:50:48 +00:00
roy
af543597d1 Use recvmsg to ensure we get every message rather than potentially overflowing our buffer. 2016-09-21 14:46:55 +00:00
riastradh
8248001c7f Use unsigned, not signed, int for shifting 1 left until zero.
Signed shift into sign bit and beyond is undefined behaviour.

From Michael McConville.
2016-01-27 18:55:51 +00:00
joerg
6bd0ed17f2 static + __dead 2011-08-30 18:57:38 +00:00
martin
82fe9809af Use RT_ROUNDUP() and friends from sys/route.h instead of homegrown
variants.
2011-02-04 14:31:23 +00:00
wiz
c43843983b Remove trailing whitespace, replace "Ar -i" with "Fl i". 2010-04-16 13:56:45 +00:00
jmcneill
2ad2163edc add examples for setting ipv6 default routes in ip-up/ip-down scripts 2010-04-16 13:47:50 +00:00
lukem
a35a433358 Fix -Wshadow and 'setjmp clobber' warnings. 2009-04-15 08:33:04 +00:00
joerg
997634fe14 Fix preamble to match order set out by mdoc(7). Discussed with wiz. 2009-03-09 19:24:26 +00:00
joerg
bbdb057767 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.
2008-05-24 17:45:14 +00:00
martin
11a6dbe728 Convert TNF licenses to new 2 clause variant 2008-04-30 13:10:46 +00:00
martin
ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
dyoung
1b8630a278 Cosmetic: KNF. Shorten staircases. Delete some whitespace at line
ends (makes navigation with vi more reliable).
2007-12-22 00:57:15 +00:00
wiz
c79a26d6f8 Sort options in SYNOPSIS. 2004-11-25 16:05:11 +00:00
wiz
56c0f8cbac Bump date for previous; new sentence, new line. 2004-11-25 16:04:30 +00:00
martin
4d3b851c60 Document that carrier scripts are run at starttime. Bump date. 2004-11-25 15:55:29 +00:00
martin
59ca47f545 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.
2004-11-25 06:57:38 +00:00
martin
06eb7200cc 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.
2004-01-04 22:19:51 +00:00
martin
25943be498 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.
2003-12-27 00:05:46 +00:00
grant
cacf2d0f45 s/netbsd.org/NetBSD.org/i 2003-11-12 13:31:07 +00:00
abs
e364b78d41 Fix typo in last change (misplaced ');') 2003-07-04 14:11:36 +00:00
wiz
988b927344 New sentence, new line; limit to 80 chars lines. 2003-07-04 12:48:30 +00:00
wiz
1dbe2d9b38 Sync usage with man page. 2003-07-04 12:45:05 +00:00
wiz
67a1a16995 Sort sections, options, grammar fix. 2003-07-04 12:44:12 +00:00
martin
c7eb05dd91 Clarify description of -v, following a hint from felix zaslavski. 2003-06-24 09:31:17 +00:00
martin
3088b1239b Improve diagnostics a bit, log to syslog. 2003-06-23 21:50:12 +00:00
itojun
84e2880efb KNF 2003-05-17 19:14:25 +00:00
wiz
064e896cda Sync usage with man page. 2003-04-16 09:09:52 +00:00
wiz
e0513f4ff2 pppoe(4), not (8). Uppercase PCMCIA. 2003-04-16 09:06:55 +00:00
martin
5005fdb656 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.
2003-03-06 13:33:29 +00:00
martin
549d82b84d Add support for watching coming/going pccard interfaces.
Patch from KOIE Hidetaka in PR bin/20584.
2003-03-05 09:03:49 +00:00
grant
806593a806 The correct capitalisation of 'NetBSD.org' is (you
guessed it) 'NetBSD.org'.

some mdoc fixes.
2003-02-14 16:11:34 +00:00
wiz
d62f6fdd66 this: singular, these: plural. 2002-04-16 07:28:09 +00:00
martin
d200477ffe Yet another nit pick. 2002-04-16 06:11:39 +00:00
tron
0f55b8bb08 Use vfork(2) and exec(2) instead of system for performance and security
reasons.
2002-04-15 21:08:41 +00:00
tron
7b03e17cb9 Don't invoke the up- and down-script for link local IPv6 addresses. 2002-04-15 20:42:37 +00:00