ConnMan network manager
 help / color / mirror / Atom feed
From: "Zoltán Böszörményi" <zboszor@gmail.com>
To: connman@lists.linux.dev
Cc: "Zoltán Böszörményi" <zboszor@gmail.com>
Subject: [RFC][PATCH] gdhcp/client: Don't attach a DHCP client to veth* devices
Date: Tue, 11 Jul 2023 17:40:32 +0200	[thread overview]
Message-ID: <20230711154032.935972-1-zboszor@gmail.com> (raw)

veth* interfaces are created as sub-interfaces for a bridge
by Docker and not actually used for communication in my use case.

But Connman tries to use DHCPv4 on them and they end up with
an IP address in the 169.254.x.x range with routes added to them,
which extra routes in turn break networking on the host.

This is a very bad approach, hence the RFC status of the patch.
It may be better if Connman didn't add routing for interfaces
with only a link local address. Please give me some pointers
so I can implement it properly.

Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
---
 gdhcp/client.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/gdhcp/client.c b/gdhcp/client.c
index 82017692..36c233a1 100644
--- a/gdhcp/client.c
+++ b/gdhcp/client.c
@@ -1175,6 +1175,11 @@ GDHCPClient *g_dhcp_client_new(GDHCPType type,
 		goto error;
 	}
 
+	if (strncmp(dhcp_client->interface, "veth", 4) == 0) {
+		*error = G_DHCP_CLIENT_ERROR_INTERFACE_IN_USE;
+		goto error;
+	}
+
 	if (!interface_is_up(ifindex)) {
 		*error = G_DHCP_CLIENT_ERROR_INTERFACE_DOWN;
 		goto error;
-- 
2.41.0


             reply	other threads:[~2023-07-11 15:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-11 15:40 Zoltán Böszörményi [this message]
2023-08-16  7:06 ` [RFC][PATCH] gdhcp/client: Don't attach a DHCP client to veth* devices Marcel Holtmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230711154032.935972-1-zboszor@gmail.com \
    --to=zboszor@gmail.com \
    --cc=connman@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).