[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH] network: set mtu as a DHCP option when specified



On Tue, Dec 11, 2018 at 05:05:43PM +0100, Casey Callendrello wrote:
This adds an additional directive to the dnsmasq configuration file that
notifies clients via dhcp about the link's MTU. Guests can then choose
adjust their link accordingly.

Signed-off-by: Casey Callendrello <cdc redhat com>
---
src/network/bridge_driver.c                   |  7 ++++++
.../networkxml2confdata/nat-network-mtu.conf  | 19 +++++++++++++++
tests/networkxml2confdata/nat-network-mtu.xml | 22 +++++++++++++++++
tests/networkxml2conftest.c                   |  1 +
tests/networkxml2xmlin/nat-network-mtu.xml    | 22 +++++++++++++++++
tests/networkxml2xmlout/nat-network-mtu.xml   | 24 +++++++++++++++++++
tests/networkxml2xmltest.c                    |  1 +
7 files changed, 96 insertions(+)
create mode 100644 tests/networkxml2confdata/nat-network-mtu.conf
create mode 100644 tests/networkxml2confdata/nat-network-mtu.xml
create mode 100644 tests/networkxml2xmlin/nat-network-mtu.xml
create mode 100644 tests/networkxml2xmlout/nat-network-mtu.xml

diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index 4bbc4f5a6d..81edf72493 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -1506,6 +1506,13 @@ networkDnsmasqConfContents(virNetworkObjPtr obj,
                          dctx->addnhostsfile->path);
    }

+    /* Configure DHCP to tell clients about the MTU.
+     */

This comment can fit on one line,

+    if (def->mtu > 0) {
+        virBufferAsprintf(&configbuf, "dhcp-option=option:mtu,%d\n",
+                          def->mtu);

and so can this command.

+    }
+
    /* Are we doing RA instead of radvd? */
    if (DNSMASQ_RA_SUPPORT(caps)) {
        if (ipv6def) {

With that adjusted:
Reviewed-by: Ján Tomko <jtomko redhat com>

Jano

Attachment: signature.asc
Description: PGP signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]