[systemd-devel] [PATCH] resolved: fix warnings

Daniel Buch boogiewasthere at gmail.com
Thu Aug 14 12:07:50 PDT 2014


I just hit this assert on my arch system with gcc 4.9,

dbuch-laptop systemd-resolved[457]: Assertion 's->protocol ==
DNS_PROTOCOL_LLMNR' failed at src/resolve/resolved-dns-scope.c:369


2014-08-14 19:58 GMT+02:00 Lennart Poettering <lennart at poettering.net>:

> On Sat, 19.07.14 10:37, Thomas H.P. Andersen (phomes at gmail.com) wrote:
>
> > --- a/src/resolve/resolved-dns-scope.c
> > +++ b/src/resolve/resolved-dns-scope.c
> > @@ -292,7 +292,7 @@ int dns_scope_llmnr_membership(DnsScope *s, bool b) {
> >          if (s->family == AF_INET) {
> >                  struct ip_mreqn mreqn = {
> >                          .imr_multiaddr = LLMNR_MULTICAST_IPV4_ADDRESS,
> > -                        .imr_ifindex = s->link->ifindex,
> > +                        .imr_ifindex = s->link ? s->link->ifindex : 0,
>
> LLMNR scopes don't exist with a NULL link value, they are strictly bound
> to physical links.
>
> I have now added a couple of assert()s to the function, that should
> clarify that and hopefully tell the compiler that these are necessarily
> initialized.
>
> Does this make things work for you? Please check.
>
> Lennart
>
> --
> Lennart Poettering, Red Hat
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20140814/62ddc17f/attachment.html>


More information about the systemd-devel mailing list