How to use dhcp relay over ipsec0/wwan0 with zero MAC address?

Qingtao Cao qingtao.cao.au at gmail.com
Tue Nov 24 00:31:38 UTC 2020


Hi Thomas and other DHCP ISC developers,

Good day! This is my very first attempt to contribute back to the DHCP ISC
community. How could I generate and send pull requests for
the git at gitlab.isc.org:isc-projects/dhcp.git repo properly?

Anyway, currently I attached my patchset to the following issue:

https://gitlab.isc.org/isc-projects/dhcp/-/issues/152

Looking forward to hearing from you, much appreciated!

Harry

On Thu, Nov 5, 2020 at 12:09 PM Qingtao <qingtao.cao.au at gmail.com> wrote:

> Hi,
>
> I am trying to use the dhcrelay on an ipsec0 interface that was built upon
> a
> cellular modem interface, wwan0 for example. The problem I am running into
> is that, the QMI qmi_wwan.c kernel driver for the cellular modem works in
> the raw_ip mode and will setup wwanX relevant net_device with type ==
> ARPHRD_NONE and hard_header_len == 0, since the MAC address for wwan0 only
> makes sense for the host and not used on the USB link from the host to the
> cellular modem.
>
> Then the ipsec0 interface will inherit both the IP address and the MAC
> address, which will upset the dhcp relay daemon: in lpf.c get_hw_addr(),
> the
> switch(sa->sa_family) case structure will thow out the following error:
>
> Unsupported device type 65534 for "ipsec0"
>
> The 65534 == 0xFFFE, or ARPHRD_NONE. I am wondering if it is feasible to
> change the get_hw_addr() to regard it as an normal case, for example:
>
> +@@ -522,6 +522,11 @@ get_hw_addr(const char *name, struct har
> +                       hw->hbuf[0] = HTYPE_FDDI;
> +                       memcpy(&hw->hbuf[1], sa->sa_data, 6);
> +                       break;
> ++              case ARPHRD_NONE:
> ++                      /* When the qmi_wwan.c kernel driver works in the
> ++                       * raw_ip mode the length of MAC address is zero */
> ++                      memset(hw, 0, sizeof(struct hardware));
> ++                      break;
> +               default:
> +                       log_fatal("Unsupported device type %ld for \"%s\"",
> +                                 (long int)sa->sa_family, name);
>
> Would this work?
>
> Thanks in advance!
>
> Harry
>
>
>
>
> --
> Sent from: http://isc-dhcp-users.2343191.n4.nabble.com/
> _______________________________________________
> ISC funds the development of this software with paid support
> subscriptions. Contact us at https://www.isc.org/contact/ for more
> information.
>
> dhcp-users mailing list
> dhcp-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/dhcp-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20201124/161b7c84/attachment.htm>


More information about the dhcp-users mailing list