summaryrefslogtreecommitdiffstats
path: root/sbin/route
Commit message (Collapse)AuthorAgeFilesLines
* Fix incorrect netmasks being passed via rtsock.melifaro2014-05-081-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since radix has been ignoring sa_family in passed sockaddrs, no one ever has bothered filling valid sa_family in netmasks. Additionally, radix adjusts sa_len field in every netmask not to compare zero bytes at all. This leads us to rt_mask with sa_family of AF_UNSPEC (-1) and arbitrary sa_len field (0 for default route, for example). However, rtsock have been passing that rt_mask intact for ages, requiring all rtsock consumers to make ther own local hacks. We even have unfixed on in base: do `route -n monitor` in one window and issue `route -n get addr` for some directly-connected address. You will probably see the following: got message of size 304 on Thu May 8 15:06:06 2014 RTM_GET: Report Metrics: len 304, pid: 30493, seq 1, errno 0, flags:<UP,DONE,PINNED> locks: inits: sockaddrs: <DST,GATEWAY,NETMASK,IFP,IFA> 10.0.0.0 link#1 (255) ffff ffff ff em0:8.0.27.c5.29.d4 10.0.0.92 _________________^^^^^^^^^^^^^^^^^^ after the change: got message of size 312 on Thu May 8 15:44:07 2014 RTM_GET: Report Metrics: len 312, pid: 2895, seq 1, errno 0, flags:<UP,DONE,PINNED> locks: inits: sockaddrs: <DST,GATEWAY,NETMASK,IFP,IFA> 10.0.0.0 link#1 255.255.255.0 em0:8.0.27.c5.29.d4 10.0.0.92 _________________^^^^^^^^^^^^^^^^^^ Sponsored by: Yandex LLC MFC after: 1 month
* Use src.opts.mk in preference to bsd.own.mk except where we need stuffimp2014-05-061-1/+1
| | | | from the latter.
* When switching variables to flags in r243185 a few cases were missed.bz2014-04-161-5/+5
| | | | | | | | | | After r263152 this leaves unused variables if route(8) is compiled without INET support. Switch the remaining variable accesses to flags and remove now obsolete variables. Reviewed by: glebius MFC after: 1 week
* Remove AppleTalk support.glebius2014-03-143-70/+2
| | | | | | | | | | AppleTalk was a network transport protocol for Apple Macintosh devices in 80s and then 90s. Starting with Mac OS X in 2000 the AppleTalk was a legacy protocol and primary networking protocol is TCP/IP. The last Mac OS X release to support AppleTalk happened in 2009. The same year routing equipment vendors (namely Cisco) end their support. Thus, AppleTalk won't be supported in FreeBSD 11.0-RELEASE.
* Remove IPX support.glebius2014-03-141-1/+0
| | | | | | | | | | | IPX was a network transport protocol in Novell's NetWare network operating system from late 80s and then 90s. The NetWare itself switched to TCP/IP as default transport in 1998. Later, in this century the Novell Open Enterprise Server became successor of Novell NetWare. The last release that claimed to still support IPX was OES 2 in 2007. Routing equipment vendors (e.g. Cisco) discontinued support for IPX in 2011. Thus, IPX won't be supported in FreeBSD 11.0-RELEASE.
* Bump dates in nestat(1) and route(8) man pages.melifaro2014-01-111-5/+4
| | | | | | | Fix several small errors introduced by r260524. Suggested by: glebius MFC after: 2 weeks
* Add -4/-6 shorthand for -finet/-finet6 in route(8) and netstat(8).melifaro2014-01-103-4/+44
| | | | MFC after: 2 weeks
* Do some more sanity checks in route(8): require netmask to havemelifaro2014-01-091-0/+7
| | | | | | | the same address family as destination. Found by: jmg MFC after: 2 weeks
* route(1): Pull static data to the top of the file.eadler2013-12-041-15/+15
| | | | | | | This is a pre-requisisite to some upcoming changes. Submitted by: Sebastian Huber <sebastian.huber@embedded-brains.de> Discussed on: -hackers
* route(1): Pull static buffer out of the function and into function scope.eadler2013-12-041-17/+17
| | | | | | | This will make it easier to link as a library. Submitted by: Sebastian Huber <sebastian.huber@embedded-brains.de> Discussed on: -hackers
* route(1): Pull static buffer out of the function and into function scope.eadler2013-12-041-13/+13
| | | | | | | This will make it easier to link as a library. Submitted by: Sebastian Huber <sebastian.huber@embedded-brains.de> (older version) Discussed on: -hackers
* route(1): Pull static variable out of the function and into function scope.eadler2013-12-041-3/+3
| | | | | | | This will make it easier to link as a library. Submitted by: Sebastian Huber <sebastian.huber@embedded-brains.de> (older version) Discussed on: -hackers
* route(1): Pull static buffer out of the function and into function scope.eadler2013-12-041-4/+5
| | | | | | | This will make it easier to link as a library. Submitted by: Sebastian Huber <sebastian.huber@embedded-brains.de> (older version) Discussed on: -hackers
* Avoid using a static buffer in atalk_ntoa. This will help allow users to ↵eadler2013-12-041-9/+15
| | | | | | | | call route(1) as a library. Submitted by: Sebastian Huber <sebastian.huber@embedded-brains.de> (older version) Discussed on: -hackers Reviwed by: adri (different older version)
* Add const qualifier where appropriateeadler2013-12-041-2/+2
| | | | Submitted by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* Add const qualifier where appropriateeadler2013-12-041-1/+1
| | | | Submitted by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* Turn 'n' into a local variable. This is required for additional changes.eadler2013-12-041-1/+2
| | | | Submitted by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* Use long explicitly for the time difference.hrs2013-10-181-1/+2
|
* - Add relative specification in expiration time.hrs2013-10-173-11/+43
| | | | | - Add proto3 option for RTF_PROTO3. - Use %lu for members of struct rt_metrics.
* When destination parameter is missing, exit with a clear synopsis,glebius2013-10-081-0/+5
| | | | | | | | instead of writing to kernel and printing EINVAL description. PR: bin/181532 Submitted by: Kurt Jaeger <fbsd-pr opsec.eu> Approved by: re (hrs)
* Fix boundary check of sockaddr array.hrs2013-08-011-3/+2
| | | | Reported by: uqs
* Fix a bug in cp += SA_SIZE() in RTA_* loop. This could preventhrs2013-07-241-8/+7
| | | | | | RTA_IFP from displaying correctly in route get subcommand. Spotted by: dim
* - Use getnameinfo() for both of AF_INET and AF_INET6 in routename().hrs2013-07-211-46/+54
| | | | - Add missing "static".
* - Fix nflag in routename().hrs2013-07-211-10/+33
| | | | | | | - Display a AF_LINK address in #linkN when sdl_{nlen,alen,slen) == 0 and sdl_index != 0. - Reduce unnecessary loop in pmsg_addrs(). - Remove iso_ntoa(). This is not used.
* - Simplify getaddr() and print_getmsg() by using RTAX_* instead of RTA_*hrs2013-07-201-80/+48
| | | | | as the argument. - Reduce unnecessary loop in print_getmsg().
* Show "default" for the zero-filled address consistently when nflag == 0.hrs2013-07-201-13/+10
|
* Add cast to (void *) to the following cases to suppress warnings byhrs2013-07-201-24/+23
| | | | | | | -Wcast-align. These do not increase the alignment requirement: - rtm = (struct rt_msghdr *)(rtm + rtm->rtm_msglen) - struct sockaddr *sa = &sa0; sX = (struct sockaddr_X *)sa
* Fix a gcc warning.hrs2013-07-181-1/+4
| | | | Pointy hat to: hrs
* Use NET_RT_DUMP.0.FIB leaf node instead of setting td_proc->p_fibnum.hrs2013-07-171-12/+2
|
* - Add support of MK_INET_SUPPORT=no.hrs2013-07-172-268/+278
| | | | | | | | | | | | - Fix a bug in sodump() which prevented struct sockaddr_in6 from displaying. - Fix a bug in in fiboptlist_csv() which could cause free() of uninitialized pointer. - Style cleanups: . Add missing "static" keywords. . Use an array of struct sockaddr_storage instead of sockunion for rtmsg. . Use err() and errx() instead of pair of fprintf(stderr, "...") + exit(1). . Use nitems() macro. . Various style(9) fixes.
* Simplify keywords.h generation.hrs2013-07-171-9/+5
|
* Fix a bug that the gateway address was not shown when a -gateway modifierhrs2013-06-091-0/+1
| | | | was used.
* Retire struct sockaddr_inarp.glebius2013-01-311-4/+1
| | | | | | | | | | | | | | | Since ARP and routing are separated, "proxy only" entries don't have any meaning, thus we don't need additional field in sockaddr to pass SIN_PROXY flag. New kernel is binary compatible with old tools, since sizes of sockaddr_inarp and sockaddr_in match, and sa_family are filled with same value. The structure declaration is left for compatibility with third party software, but in tree code no longer use it. Reviewed by: ru, andre, net@
* Fix -iface and -interface modifiers.hrs2013-01-081-14/+14
| | | | Spotted by: Ian FREISLICH
* - Fix strtol() error handling.hrs2012-12-161-16/+35
| | | | | | | | - Add a range condition of given FIB number and the related error messages. - Fix free() problem. Spotted by: Artyom Mirgorodskiy Discussed with: glebius
* - Move definition of V_deembed_scopeid to scope6_var.h.hrs2012-12-051-10/+0
| | | | | | - Deembed scope id in L3 address in in6_lltable_dump(). - Simplify scope id recovery in rtsock routines. - Remove embedded scope id handling in ndp(8) and route(8) completely.
* Fix fallout from r243019, which broke parsing of shortened networkglebius2012-12-041-0/+7
| | | | | | prefixes. Reported and tested by: delphij
* - Fix LOR in sa6_recoverscope() in rt_msg2()[1].hrs2012-12-041-0/+10
| | | | | | | - Check V_deembed_scopeid before checking if sa_family == AF_INET6. - Fix scope id handing in route(8)[2] and ifconfig(8). Reported by: rpaulo[1], Mateusz Guzik[1], peter[2]
* Flush stdout after RTM_IFANNOUNCE message.glebius2012-12-041-0/+1
| | | | | PR: bin/151600 Submitted by: Eric van Gyzen <eric vangyzen.net>
* No need to be root when running with -t or -d.glebius2012-12-041-2/+2
|
* Fill sin6_scope_id in sockaddr_in6 before passing it from the kernel tohrs2012-11-171-34/+0
| | | | | | | | | | | | userland via routing socket or sysctl. This eliminates the following KAME-specific sin6_scope_id handling routine from each userland utility: sin6.sin6_scope_id = ntohs(*(u_int16_t *)&sin6.sin6_addr.s6_addr[2]); This behavior can be controlled by net.inet6.ip6.deembed_scopeid. This is set to 1 by default (sin6_scope_id will be filled in the kernel). Reviewed by: bz
* Add -fib modifier to specify FIB number. The FIB number can be in ahrs2012-11-173-114/+440
| | | | | | | | | | | comma-separated list and/or range specification: # route add -inet 192.0.2.0/24 198.51.100.1 -fib 1,3-5,6 Although all of the subcommands supports the modifier, "monitor" does not support the list or range specification at this moment. Reviewed by: bz
* Remove remnants of classful addressing. These magic transformationsglebius2012-11-141-41/+8
| | | | of supplied arguments is not what a modern sysadmin expect.
* Remove superfluous paragraph macro.joel2012-03-251-1/+0
|
* Document the show alias and add an EXAMPLES section.joel2012-03-241-1/+36
|
* Fix a possible infinite loop in "route flush" on 64-bit archs.hrs2012-02-041-2/+2
| | | | MFC after: 3 days
* Handle the internal scope address representation of the KAME IPv6ume2012-01-071-3/+6
| | | | | | | stack for the node-local multicast address. Spotted by: Rainer Bredehorn <Bredehorn__at__gmx.de> MFC after: 1 week
* - Fix array bounds checking. [1]glebius2010-12-081-15/+44
| | | | | | | | - Add message length checking. PR: 151664 [1] Submitted by: Alexey Illarionov <littlesavage rambler.ru> [1] Reviewed by: yar
* Add RTM_IEEE80211 to array of route message descriptions.glebius2010-12-081-0/+1
| | | | | PR: 151664 Submitted by: Alexey Illarionov <littlesavage rambler.ru>
* route(8): make WARNS=3 cleanuqs2010-02-272-149/+155
| | | | | | | | | | | | - add static and const where appropriate - check pointers against NULL - minor styling nits - it is actually WARNS=6 clean for non-strict alignment platforms This is shamelessly stolen from DragonflyBSD and reduces our diff. PR: bin/140078 Approved by: ed (co-mentor)
OpenPOWER on IntegriCloud