sharing: Fix compilation without NetworkManager

Caused by my rework of Giovanni's
bc3be2b760963688f15d28a853cd99954594e979 commit.