aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/rtadvd
Commit message (Collapse)AuthorAgeFilesLines
* rtadvd: add multi pref64 supportPouria Mousavizadeh Tehrani2026-03-066-63/+158
| | | | | | | Add support for multi pref64 in rtadvd and rtadvctl Reviewed By: zlei, bz Differential Revision: https://reviews.freebsd.org/D54636
* rtadvd(8): support PREF64 (RFC 8781)Lexi Winter2024-05-233-0/+97
| | | | | | | | | | PREF64 allows a router to advertise the network's NAT64 prefix, allowing clients to auto-configure CLAT. This makes it possible to deploy IPv6-only or IPv6-mostly client access networks without the need for DNS64. Reviewed by: imp, glebius (prior suggetions done) Pull Request: https://github.com/freebsd/freebsd-src/pull/1206
* rtadvd: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])Elyes Haouas2024-04-294-7/+7
| | | | | Pull Request: https://github.com/freebsd/freebsd-src/pull/888 Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
* rtadvd: Remove return statement at the end of void functionsElyes Haouas2023-11-065-20/+0
| | | | Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
* Remove $FreeBSD$: two-line nroff patternWarner Losh2023-08-162-4/+0
| | | | Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-163-3/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: one-line .c comment patternWarner Losh2023-08-1615-15/+0
| | | | Remove /^/[*/]\s*\$FreeBSD\$.*\n/
* Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-166-12/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-127-7/+7
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* Update/fix Makefile.depend for userlandSimon J. Gerraty2023-04-191-1/+0
|
* Remove obsolete compatibility code from rtadvd.Mark Johnston2019-07-171-9/+1
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=350086
* Retry upon NET_RT_IFLIST sysctl failure.Mark Johnston2019-04-301-17/+36
| | | | | | | | | | | | | Port the logic used by getifaddrs(3) to handle the case where NET_RT_IFLIST returns ENOMEM, which can occur if the list size changes between the buffer allocation and sysctl read. PR: 195191 Submitted by: Guy Yur <guyyur@gmail.com> (original version) MFC after: 1 week Notes: svn path=/head/; revision=346960
* Update the "flag" for draft-ietf-6man-ipv6only-flag.Bjoern A. Zeeb2018-11-032-3/+3
| | | | | | | | | Having the flag named "6" can possibly be a problem for configurations where parsing strings and numbers can produce ambivalent results. Rename the "6" flag to the "S"ix (or Silence-IPv4) flag. Notes: svn path=/head/; revision=340098
* Initial implementation of draft-ietf-6man-ipv6only-flag.Bjoern A. Zeeb2018-10-304-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change defines the RA "6" (IPv6-Only) flag which routers may advertise, kernel logic to check if all routers on a link have the flag set and accordingly update a per-interface flag. If all routers agree that it is an IPv6-only link, ether_output_frame(), based on the interface flag, will filter out all ETHERTYPE_IP/ARP frames, drop them, and return EAFNOSUPPORT to upper layers. The change also updates ndp to show the "6" flag, ifconfig to display the IPV6_ONLY nd6 flag if set, and rtadvd to allow announcing the flag. Further changes to tcpdump (contrib code) are availble and will be upstreamed. Tested the code (slightly earlier version) with 2 FreeBSD IPv6 routers, a FreeBSD laptop on ethernet as well as wifi, and with Win10 and OSX clients (which did not fall over with the "6" flag set but not understood). We may also want to (a) implement and RX filter, and (b) over time enahnce user space to, say, stop dhclient from running when the interface flag is set. Also we might want to start IPv6 before IPv4 in the future. All the code is hidden under the EXPERIMENTAL option and not compiled by default as the draft is a work-in-progress and we cannot rely on the fact that IANA will assign the bits as requested by the draft and hence they may change. Dear 6man, you have running code. Discussed with: Bob Hinden, Brian E Carpenter Notes: svn path=/head/; revision=339929
* Reduce <sys/queue.h> pollution.Dag-Erling Smørgrav2018-05-111-0/+1
| | | | | | | | | | | | While <sys/sysctl.h> includes <sys/queue.h> unconditionally, it is only actually used in code which is conditional on _KERNEL. Make the #include itself conditional as well, and fix userland code that uses <sys/queue.h> for other purposes but relied on <sys/sysctl.h> to bring it in. MFC after: 1 week Notes: svn path=/head/; revision=333475
* various: general adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-277-2/+16
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. No functional change intended. Notes: svn path=/head/; revision=326276
* General further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-2013-13/+39
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326025
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-311-1/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* Renumber copyright clause 4Warner Losh2017-02-281-1/+1
| | | | | | | | | | | | Renumber cluase 4 to 3, per what everybody else did when BSD granted them permission to remove clause 3. My insistance on keeping the same numbering for legal reasons is too pedantic, so give up on that point. Submitted by: Jan Schaumann <jschauma@stevens.edu> Pull Request: https://github.com/freebsd/freebsd/pull/96 Notes: svn path=/head/; revision=314436
* rtadvd(8): double assignment.Pedro F. Giffuni2017-02-231-1/+0
| | | | | | | | | | Remove doubtful initialization since the value will be overwritten immediately afterwards. Found with: coccinelle (da.cocci) Notes: svn path=/head/; revision=314141
* Add link-layer address option in RA even for IFT_L2VLAN and IFT_BRIDGE.Hiroki Sato2016-11-051-0/+4
| | | | | | | | Reported by: philip MFC after: 3 days Notes: svn path=/head/; revision=308348
* In rtadvd, interface lookup calls if_indextoname() many times in a loop,Fabien Thomas2016-11-021-10/+9
| | | | | | | | | | | | | | (it takes a long time on systems with many interfaces) without reason and without checking its return value. Reviewed by: cem Obtained from: Maryse Levavasseur <maryse.levavasseur@stormshield.eu> MFC after: 1 month Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D6979 Notes: svn path=/head/; revision=308216
* Use strlcpy() instead of strncpy() when copying ifname to ensureDon Lewis2016-05-152-3/+3
| | | | | | | | | | that it is NUL terminated. Additional NUL padding is not required for short names. MFC after: 1 week Notes: svn path=/head/; revision=299867
* rtadvd(8): Fix use-after-close in cm_handler_clientConrad Meyer2016-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 Notes: svn path=/head/; revision=299515
* rtadvd(8): Don't use-after-freeConrad Meyer2016-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 Notes: svn path=/head/; revision=299513
* rtadvd(8): Fix a typo in full msg receive logicConrad Meyer2016-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 Notes: svn path=/head/; revision=299507
* usr.sbin: minor spelling fixes on comments.Pedro F. Giffuni2016-05-011-1/+1
| | | | | | | No functional change. Notes: svn path=/head/; revision=298886
* Use strlcpy().Xin LI2015-10-301-2/+1
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=290173
* - Fix a bug which prevented dnssl[0-9] and rdnss[0-9] parameters fromHiroki Sato2015-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 [*] Notes: svn path=/head/; revision=289750
* Now that we own the code, use arc4random(3) unconditionallyXin LI2015-10-062-19/+0
| | | | | | | | | and remove the corresponding HAVE_ARC4RANDOM conditions. MFC after: 2 weeks Notes: svn path=/head/; revision=288963
* Add META_MODE support.Simon J. Gerraty2015-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 Notes: svn path=/head/; revision=284345
| * dirdeps.mk now sets DEP_RELDIRSimon J. Gerraty2015-06-081-2/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=284172
| * Merge sync of headSimon J. Gerraty2015-05-276-9/+10
| |\ | |/ |/| | | Notes: svn path=/projects/bmake/; revision=283595
| * Merge from head@274682Simon J. Gerraty2014-11-192-6/+17
| |\ | | | | | | | | | Notes: svn path=/projects/bmake/; revision=274683
| * | Updated dependenciesSimon J. Gerraty2014-05-161-1/+0
| | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=266219
| * | Updated dependenciesSimon J. Gerraty2014-05-101-0/+2
| | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=265802
| * | Merge from headSimon J. Gerraty2013-09-059-135/+111
| |\ \ | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=255263
| * \ \ sync from headSimon J. Gerraty2013-04-122-10/+28
| |\ \ \ | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=249429
| * | | | Updated dependenciesSimon J. Gerraty2013-03-111-0/+1
| | | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=248169
| * | | | Updated dependenciesSimon J. Gerraty2013-02-161-2/+0
| | | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=246868
| * | | | Sync FreeBSD's bmake branch with Juniper's internal bmake branch.Marcel Moolenaar2012-08-221-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net> Notes: svn path=/projects/bmake/; revision=239572
* | | | | Stop including if_var.h from userland.Gleb Smirnoff2015-04-064-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=281143
* | | | | mdoc: sort SEE ALSO.Joel Dahl2014-12-261-1/+1
| | | | | | | | | | | | | | | | | | | | Notes: svn path=/head/; revision=276258
* | | | | Convert usr.sbin to LIBADDBaptiste Daroussin2014-11-251-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reduce overlinking Notes: svn path=/head/; revision=275054
* | | | | Fix the following -Werror warnings from clang 3.5.0, while buildingDimitry Andric2014-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 Notes: svn path=/head/; revision=274898
* | | | Check buffer length more strictly.Hiroki Sato2014-10-111-4/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | MFC after: 1 day Notes: svn path=/head/; revision=272972
* | | | Fix off-by-one.Hiroki Sato2014-10-111-2/+2
| |_|/ |/| | | | | | | | | | | | | | | | | MFC after: 1 day Notes: svn path=/head/; revision=272971
* | | Ignore if the interface is not IPv6-capable.Hiroki Sato2013-09-021-2/+2
| | | | | | | | | | | | | | | | | | | | | Spotted by: rpaulo Notes: svn path=/head/; revision=255156
* | | Fix a crash when reloading the configuration file.Hiroki Sato2013-08-271-4/+2
| | | | | | | | | | | | | | | | | | | | | Spotted by: des Notes: svn path=/head/; revision=254955
* | | Set the back pointer from the prefix to the interface before addingDag-Erling Smørgrav2013-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 Notes: svn path=/head/; revision=254684