]> git.ipfire.org Git - thirdparty/wireguard-go.git/commitdiff
main: simplify warnings
authorJason A. Donenfeld <Jason@zx2c4.com>
Sun, 8 Sep 2019 15:56:00 +0000 (10:56 -0500)
committerJason A. Donenfeld <Jason@zx2c4.com>
Sun, 8 Sep 2019 15:56:00 +0000 (10:56 -0500)
Makefile
donotuseon_linux.go [deleted file]
main.go

index 1a154ef4eef426964cd1e9010024f149b6b8a32d..842e069b456e6317ca962d632b77345b05c1a434 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,24 +1,10 @@
 PREFIX ?= /usr
 DESTDIR ?=
 BINDIR ?= $(PREFIX)/bin
-export GOPATH ?= $(CURDIR)/.gopath
 export GO111MODULE := on
 
 all: generate-version-and-build
 
-ifeq ($(shell go env GOOS)|$(wildcard .git),linux|)
-$(error Do not build this for Linux. Instead use the Linux kernel module. See wireguard.com/install/ for more info.)
-else ifeq ($(shell go env GOOS),linux)
-ireallywantobuildon_linux.go:
-       @printf "WARNING: This software is meant for use on non-Linux\nsystems. For Linux, please use the kernel module\ninstead. See wireguard.com/install/ for more info.\n\n" >&2
-       @printf 'package main\nconst UseTheKernelModuleInstead = 0xdeadbabe\n' > "$@"
-clean-ireallywantobuildon_linux.go:
-       @rm -f ireallywantobuildon_linux.go
-.PHONY: clean-ireallywantobuildon_linux.go
-clean: clean-ireallywantobuildon_linux.go
-wireguard-go: ireallywantobuildon_linux.go
-endif
-
 MAKEFLAGS += --no-print-directory
 
 generate-version-and-build:
diff --git a/donotuseon_linux.go b/donotuseon_linux.go
deleted file mode 100644 (file)
index ee8a83b..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-// +build !android
-
-/* SPDX-License-Identifier: MIT
- *
- * Copyright (C) 2017-2019 WireGuard LLC. All Rights Reserved.
- */
-
-package main
-
-const DoNotUseThisProgramOnLinux = UseTheKernelModuleInstead
-
-// --------------------------------------------------------
-// Do not use this on Linux. Instead use the kernel module.
-// See wireguard.com/install for more information.
-// --------------------------------------------------------
diff --git a/main.go b/main.go
index 12753d6fb1247955ab03255f26a62e70e058e199..053f488ea261395435a4e702cd422c3f240e4581 100644 (file)
--- a/main.go
+++ b/main.go
@@ -40,31 +40,19 @@ func warning() {
        if runtime.GOOS != "linux" || os.Getenv(ENV_WG_PROCESS_FOREGROUND) == "1" {
                return
        }
-       shouldQuit := os.Getenv("WG_I_PREFER_BUGGY_USERSPACE_TO_POLISHED_KMOD") != "1"
 
        fmt.Fprintln(os.Stderr, "WARNING WARNING WARNING WARNING WARNING WARNING WARNING")
        fmt.Fprintln(os.Stderr, "W                                                     G")
        fmt.Fprintln(os.Stderr, "W   You are running this software on a Linux kernel,  G")
-       fmt.Fprintln(os.Stderr, "W   which is probably unnecessary and foolish. This   G")
+       fmt.Fprintln(os.Stderr, "W   which is probably unnecessary and misguided. This G")
        fmt.Fprintln(os.Stderr, "W   is because the Linux kernel has built-in first    G")
        fmt.Fprintln(os.Stderr, "W   class support for WireGuard, and this support is  G")
        fmt.Fprintln(os.Stderr, "W   much more refined than this slower userspace      G")
        fmt.Fprintln(os.Stderr, "W   implementation. For more information on           G")
        fmt.Fprintln(os.Stderr, "W   installing the kernel module, please visit:       G")
        fmt.Fprintln(os.Stderr, "W           https://www.wireguard.com/install         G")
-       if shouldQuit {
-               fmt.Fprintln(os.Stderr, "W                                                     G")
-               fmt.Fprintln(os.Stderr, "W   If you still want to use this program, against    G")
-               fmt.Fprintln(os.Stderr, "W   the advice here, please first export this         G")
-               fmt.Fprintln(os.Stderr, "W   environment variable:                             G")
-               fmt.Fprintln(os.Stderr, "W   WG_I_PREFER_BUGGY_USERSPACE_TO_POLISHED_KMOD=1    G")
-       }
        fmt.Fprintln(os.Stderr, "W                                                     G")
        fmt.Fprintln(os.Stderr, "WARNING WARNING WARNING WARNING WARNING WARNING WARNING")
-
-       if shouldQuit {
-               os.Exit(1)
-       }
 }
 
 func main() {
@@ -75,8 +63,6 @@ func main() {
 
        warning()
 
-       // parse arguments
-
        var foreground bool
        var interfaceName string
        if len(os.Args) < 2 || len(os.Args) > 3 {