From: dv Date: Wed, 2 Jun 2021 14:40:46 +0000 (+0000) Subject: vmd(8): allow locking a randomly assigned lladdr X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=6153f04ab7763e302a624f17fedf3295fd8117c8;p=openbsd vmd(8): allow locking a randomly assigned lladdr 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@ --- diff --git a/usr.sbin/vmd/parse.y b/usr.sbin/vmd/parse.y index bc2b4b50534..52815e028e8 100644 --- a/usr.sbin/vmd/parse.y +++ b/usr.sbin/vmd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.56 2020/09/23 19:18:18 martijn Exp $ */ +/* $OpenBSD: parse.y,v 1.57 2021/06/02 14:40:46 dv Exp $ */ /* * Copyright (c) 2007-2016 Reyk Floeter @@ -694,6 +694,9 @@ lladdr : STRING { memcpy($$, ea, ETHER_ADDR_LEN); } + | /* empty */ { + memset($$, 0, ETHER_ADDR_LEN); + } ; local : /* empty */ { $$ = 0; }