dhcpcd-discuss

Re: Support for "raw-ip" mode

Roy Marples

Tue Aug 20 13:11:18 2019

On 20/08/2019 13:43, Yegor Yefremov wrote:
Unfortunately, it is not working. Config file was wrong and the
interface must have been configured before via udhcpc (that's why it
says static address applied). Sorry.

It was still useful - otherwise dhcpcd would be waiting for an address, but with the patches it can now start DHCP.


I've corrected the /etc/dhcpcd.conf so that I see the O_DHCP was applied:

# dhcpcd wwan0
dhcpcd-8.0.2 starting
YY: O_DHCP
wwan0: executing `/lib/dhcpcd/dhcpcd-run-hooks' PREINIT
wwan0: executing `/lib/dhcpcd/dhcpcd-run-hooks' CARRIER
DUID 00:01:00:01:c7:92:bc:92:74:6a:8f:ff:50:55
wwan0: IAID 00:00:00:06
wwan0: delaying IPv6 router solicitation for 0.4 seconds
wwan0: delaying IPv4 for 0.4 seconds
wwan0: soliciting an IPv6 router
wwan0: delaying Router Solicitation for LL address
wwan0: needs a clientid to configure
wwan0: executing `/lib/dhcpcd/dhcpcd-run-hooks' FAIL
timed out
dhcpcd exited

I've sniffed with tcpdump and if catches nothing. I've attached a
sniff for udhcpc.

This is the important line
wwan0: needs a clientid to configure

We can see from the tcpdump that it sends a blank hardware address AND a blank clientid. From a DHCP *server* perspective how would we know what IP to lease?

Do you have a second QMI device you can dual test with on the same DHCP server using udhcpc? Do they get different IPs or do they try and contend the same IP? If different, how do you differentiate the leases on the server?

I'm trying to understand what was made in this patch that adds raw-ip
support to the ISC DHCP [1]. Seems like there is no way to avoid
packet header manipulation.

[1] https://mail.gnome.org/archives/networkmanager-list/2015-December/msg00044.html

The attached patch may help dhcpcd get further.

Roy
diff --git a/src/bpf.c b/src/bpf.c
index c321bb70..93c1ee9e 100644
--- a/src/bpf.c
+++ b/src/bpf.c
@@ -665,6 +665,10 @@ bpf_bootp(struct interface *ifp, int fd)
 	bp = bpf;
 	/* Check frame header. */
 	switch(ifp->family) {
+#ifdef ARPHRD_NETROM
+	case ARPHRD_NETROM:
+		break;
+#endif
 	case ARPHRD_ETHER:
 		memcpy(bp, bpf_bootp_ether, sizeof(bpf_bootp_ether));
 		bp += BPF_BOOTP_ETHER_LEN;
diff --git a/src/dhcp.c b/src/dhcp.c
index 8e48592f..b0c5418a 100644
--- a/src/dhcp.c
+++ b/src/dhcp.c
@@ -3724,12 +3724,6 @@ dhcp_start1(void *arg)
 		return;
 	}
 
-	if (ifp->hwlen == 0 && ifo->clientid[0] == '\0') {
-		logwarnx("%s: needs a clientid to configure", ifp->name);
-		dhcp_drop(ifp, "FAIL");
-		eloop_timeout_delete(ifp->ctx->eloop, NULL, ifp);
-		return;
-	}
 	/* We don't want to read the old lease if we NAK an old test */
 	nolease = state->offer && ifp->ctx->options & DHCPCD_TEST;
 	if (!nolease && ifo->options & DHCPCD_DHCP) {

Follow-Ups:
Re: Support for "raw-ip" modeYegor Yefremov
References:
Support for "raw-ip" modeYegor Yefremov
Re: Support for "raw-ip" modeRoy Marples
Re: Support for "raw-ip" modeYegor Yefremov
Re: Support for "raw-ip" modeRoy Marples
Re: Support for "raw-ip" modeYegor Yefremov
Re: Support for "raw-ip" modeRoy Marples
Re: Support for "raw-ip" modeRoy Marples
Re: Support for "raw-ip" modeYegor Yefremov
Archive administrator: postmaster@marples.name