summaryrefslogtreecommitdiff
path: root/usr.sbin
AgeCommit message (Collapse)Author
2021-06-17vmd(8): handle VIRTIO_BLK_T_GET_ID, check descriptor r/w flagsdv
Linux guests like to issue VIRTIO_BLK_T_GET_ID commands in attempts to read the device serial number. It's not part of the virtio spec, but has been part of QEMU and Bhyve for multiple years. It will be landing in the next version of virtio (1.2), so this stubs out handling for the request type. The added benefit is it helps squelch log noise from Linux guests. For now, no serial number is set and the request status is set to VIRTIO_BLK_S_UNSUPP to tell the driver we don't support it. While here, swap the response to VIRTIO_BLK_T_FLUSH{,_OUT} to be also returning VIRTIO_BLK_S_UNSUPP. It's not negotiated nor implemented. Lastly, add checks for validating the vioblk device is only reading/writing descriptors with approrpriate read/write-only flags per the virtio spec. With input from claudio@, OK mlarkin@
2021-06-17Implement RFC 7313 enhanced route refresh. It is off by default andClaudio Jeker
can be enabled with 'announce enhanced refresh yes' Similar to graceful restart this allows to mark routes as stale, refresh them and the flush out routes that are still stale. Enhanced route refresh uses a begin of rr and a end of rr message to signal the various stages. A future enhancement would be the addition of a timeout in case the EoRR message is not sent in reasonable time. OK denis@ job@
2021-06-17Add simple BGP Enhanced Route Refresh Message decodingjob
seems OK claudio@
2021-06-17Refactor common code for peer filtering out into rde_skip_peer()Claudio Jeker
and use it in the two places that need to keep in sync. OK sthen@
2021-06-17Add a bit of extra paranoia befor the up_generate_updates() call inClaudio Jeker
rde_up_dump_upcall(). This is the 4th place up_generate_updates() is called.
2021-06-17In Rev 1.511 I moved peer related checks from inside up_generate_updates()Claudio Jeker
to rde_generate_updates() but forgot to add the same checks to rde_softreconfig_out(). As a result a config reload could result in prefixes for a not-negotiated address family to leak into the Adj-RIB-Out. Adjust both rde_generate_updates() and rde_softreconfig_out() to use the same filter logic. Also adjust rde_up_flush_upcall() to pass the peer as argument instead of using prefix_peer(). The up_generate_updates() call there does not need any filtering since the walker runs on the Adj-RIB-Out and just withdraws everything. OK job@ on a previous diff
2021-06-17Better error message when a bad nexthop is passed to nexthop_hash().Claudio Jeker
OK job@
2021-06-17Before adding a prefix to the Adj-RIB-Out modify the attributes to theClaudio Jeker
ones being sent out. Mainly prepend the ASPATH if needed and also change the nexthop to the one being sent. This should make the `bgpctl show rib out` output show the values the peer receives. OK job@
2021-06-16cleanup vmd(8) includes and header filesdv
Lots of organic growth other the years lead to unnecessary includes (proc.h everywhere) and odd dependencies between header files. This cleans things up a bit to help with upcoming cleanup around dhcp code. No functional change. "go for it" mlarkin@
2021-06-16Add command line option to show the versionjob
OK claudio@
2021-06-16Implement classless static routes dhcp option.Florian Obser
For this we need to be able to handle multiple routes being sent from the engine to the main process as well as to the control tool. The configuration of the various cases (default route, directly connected routes, non-default route via a gateway) was inspired by dhclient's set_routes() and should behave the same way. Tested by Uwe Werler
2021-06-15Filter out packets that are not IPv4. This code came from dhcp programsClaudio Jeker
where this filtering was done in bpf but here vmd needs to make sure to not look at non IPv4 packets. OK florian@ and dv@
2021-06-14add required headers for smtpd.h and remove unnecessary ones in other files.Eric Faurot
ok jung@
2021-06-14snmpd.conf(5): fix typo/plurals and tweak wording. ok jmc martijnStuart Henderson
2021-06-14Fix ROA & MFT version check handlingjob
This check was incomplete: to correctly verify the ASN1 INTEGER holding the version component, first the context specific explicit tag would need to be checked. However, the X.690 spec (section 11.5) states that if the one should not encode a component if it is the default value. There are no RFCs specifying new versions of ROA or MFT, so checking the content of the version component should be skipped entirely. Thus if the version component is present, something is wrong.
2021-06-14Change errors for file manipulations from err(3) to warn(3) and adjust theClaudio Jeker
surrounding code to handle these errors gracefully. When rpki-client runs out of space it will keep on running including the cleanup at the end. This way the temporary and old files are removed hopfully giving back some space. This affects mainly RRDP and the initial fetch of TA files. OK job@
2021-06-14Do a fstatvfs() call to figure out if the filesystem used for the cacheClaudio Jeker
is large enough for the cache. People like to build VM images with way too small filesystems and so warning about this situation should help. With deraadt@ and job@
2021-06-11vmd(8): deduplicate vioblk command logicdv
No need for each case in the switch block to have the same logic for updating the used ring and writing the state back to the guest. Move it outside the switch. No functional change. ok mlarkin@
2021-06-10vmctl(8)/vmd(8): communicate TERMINATE_VM_EVENT imsgs on vm stop.dv
Instead of translating imsg types, update vmclt(8) to handle receiving IMSG_VMDOP_TERMINATE_VM_EVENT messages on vm termination. This finishes the work previously committed for supporting multiple waiters or the cancellation of a client waiting on a vm shutdown. vmd no longer needs to translate an IMSG_VMDOP_TERMINATE_VM_RESPONSE into an *_EVENT. ok mlarkin@
2021-06-08vmd(8): malicious dhcp packets on local ifs can cause stack overflowsdv
A sufficiently large dhcp packet can cause a stack overflow in vmd's internal dhcp server used for providing ip addresses to local guest interfaces. (This does not affect non-local interfaces.) The primary changes drop larger packets and change the memory copying logic to use a compile-time constant. The dhcp option processing also additional prevention for out of bound reads. While here, improve construction of the dhcp response's hostname handling to guard against overflowing the response dhcp options. Vulnerability reported by Maxime Villard. ok claudio@
2021-06-07btrace(8): add "cpu" to long conversiondv
Special values need to be translated to longs for use with functions like hist/lhist. Add "cpu" to conversion list. ok mpi@
2021-06-07tweak previous: avoid markup and refer to an HTTP header only by itsTheo Buehler
name as is done elsewhere on this page. pointed out by jmc
2021-06-06appease mandoc -TlintTheo Buehler
2021-06-06Add .Pp for consistency with all other config blocks.Theo Buehler
2021-06-03Use O_DIRECTORY when opening directories. This makes some errors a bitClaudio Jeker
clearer when using -d. OK deraadt@
2021-06-03typoTheo de Raadt
2021-06-02Use the same logic in all copies of gpt_chk_mbr(), relaxing theKenneth R Westerback
media length check to allow EFI GPT partitions to be smaller that the entire disk. Consistently use GPTSECTOR instead of randomly tossing in some literal '1's. ok kettenis@
2021-06-02Add GPT support; stolen from i386_installboot.c.Mark Kettenis
ok krw@, deraadt@
2021-06-02vmd(8): allow locking a randomly assigned lladdrdv
Provide a default value of a zero'd mac address so a user can still specify the interface should be "locked" (only transmitting ethernet packets with a matching source address). vmd will assign a random address at vm launch. As an example, this is now valid: vm "name" { interface { locked lladdr } ... } From Martin Vahlensieck ok claudio@
2021-06-01amd64 U-Boot arch code should be ARCH_X86_64 not ARCH_IA64Jonathan Gray
2021-06-01list aarch64 as a valid archJonathan Gray
from Leon Fischer
2021-05-30decode multimedia classJonathan Gray
2021-05-27Stop processing UPDATES if the peer is not up.Claudio Jeker
When the RDE issues an UPDATE NOTIFICATION because of some fatal error like max-prefix count reached the peer is put into state PEER_ERR by rde_update_err() and all UDPDATEs that are still queued should be dropped. Noticed and OK deraadt@, OK job@
2021-05-27Rename and move functions used to get per-peer settings to theClaudio Jeker
hopefully better names peer_has_as4byte() and peer_accept_no_as_set(). Move them to rde_peer.c where all other peer functions live. OK sthen@
2021-05-27remove excessive tabs and fix a tyop in comment.Claudio Jeker
2021-05-27Fix more warningsjob
OK tb@
2021-05-27Use negotiated capabilities to decide if a ROUTE-REFRESH message can beClaudio Jeker
sent (and also for which AFI/SAFI). Use a slightly better way to write return if neither route-refresh nor enhanced route-refresh are on.
2021-05-27Use correct RFC number in commentClaudio Jeker
2021-05-27Fix warningjob
OK tb@
2021-05-27When generating updates for a peer that has 'rde evaluate all' set theClaudio Jeker
old prefix pointer is most probably NULL. If a secondary route is removed the withdraw would not happen because old == NULL which skips the withdraw. Access to old is only needed to extract the prefix. So instead extract the prefix early and use it for both cases. So if 'rde evaluate all' is used the code tries all prefixes and if none is allowed a withdraw is issued. Problem noticed and fix tested by Pier Carlo Chiodi
2021-05-27Fix how the rde_eval_all flag is tracked. Make sure it is correctly setClaudio Jeker
when a new peer shows up or during a reload. Tracking this during runtime just does not work reliably (especially for reloads). Problem noticed and fix tested by Pier Carlo Chiodi
2021-05-27Add the bits needed in bgpctl to show the new ADD-PATH and enhancedClaudio Jeker
route refresh capabilities in the neighbor output.
2021-05-27bgpd(8) will soon support ADD-PATH (RFC7911) and enhanced route refreshClaudio Jeker
(RFC7313). This is the frist step toward this. It adds the capability parsers for the two no capabilities, extends the capability struct and adds the capability negotiation bits. The route refresh message parser and generator are extended to support the BoRR and EoRR message. Also add the new NOTIFICATION type and subtype for the route refresh message.
2021-05-27Fix bad logic in last commit. If graceful restart is on and the forwardingClaudio Jeker
state is preserved do the graceful restart dance. If graceful restart is off or the forwarding state was not preserved flush the table.
2021-05-27Improve graceful restart capability handling.Claudio Jeker
Announce only the graceful restart capability header but do not include any AFI / SAFI pairs. bgpd does not preserve its forwarding state over restarts and only implements the "Procedures for the Receiving Speaker". When calculating the negotiated capabilities do not override the peer capabilities (AFI / SAFI bits), just make sure the negotiated bits are cleared. With this the peer capabilities are properly shown in bgpctl.
2021-05-26replaces calls to err(3)/errx(3) with fatal()/fatalx() from log.cEric Faurot
for code that runs in the daemon. ok florian@ millert@
2021-05-26remove unused codeEric Faurot
ok millert@
2021-05-25remove obsolete filesEric Faurot
2021-05-25Instead of the old way of prefix withdraw on a bad AS4_PATH treat it withClaudio Jeker
prefix withdraw as required by RFC6793. Also update the documentation to reference RFC6793 instead of the older 4893. OK sthen@
2021-05-23vmd(8): skip inspecting non-udp packets on local interfacesdv
reyk@ imported packet.c from (I think) dhclient(8). In dhclient, the packets are already filtered down to just udp. This change has vmd skip a non-udp ip packet sooner when it's trying to determine if it is a dhcp/bootp packet that needs processing. The counters (seen, bad checksums, etc) for ip and udp packets are also removed as they aren't used by vmd. This only affects "local" network interfaces for vmd. OK mlarkin@