summaryrefslogtreecommitdiffstats
path: root/usr.sbin/rtadvd
Commit message (Collapse)AuthorAgeFilesLines
* Use strlcpy() instead of strncpy() when copying ifname to ensuretruckman2016-05-152-3/+3
| | | | | | | that it is NUL terminated. Additional NUL padding is not required for short names. MFC after: 1 week
* rtadvd(8): Fix use-after-close in cm_handler_clientcem2016-05-121-1/+3
| | | | | | | | | cm_send() closes 'fd' on error. In that case, bail out early without trying to recv from or close 'fd' again. Reported by: Coverity CID: 1006078 Sponsored by: EMC / Isilon Storage Division
* rtadvd(8): Don't use-after-freecem2016-05-121-1/+2
| | | | | | | | | | | This whole block of code as committed fully formed in r224144. I'm not really sure what the intent was, but it seems plausible that !persist ifis could need other member cleanup. Don't free the object until after we've finished cleaning its members. Reported by: Coverity CID: 1006079 Sponsored by: EMC / Isilon Storage Division
* rtadvd(8): Fix a typo in full msg receive logiccem2016-05-121-6/+6
| | | | | | | | | | | | | | | | | | | Check against the size of the struct, not the pointer. Previously, a message with a cm_len between 9 and 23 (inclusive) could cause int msglen to underflow and read(2) to be invoked with msglen size (implicitly cast to signed), overrunning the caller-provided buffer. All users of cm_recv() supply a stack buffer. On the other hand, the rtadvd control socket appears to only be writable by the owner, who is probably root. While here, correct some types to be size_t or ssize_t. Reported by: Coverity CID: 1008477 Security: unix socket remotes may overflow stack in rtadvd Sponsored by: EMC / Isilon Storage Division
* usr.sbin: minor spelling fixes on comments.pfg2016-05-011-1/+1
| | | | No functional change.
* Use strlcpy().delphij2015-10-301-2/+1
| | | | MFC after: 2 weeks
* - Fix a bug which prevented dnssl[0-9] and rdnss[0-9] parameters fromhrs2015-10-221-2/+3
| | | | | | | | | working. - Fix a pointer calculation for padding when multiple dnssl[0-9] parameters are specified [*]. Reported by: http://bugs.dragonflybsd.org/issues/2847 [*]
* Now that we own the code, use arc4random(3) unconditionallydelphij2015-10-062-19/+0
| | | | | | and remove the corresponding HAVE_ARC4RANDOM conditions. MFC after: 2 weeks
* Add META_MODE support.sjg2015-06-131-0/+20
|\ | | | | | | | | | | | | | | | | | | | | Off by default, build behaves normally. WITH_META_MODE we get auto objdir creation, the ability to start build from anywhere in the tree. Still need to add real targets under targets/ to build packages. Differential Revision: D2796 Reviewed by: brooks imp
| * dirdeps.mk now sets DEP_RELDIRsjg2015-06-081-2/+0
| |
| * Merge sync of headsjg2015-05-276-9/+10
| |\ | |/ |/|
| * Merge from head@274682sjg2014-11-192-6/+17
| |\
| * | Updated dependenciessjg2014-05-161-1/+0
| | |
| * | Updated dependenciessjg2014-05-101-0/+2
| | |
| * | Merge from headsjg2013-09-059-135/+111
| |\ \
| * \ \ sync from headsjg2013-04-122-10/+28
| |\ \ \
| * | | | Updated dependenciessjg2013-03-111-0/+1
| | | | |
| * | | | Updated dependenciessjg2013-02-161-2/+0
| | | | |
| * | | | Sync FreeBSD's bmake branch with Juniper's internal bmake branch.marcel2012-08-221-0/+21
| | | | | | | | | | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net>
* | | | | Stop including if_var.h from userland.glebius2015-04-064-4/+0
| | | | | | | | | | | | | | | | | | | | Sponsored by: Nginx, Inc.
* | | | | mdoc: sort SEE ALSO.joel2014-12-261-1/+1
| | | | |
* | | | | Convert usr.sbin to LIBADDbapt2014-11-251-2/+1
| | | | | | | | | | | | | | | | | | | | Reduce overlinking
* | | | | Fix the following -Werror warnings from clang 3.5.0, while buildingdim2014-11-221-2/+8
| |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | usr.sbin/rtadvd: usr.sbin/rtadvd/rtadvd.c:1291:7: error: taking the absolute value of unsigned type 'unsigned int' has no effect [-Werror,-Wabsolute-value] abs(preferred_time - pfx->pfx_pltimeexpire) > rai->rai_clockskew) { ^ usr.sbin/rtadvd/rtadvd.c:1291:7: note: remove the call to 'abs' since unsigned values cannot be negative abs(preferred_time - pfx->pfx_pltimeexpire) > rai->rai_clockskew) { ^~~ usr.sbin/rtadvd/rtadvd.c:1324:7: error: taking the absolute value of unsigned type 'unsigned int' has no effect [-Werror,-Wabsolute-value] abs(valid_time - pfx->pfx_vltimeexpire) > rai->rai_clockskew) { ^ usr.sbin/rtadvd/rtadvd.c:1324:7: note: remove the call to 'abs' since unsigned values cannot be negative abs(valid_time - pfx->pfx_vltimeexpire) > rai->rai_clockskew) { ^~~ 2 errors generated. These warnings occur because both preferred_time and pfx_pltimeexpire are uint32_t's, so the subtraction expression is also unsigned, and calling abs() is a no-op. However, the intention was to look at the absolute difference between the two unsigned quantities. Introduce a small static function to clarify what we're doing, and call that instead. Reviewed by: hrs MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D1197
* | | | Check buffer length more strictly.hrs2014-10-111-4/+15
| | | | | | | | | | | | | | | | MFC after: 1 day
* | | | Fix off-by-one.hrs2014-10-111-2/+2
| |_|/ |/| | | | | | | | MFC after: 1 day
* | | Ignore if the interface is not IPv6-capable.hrs2013-09-021-2/+2
| | | | | | | | | | | | Spotted by: rpaulo
* | | Fix a crash when reloading the configuration file.hrs2013-08-271-4/+2
| | | | | | | | | | | | Spotted by: des
* | | Set the back pointer from the prefix to the interface before addingdes2013-08-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | the prefix to the interface's prefix list. This shouldn't make a difference, since rtadvd(8) is single-threaded, but I've seen it crash in delete_prefix() with pfx_rainfo == NULL, and this is the only place where a prefix can be added to the list with a NULL pfx_rainfo. MFC after: 3 days
* | | Fix build on arm and mips.hrs2013-08-061-5/+2
| | |
* | | - Use time_uptime instead of time_second in data structures forhrs2013-08-058-123/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | PF_INET6 in kernel. This fixes various malfunction when the wall time clock is changed. Bump __FreeBSD_version to 1000041. - Use clock_gettime(CLOCK_MONOTONIC_FAST) in userland utilities. MFC after: 1 month
* | | - Add missing "static" keywords.hrs2013-07-091-2/+7
| | | | | | | | | | | | | | | | | | | | | - Add a check for ifindex to if_indextoifinfo(). It returns NULL when if_indextoname() fails. MFC after: 3 days
* | | Add a missing white space.hrs2013-07-091-1/+1
| | |
* | | Fix a typo in an error message.eadler2013-05-061-1/+1
| |/ |/| | | | | Obtained From: DragonFlyBSD (commit 66e72101cc32272ae370b895ca3d9e3e99c5c3a8)
* | Fix SIGSEGV when set_short_delay() is called when ifi->ifi_ra_timer is NULL.hrs2013-03-061-0/+2
| | | | | | | | | | This can happen in a short period when a prefix is changed by a rtmsg and a new interface arrives.
* | - Implement and use usage().des2013-02-252-10/+26
|/ | | | | | | | - Document the -C option. - Allow rtadvd to be invoked without any interfaces on the command line, and document that possibility. MFC after: 1 week
* Fixes to man8 groff mandoc style, usage mistakes, or typos.wblock2012-05-241-1/+1
| | | | | | | PR: 168016 Submitted by: Nobuyuki Koganemaru Approved by: gjb MFC after: 3 days
* Remove trailing whitespace per mdoc lint warningeadler2012-03-291-1/+1
| | | | | | | Disussed with: gavin No objection from: doc Approved by: joel MFC after: 3 days
* mdoc: correct .Bd/.Bl arguments.joel2012-03-261-4/+4
| | | | Reviewed by: brueffer
* Spelling fixes for usr.sbin/uqs2011-12-302-3/+3
|
* Remove RA timer on an interface with !IFF_UP actively after starting to sendhrs2011-09-201-0/+15
| | | | | | | | | clean-up RA messages for shutting down. The RA timers could prevent the rtadvd daemon from shutting down because ra_output() just ignored !IFF_UP interfaces and TRANSITIVE->UNCONFIGURED state transition never happened due to it. Spotted by: kib Approved by: re (bz)
* - Fix a bug that can lead to displaying an incorrect value. (r224210)hrs2011-09-127-178/+231
| | | | | | | | | | | | | | - Fix an abnormal termination caused by twice of "rtadvctl disable". (r224303) - Use poll() to wait for the control message socket instead of a spin loop. (r224304) - s/cmsg_/cm_/ to avoid conflict with CMSG_* symbols for struct cmsghdr. (r224619) - Ignore an interface that never sent RAs for graceful shut-down. (r224620) - Refine log messages. (r225148) - Fix SIGSEGV when receiving RAs that contain RDNSS and/or DNSSL options. (r225149) Approved by: re (kib)
* - Improve interface list handling. The rtadvd(8) now supports dynamically-hrs2011-07-1721-1430/+3100
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | added/removed interfaces in a more consistent manner and reloading the configuration file. - Implement burst unsolicited RA sending into the internal RA timer framework when AdvSendAdvertisements and/or configuration entries are changed as described in RFC 4861 6.2.4. This fixes issues that make termination of the rtadvd(8) daemon take very long time. An interface now has three internal states, UNCONFIGURED, TRANSITIVE, or CONFIGURED, and the burst unsolicited sending happens in TRANSITIVE. See rtadvd.h for the details. - rtadvd(8) now accepts non-existent interfaces as well in the command line. - Add control socket support and rtadvctl(8) utility to show the RA information in rtadvd(8). Dumping by SIGUSR1 has been removed in favor of it.
| * - Refactoring the interface list. It now supports dynamicallyhrs2011-07-1421-1182/+2558
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | added/removed interfaces in a more consistent manner and reloading the configuration file. - Add initial support for control socket. RA information in the daemon can be obtained by rtadvctl(8) instead of SIGUSR1 in a similar manner to ifconfig(8). The information dump has been removed in favor of it. (reload the configuration file) # rtadvctl reload (show RA messages being sent on each interfaces) # rtadvctl show em0: flags=<UP,CONFIGURED,PERSIST> status=<RA_SEND> mtu 1280 DefaultLifetime: 30m MinAdvInterval/MaxAdvInterval: 3m20s/3m20s AdvLinkMTU: <none>, Flags: O, Preference: medium ReachableTime: 0s, RetransTimer: 0s, CurHopLimit: 64 AdvIfPrefixes: yes (show RA messages being sent only on em0) # rtadvctl show em0 (rtadvctl -v show provides additional information) # rtadvctl -v show em0 em0: flags=<UP,CONFIGURED,PERSIST> status=<RA_SEND> mtu 1280 DefaultLifetime: 30m MinAdvInterval/MaxAdvInterval: 3m20s/3m20s AdvLinkMTU: <none>, Flags: O, Preference: medium ReachableTime: 0s, RetransTimer: 0s, CurHopLimit: 64 AdvIfPrefixes: yes Prefixes (1): 2001:db8:1::/64 (CONFIG, vltime=30d, pltime=7d, flags=LA) RDNSS entries: 2001:db8:1::128 (ltime=2m40s) (stop rtadvd) # rtadvctl shutdown A remaining issue when reloading the configuration file is that during that period rtadvd cannot communicate with rtadvctl due to some additional RA sending for graceful shutdown. This will be fixed later.
| * - Check RTM_VERSION.hrs2011-06-163-1/+14
| | | | | | | | - Fix WARNS.
| * Merge from HEAD@222975.hrs2011-06-115-51/+142
| |\
| | \
| | \
| *-. \ Merge from HEAD@222848.hrs2011-06-084-18/+11
| |\ \ \
| * | | | Specify requirements for RA sending/receiving based on lifetime,hrs2011-06-052-44/+108
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | IFF_ND6_ACCEPT_RTADV, and net.inet6.ip6.forwarding. ra_output: (lifetime == 0) = output (lifetime != 0 && (ACCEPT_RTADV || !ip6.forwarding) = no output ra_input: ACCEPT_RTADV = input !ACCEPT_RTADV = no input Note that the current implementation sends RAs with zero-lifetime even if ip6.forwarding == 0. This behavior is derived from KAME and different from RFC 4861.
| * | | | Support dynamically-added/removed interfaces. The rtadvd(8) daemon detects anhrs2011-06-055-34/+195
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | interface addition/removal via RTM_IFANNOUNCE message and update the internal structure. TO BE FIXED: The advertising interface list still depends on the command line argument. The configuration file cannot be reloaded.
| * | | | Simplify -D for LOG_DEBUG and -d for LOG_INFO.hrs2011-06-051-46/+36
| | | | |
| * | | | Document -M flag and fix a bug in handling of it.hrs2011-06-052-4/+6
| | | | |
OpenPOWER on IntegriCloud