[systemd-devel] [PATCH] sd-dhcp-client: Sets broadcast flag to 1
Tom Gundersen
teg at jklm.no
Fri May 30 09:21:44 PDT 2014
On 30 May 2014 10:25, "Patrik Flykt" <Patrik.Flykt at linux.intel.com> wrote:
>
> On Thu, 2014-05-29 at 18:18 +0100, Tom Gundersen wrote:
> > + if (link->udev_device) {
> > + const char *l2;
> > +
> > + l2 = udev_device_get_sysattr_value(link->udev_device, "layer2");
> > + if (l2) {
> > + unsigned layer2;
> > +
> > + r = safe_atou(l2, &layer2);
> > + if (r < 0)
> > + return r;
> > +
> > + if (!layer2) {
> > + r =
sd_dhcp_client_request_broadcast(link->dhcp_client);
> > + if (r < 0)
> > + return r;
> > + }
>
> Am I now missing something if I can't find the
> file /sys/class/net/<device>/device/layer2 for a regular networking
> interface? The above enables broadcast only for virtual interfaces,
> right?
That's correct. My hope was that the interfaces that require broadcast
would expose that somehow. It appears that's not the case, so a scheme like
yours sounds more robust.
I'm wondering if the criterion should be to request broadcast if and only
if we have not configured an IP address (I.e. only in discovering,
requesting and init-reboot), as that seems to be the problem, or did I get
that wrong?
Cheers,
Tom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20140530/077d81e3/attachment.html>
More information about the systemd-devel
mailing list