diff options
Diffstat (limited to 'bbot/machine.cxx')
-rw-r--r-- | bbot/machine.cxx | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/bbot/machine.cxx b/bbot/machine.cxx index de394b6..0bd2e86 100644 --- a/bbot/machine.cxx +++ b/bbot/machine.cxx @@ -205,7 +205,29 @@ namespace bbot strings os; if (mm.options) + { os = mm.unquoted_options (); + + // Pre-process ifname=? and mac=?. + // + auto sub = [] (string& o, const char* s, const string& r) + { + size_t p (o.find (s)); + + if (p != string::npos) + { + p = o.find ('?', p + 1); + assert (p != string::npos); + o.replace (p, 1, r); + } + }; + + for (string& o: os) + { + sub (o, "ifname=?", tap); + sub (o, "mac=?", mac); + } + } else { auto add = [&os] (string o, string v) |