ConnMan network manager
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: "Zoltán Böszörményi" <zboszor@gmail.com>
Cc: connman@lists.linux.dev
Subject: Re: [RFC][PATCH] gdhcp/client: Don't attach a DHCP client to veth* devices
Date: Wed, 16 Aug 2023 09:06:11 +0200	[thread overview]
Message-ID: <09F98822-C02E-43CE-B4C2-54B2050DE462@holtmann.org> (raw)
In-Reply-To: <20230711154032.935972-1-zboszor@gmail.com>

Hi Zoltan,

> 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;

bad approach indeed. No hard code interface name matching in the DHCP client code.

Regards

Marcel


      reply	other threads:[~2023-08-16  7:06 UTC|newest]

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

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=09F98822-C02E-43CE-B4C2-54B2050DE462@holtmann.org \
    --to=marcel@holtmann.org \
    --cc=connman@lists.linux.dev \
    --cc=zboszor@gmail.com \
    /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).