public inbox for iwd@lists.linux.dev
 help / color / mirror / Atom feed
* Making udhcpc get a new lease when iwd connects to a network
@ 2024-01-21 22:53 Rafael Ávila de Espíndola
  2024-01-22 12:21 ` James Prestwood
  0 siblings, 1 reply; 4+ messages in thread
From: Rafael Ávila de Espíndola @ 2024-01-21 22:53 UTC (permalink / raw)
  To: iwd

Hi,

I know that iwd has a builtin dhcp client, but I am using it in alpine
linux and would like to use the same dhcp client with both wired and
wireless interfaces. The default client in alpine is udhcpc.

As far as I can tell, the impedance mismatch between udhcpc and iwd is
that udhcpc expect commands via unix signals and iwd send property
changes via dbus.

I wrote a bit of glue code and posted it to
https://codeberg.org/espindola/iwd2udhcpc. It works, at least on my
laptop, but I am wondering if anyone knows of a simpler way.

Thanks,
Rafael

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Making udhcpc get a new lease when iwd connects to a network
  2024-01-21 22:53 Making udhcpc get a new lease when iwd connects to a network Rafael Ávila de Espíndola
@ 2024-01-22 12:21 ` James Prestwood
  2024-01-22 15:01   ` Denis Kenzior
  0 siblings, 1 reply; 4+ messages in thread
From: James Prestwood @ 2024-01-22 12:21 UTC (permalink / raw)
  To: Rafael Ávila de Espíndola, iwd

Hi Rafael,

On 1/21/24 2:53 PM, Rafael Ávila de Espíndola wrote:
> Hi,
>
> I know that iwd has a builtin dhcp client, but I am using it in alpine
> linux and would like to use the same dhcp client with both wired and
> wireless interfaces. The default client in alpine is udhcpc.
>
> As far as I can tell, the impedance mismatch between udhcpc and iwd is
> that udhcpc expect commands via unix signals and iwd send property
> changes via dbus.
>
> I wrote a bit of glue code and posted it to
> https://codeberg.org/espindola/iwd2udhcpc. It works, at least on my
> laptop, but I am wondering if anyone knows of a simpler way.

I think the intended way is for the DHCP daemon to listen for the 
interface to set carrier up (from RTNL). This is how systemd-networkd 
does it, and AFAIK dhcpd. I'm surprised udhcpd doesn't although I 
suspect since its heavily stripped down they leave it up to some other 
entity to tell it to start.

Listening for IWD's connected state is effectively the same thing. One 
thing to keep in mind is you don't want to start DHCP again when 
transitioning from roaming->connected.

>
> Thanks,
> Rafael
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Making udhcpc get a new lease when iwd connects to a network
  2024-01-22 12:21 ` James Prestwood
@ 2024-01-22 15:01   ` Denis Kenzior
  2024-01-22 20:59     ` Rafael Ávila de Espíndola
  0 siblings, 1 reply; 4+ messages in thread
From: Denis Kenzior @ 2024-01-22 15:01 UTC (permalink / raw)
  To: James Prestwood, Rafael Ávila de Espíndola, iwd

Hi James, Rafael,

> 
> I think the intended way is for the DHCP daemon to listen for the interface to 
> set carrier up (from RTNL). This is how systemd-networkd does it, and AFAIK 

Refer to https://docs.kernel.org/networking/operstates.html for an explanation 
of how this is supposed to work.  The kernel will signal NO_CARRIER any time the 
wlan interface is not associated and IF_UP once the interface is fully connected.

Regards,
-Denis


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Making udhcpc get a new lease when iwd connects to a network
  2024-01-22 15:01   ` Denis Kenzior
@ 2024-01-22 20:59     ` Rafael Ávila de Espíndola
  0 siblings, 0 replies; 4+ messages in thread
From: Rafael Ávila de Espíndola @ 2024-01-22 20:59 UTC (permalink / raw)
  To: Denis Kenzior, James Prestwood, iwd

Thanks!

I will take a look.

Cheers,
Rafael

Denis Kenzior <denkenz@gmail.com> writes:

> Hi James, Rafael,
>
>> 
>> I think the intended way is for the DHCP daemon to listen for the interface to 
>> set carrier up (from RTNL). This is how systemd-networkd does it, and AFAIK 
>
> Refer to https://docs.kernel.org/networking/operstates.html for an explanation 
> of how this is supposed to work.  The kernel will signal NO_CARRIER any time the 
> wlan interface is not associated and IF_UP once the interface is fully connected.
>
> Regards,
> -Denis

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-01-22 20:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-21 22:53 Making udhcpc get a new lease when iwd connects to a network Rafael Ávila de Espíndola
2024-01-22 12:21 ` James Prestwood
2024-01-22 15:01   ` Denis Kenzior
2024-01-22 20:59     ` Rafael Ávila de Espíndola

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox