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

Lennart Poettering lennart at poettering.net
Thu Aug 14 10:58:49 PDT 2014


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


More information about the systemd-devel mailing list