diff --git a/nodeup/pkg/model/network.go b/nodeup/pkg/model/network.go index c04be30a19..28a77f43c8 100644 --- a/nodeup/pkg/model/network.go +++ b/nodeup/pkg/model/network.go @@ -68,19 +68,20 @@ func (b *NetworkBuilder) Build(c *fi.ModelBuilderContext) error { } if networking.Cilium != nil { - // systemd v238 includes the bpffs mount by default; and gives an error "has a bad unit file setting" if we try to mount it again (see mount_point_is_api) - var alreadyMounted bool - // bpffs magic number - magic := uint32(0xCAFE4A11) var fsdata unix.Statfs_t err := unix.Statfs("/sys/fs/bpf", &fsdata) if err != nil { return fmt.Errorf("error checking for /sys/fs/bpf: %v", err) - } else { - alreadyMounted = int32(magic) == int32(fsdata.Type) } + // systemd v238 includes the bpffs mount by default; and gives an error "has a bad unit file setting" if we try to mount it again (see mount_point_is_api) + var alreadyMounted bool + // bpffs magic number. See https://github.com/torvalds/linux/blob/v4.8/include/uapi/linux/magic.h#L80 + magic := uint32(0xCAFE4A11) + + alreadyMounted = int32(magic) == int32(fsdata.Type) + if !alreadyMounted { unit := s(` [Unit]