summaryrefslogtreecommitdiffstats
path: root/sbin/route
Commit message (Collapse)AuthorAgeFilesLines
* 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)
* remove stale references to RTF_CLONING and RTF_LLINFOkmacy2009-09-041-21/+0
| | | | MFC after: 3 days
* ANSIfy functions declarations, adjust prototypes. Rename local variablecharnier2009-08-251-75/+58
| | | | to not conflict with err().
* Extend route command:kmacy2009-04-142-11/+24
| | | | | | | | | | - add show as alias for get - add weights to allow mpath to do more than equal cost - add sticky / nostick to disable / re-enable per-connection load balancing This adds a field to rt_metrics_lite so network bits of world will need to be re-built. Reviewed by: jeli & qingli
* Fix broken case where caused by last patch whererrs2009-04-111-1/+2
| | | | | a user uses 0.0.0.0/0 as an alias for default. Obtained from: Mykola Dzham (freebsd@levsha.org.ua)
* Ok, looking at the solution a bit closer, the levelrrs2009-04-061-4/+4
| | | | | | | | | | | calculation was too agressive. Instead we should only look at each nibble. This makes it so we make 10.2.0.0 become 10.2/16 NOT 10.2/17. Need to explore the non-cidr address issue. The two may not be seperable.. MFC after: 1 week
* Class based addressing went out in the early 90's. Basicallyrrs2009-04-061-16/+17
| | | | | | | | | | | | | | | | | | | | | | | | if a entry is not route add -net xxx/bits then we should use the addr (xxx) to establish the number of bits by looking at the first non-zero bit. So if we enter route add -net 10.1.1.0 10.1.3.5 this is the same as doing route add -net 10.1.1.0/24 Since the 8th bit (zero counting) is set to 1 we set bits to 32-8. Users can of course still use the /x to change this behavior or in cases where the network is in the trailing part of the address, a "netmask" argument can be supplied to override what is established from the interpretation of the address itself. e.g: route add -net 10.1.1.8 -netmask 0xff00ffff should overide and place the proper CIDR mask in place. PR: 131365 MFC after: 1 week
* Fix regression introduced in rev. 173124:mav2009-01-181-26/+27
| | | | | | 0.0.0.0/1 is not the same as 0.0.0.0/0. MFC after: 1 month
* This main goals of this project are:qingli2008-12-151-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. separating L2 tables (ARP, NDP) from the L3 routing tables 2. removing as much locking dependencies among these layers as possible to allow for some parallelism in the search operations 3. simplify the logic in the routing code, The most notable end result is the obsolescent of the route cloning (RTF_CLONING) concept, which translated into code reduction in both IPv4 ARP and IPv6 NDP related modules, and size reduction in struct rtentry{}. The change in design obsoletes the semantics of RTF_CLONING, RTF_WASCLONE and RTF_LLINFO routing flags. The userland applications such as "arp" and "ndp" have been modified to reflect those changes. The output from "netstat -r" shows only the routing entries. Quite a few developers have contributed to this project in the past: Glebius Smirnoff, Luigi Rizzo, Alessandro Cerri, and Andre Oppermann. And most recently: - Kip Macy revised the locking code completely, thus completing the last piece of the puzzle, Kip has also been conducting active functional testing - Sam Leffler has helped me improving/refactoring the code, and provided valuable reviews - Julian Elischer setup the perforce tree for me and has helped me maintaining that branch before the svn conversion
* Fix printing of sockaddr prefixes in verbose mode.ru2008-04-101-1/+1
| | | | | | PR: bin/122403 Submitted by: az MFC after: 3 days
* In route.c in newroute() there's a call to exit(0) if the command wasremko2008-03-221-1/+1
| | | | | | | | | | 'get'. Since rtmsg() always gets called and returns 0 on success and -1 on failure, it's possible to exit with a suitable exit code by calling exit(ret != 0) instead, as is done at the end of newroute(). PR: bin/112303 Submitted by: bruce@cran.org.uk MFC after: 1 week
* Don't mask the address in inet_makenetandmask() according to what classmtm2007-11-041-1/+0
| | | | | | it appears to be in: there is also CIDR. Noticed by: tegge
* Document -t.obrien2007-11-011-0/+4
|
* Fix an error in bit shifting logic for network addresses. The routemtm2007-10-291-20/+24
| | | | | | | | | | | | | | | command would add incorrect routing entries if network numbers weren't fully "spelled" out according to their class. For example: # route add 128.0/16 (works) # route add 128/16 (doesn't work) # route add 193.0.0/24 (works) # route add 193/24 (doesn't work) Also, rework the way a netmask is deduced from network number if it [netmask] is not specified. Submitted by: Nuno Antunes <nuno.antunes@gmail.com> (mostly) MFC after: 1 week
* Obey MK_INET6_SUPPORT.yar2006-07-271-2/+10
| | | | This is also a good chance to apply style.Makefile(5) in some cases.
* Document that -q option is also applicable to the "change" command.ru2005-10-021-2/+2
| | | | | PR: docs/85095 Submitted by: Rostislav Krasny
* Introduce "route del" as an alias to "route delete".tobez2005-09-283-1/+7
| | | | Reviewed by: arch
* - Understand EADDRINUSE, and forget EDQUOT. [1]glebius2005-09-211-2/+6
| | | | | | | | | - Add description for EEXIST. - Change description for ENOBUFS. Routing socket can return this error for many different reasons, including general memory shortage, mbuf memory shortage and rtentry zone. PR: kern/64090 [1]
* - do DNS lookup for symbolic names specified for a destinationume2005-05-231-4/+5
| | | | | | | | | | or gateway. - improves error reporting using gai_strerror(3) instead of printing "bad value". - remove "0" for servname argument for getaddrinfo(3). Submitted by: Andreas Kohn <andreas __at__ syndrom23.de> MFC after: 1 week
* NI_WITHSCOPEID cleanup. Neither RFC 2553 nor RFC 3493 definesume2005-05-131-6/+0
| | | | | NI_WITHSCOPEID, and our getaddrinfo(3) does nothing special for it, now.
* shutdown(2)'s how argument as 0 is nowhere near as cool as SHUT_RDjmallett2005-05-111-2/+2
|
OpenPOWER on IntegriCloud