NetworkAllocate is called on Swarm master node which creates a network. The return option map is used to describe the network, and is passed to CreateNetwork which is called on all nodes when a service is created. Returning nil instead the actual options made Docker to omit the "works.weave.multicast" flag, thus no multicast could be used in Swarm.
Weave network driver extension for Docker and Kubernetes
This directory implements both a Docker plugin to integrate Weave Net with Docker, and a Container Network Interface (CNI) plugin, to integrate Weave Net with Kubernetes.
The Docker plugin runs automatically when you weave launch, provided your
Docker daemon is version 1.9 or newer.
More detail on the Docker plugin here.
More detail on the CNI plugin here.