]> git.ipfire.org Git - thirdparty/systemd.git/commit
resolved: Track per-service item ifindex in DnssdDiscoveredService
authorChristian Glombek <c.glombek@cosa.systems>
Sun, 22 Feb 2026 22:38:59 +0000 (23:38 +0100)
committerChristian Glombek <c.glombek@cosa.systems>
Sun, 22 Feb 2026 22:38:59 +0000 (23:38 +0100)
commitf753f898ed06206c7dd246ce25796bd4c249d360
tree8120a867532133cc9c5d665c079d5b3fbecd53fa
parent3a7486c9fcd3c9457396522dc5e6f286871aac6d
resolved: Track per-service item ifindex in DnssdDiscoveredService

The interface where each service was discovered needs to be remembered
so it can be correctly reported when the service is later removed.

Previously, service removal would use sb->ifindex, losing the actual
interface information from the original discovery.

This change:
- Adds an ifindex field to DnssdDiscoveredService struct
- Stores the discovered interface index when adding new services,
  preferring the per-item ifindex from DnsAnswerItem over the service
  browser's ifindex
- Uses the stored ifindex when reporting service removal events

This ensures that service removal notifications include the correct
interface index where the service was originally discovered, matching
the behavior of the corresponding service addition notifications.

Assisted-by: Claude Opus 4.6 (Eclipse Theia IDE AI)
src/resolve/resolved-dns-browse-services.c
src/resolve/resolved-dns-browse-services.h