summaryrefslogtreecommitdiff
path: root/sbin/route/route.c
AgeCommit message (Collapse)Author
2021-11-10Give sppp(4) its own RTP_PROPOSAL priorityBjorn Ketelaars
OK semarie@
2021-10-23Move "-T" and "exec" support out of SMALLKlemens Nanni
Ramdisk kernels lack support for alternate routing tables, so "-T N" for N > 0 always fails. "route -T0 exec" is just a useless "exec", so zap it completely. OK benno
2021-08-30Fix max nameserver proposals limitKlemens Nanni
Count the total number of proposals and not five per address family each. Don't print ignored addresses by default anymore and leave that to `-v'. OK benno
2021-08-05superflous -> superfluousTheo Buehler
2021-08-04Add a new 'nameserver' command to route(8).Sebastian Benoit
It sends nameserver proposals to resolvd(8) using the dns proposal protocol over the route socket. Based on a seperate program written by florian@. deraadt noticed some whitespace issues. more fixes and ok florian@
2021-06-26delete extra explanations in the usage: messages which are describedTheo de Raadt
far better in the manual pages ok jmc
2021-03-12INET6_NOPRIVACY is called AUTOCONF6TEMP now, missed during rename.Florian Obser
2021-02-24show AF for DNS proposal messages; ok claudio bluhmTheo de Raadt
2021-01-24Add missing __KAME__ markers.Florian Obser
OK claudio
2020-12-29getifaddrs() can return entries where ifa_addr is NULL. Check for thisSebastian Benoit
before accessing anything in ifa_addr. ok claudio@
2020-11-25Teach route(8) about the names of the IEEE80211_F_* flags.Kenneth R Westerback
2020-10-29Add feature to force the selection of source IP addressdenis
Based/previous work on an idea from deraadt@ Input from claudio@, djm@, deraadt@, sthen@ OK deraadt@
2020-07-07Stop using make_addr() which trims trailing zeros of the netmask, setYASUOKA Masahiko
family and length field. This fixes route(8) to handle "::/0" properly. Also fix "route add -inet 0.0.0.0 -prefixlen 0 (gateway)" to work properly. ok kn
2020-01-15Replace duplicate error message with gai_strerror(3)kn
getaddrinfo(3) may fail for multiple reasons, but error message should be unique in general. OK bluhm
2019-11-22The DNS proposal list can (soon) be empty to signal a withdraw, relaxFlorian Obser
the size constraint to allow this to pass through the kernel. Looks good to deraadt@
2019-11-22Teach route(8) about RTP_PROPOSAL_UMBClaudio Jeker
2019-11-21output RTM_PROPOSALs more similar to other route messagesFlorian Obser
no objection krw@ who has further suggestions for improvement
2019-11-16Missing comma after RTM_PROPOSAL source.Kenneth R Westerback
ok bluhm@
2019-11-16When printing RTM_PROPOSAL and unspecified message types, print theKenneth R Westerback
interface name if known. As all the other message types do. ok bluhm@
2019-11-16When printing RTM_PROPOSAL messages use "if#" like all the otherKenneth R Westerback
messages, not "ifidx". ok bluhm@
2019-11-16More %d -> %u for unsigned values.Kenneth R Westerback
2019-11-16Whitespace nit.Kenneth R Westerback
ok bluhm@
2019-11-16rtm_version, rtm_type, rtm_msglen, rtm_index, rtm_priority, ifan_whatKenneth R Westerback
are u_char or u_short. So use %u instead of %d in printf(). ok bluhm@
2019-11-16Remove "(void)" casts from the 2 printf() statements thatKenneth R Westerback
had them. ok bluhm@
2019-11-09Add RTP_PROPOSAL_SOLICIT to allow unwind(8) to solicit DNS proposalsFlorian Obser
from slaacd and dhclient when it starts. Discussed with deraadt who notes that it's a bit odd to have this as a route priority. One idea is to have this as a dedicated route message and not a priority. But we want to move this forward and learn how it can be used so we are going with this for now. OK deraadt
2019-10-27Print interface index and name for RTM_NEWADDR, RTM_DELADDR andKenneth R Westerback
RTM_CHGADDRATTR messages. Be consistant and eliminate ':' after all 'name's. ok bluhm@
2019-10-25Forgot to add '\30AUTOONF4" to ifnetflags[].Kenneth R Westerback
route will now show "AUTOCONF4" in flags.
2019-08-31The algorithm creating the routing addresses in route(8) and arp(6)Alexander Bluhm
were still not correct. While the values written to the kernel are fine, the bytes for padding were taken from memory after the sockaddr structs. In route(8) the union of sockaddrs can be made larger, so that the padding is taken from there. In arp(8) the size of the struct is known. Copy only the struct and advance over the padding. The memory has been zeroed before. Merge all address size fixes from arp(8) into ndp(8). OK claudio@
2019-08-29The kernel uses rtm_addrs as a bit field for addresses that areAlexander Bluhm
included in the routing message. The significance of the bits has to be consistent with the order of the addresss. In route(8) store addresses in ascending order of RTA values. This allows to use MPLS routes together with route labels. OK mpi@ claudio@
2019-08-29route(8) used inet/inet6 autodetection also for the link addressAlexander Bluhm
type. Provide the address family AF_LINK and storage size of struct sockaddr_dl to the kernel when creating an IFP routing address. OK mpi@
2019-03-31Restore -t behaviourkn
revision 1.178 from 23.10.2015 accidentially removed the tflag bits, turning `-t' into a NOOP. Found out the hard way during debug. OK deraadt
2019-01-23Make route(8) show the same flags in RTM_IFINFO messages asKenneth R Westerback
ifconfig(8) shows in its display of interface information. ok bluhm@
2019-01-22PF_ROUTE -> AF_ROUTE in the scattered sock()/setsockopt() callsKenneth R Westerback
where the "wrong" #define was used. ok dlg@
2018-11-12Recognize and display new RTM_80211INFO messages.Kenneth R Westerback
Original diff from phessler@. Many suggestions and tweaks from claudio@, stsp@, anton@. ok claudio@ stsp@ anton@ phessler@
2018-10-15Trust the resolver to give us a sockaddr_in6 sized objectFlorian Obser
if we ask for AF_INET6. OK kn, deraadt
2018-08-30Fix "route add 0.0.0.0/0 <gateway>" to work properly. Shift countYASUOKA Masahiko
beyonds the integer width results undefined behavior in C spec. Actually the count is masked by 0x1f on amd64. Found by asou at soum.co.jp ok claudio kn schwarze
2018-08-09Drop support for guessing an old-style class A, B, or C netmask fromIngo Schwarze
a bare dot-notation IP address by counting trailing zero octets. Instead, assume -host when neither -net nor -netmask nor -prefixlen is given. Error out when -net is requested but no netmask is specified. This removes the last use of the IN_CLASS* macros from this program. OK claudio@ kn@, and many agreed with the general direction during g2k18.
2018-07-17stop assuming prefix lengths, remove inet6_makenetandmask()kn
This removes any logic that implies IPv6 destination host addresses to be /64 subnets so they are taken as is. RFC 3587 deprecated this in 2003 and our manual page actually states: The route is assumed to be to a network if any of the following apply to destination: * [...] * it is an IPv6 address with a “/XX” suffix (where XX is the number of bits in the network portion of the address and is less than 128) * [...] If destination is a valid IP address or host name, it is presumed to be a route to a host. Stripping relevant code from `inet6_makenetandmask()' left the function as dummy wrapper around `prefixlen()', so zap it completely. Discussed with and positive feedback from many, OK benno henning
2018-07-14Make route monitor display changes in all routing domains by forcingSebastian Benoit
the route filter to set RTABLE_ANY. Previously only the routing table/rdomain of the route process was displayed (that being the kernel default). ok kn@ claudio@ and henning@
2018-07-13no longer interpret 0.192.168.4 in hosts(5) as 192.168.4/24Ingo Schwarze
OK phessler@ claudio@ benno@ kn@ "steh' nicht rum, committe das" henning@
2018-07-13Use "rtable" not "tableid" as argument name for rtablekn
Make rtable(4) usage documentation consistent with other programs. This is to have `man -k ar~rtable' show the full list without having to look for other variations of the same argument type. OK bluhm
2018-07-12RTM_CHGADDRATTR for route monitorFlorian Obser
OK phessler, benno, claudio
2018-07-11Use AF_UNSPEC not 0kn
2018-07-10Error out if -netmask/-prefixlen does not follow the destination parameterkn
Since the address string comes last, `-prefixlen 56 2001:db8::' silently installs a route for /64 since that's the currently implied prefix length. The manual page already states that these options must follow the destination parameter in order to have any effect. Discussed at length with many OK benno sthen bluhm jca
2018-07-01Retire support for unused RTM_LOCK messages, it's redundant w/ RTM_CHANGE.Martin Pieuchot
ok tb@, sthen@
2018-06-18Replace hardcoded constants with defineskn
OK mpi henning blum
2018-05-01The -d flag should be a no-op in monitor mode since it does not modifyFlorian Obser
the routing table. However, if -d is provided route monitor lists all interfaces and their associated addresses and exits. This is confusing, unexpected and no longer needed (if ever). Make -d a proper no-op for route monitor and get rid of the interfaces function which didn't use the correct sysctl idiom anyway. OK benno
2018-05-01Sync p_rttables() to netstat(1) version. Pointed out by claudio andFlorian Obser
mpi. Remaining differences are pledge and priority handling which only route(8) has. While here switch flushroutes to get_sysctl() function. OK benno
2018-04-30* simplify code by no longer calling getnetbyname(3)Ingo Schwarze
* avoid double lookups for unresolvable names without -net * more fitting error message for unresolvable names after -net OK florian@
2018-04-30tableid is either initialized to the current routing table or to theFlorian Obser
one specified by the T flag. No need to pass a flag around if the tableid is valid. It always is. This code is now in sync between flushroutes() and p_rttables(). OK benno, no objection claudio