From 799160c5c2158683793b98540a62258a0387cf7e Mon Sep 17 00:00:00 2001 From: Matthias Radestock Date: Wed, 13 Jan 2016 10:27:25 +0000 Subject: [PATCH] remove "encryption -> pcap" cruft As of e12dbb460 (#1758) we no longer force the usage of pcap when encryption is enabled. Hence... - we no longer need to figure out whether the router was started with a password when re-attaching it from the proxy. We therefore remove the code for that. - there is no longer any mode in which we pass both `--datapath` and `--iface` options to the router. Previously this would only happen when encryption was enabled and the only overlay used for connections was sleeve. It is not clear what the behaviour is when these conditions do not hold, so, to be safe, we prevent the specification of both flags. --- prog/weaver/main.go | 18 +++++------------- weave | 1 - 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/prog/weaver/main.go b/prog/weaver/main.go index ca2d5495..ba1e8e7f 100644 --- a/prog/weaver/main.go +++ b/prog/weaver/main.go @@ -128,23 +128,15 @@ func main() { config.ProtocolMinVersion = byte(protocolMinVersion) overlays := weave.NewOverlaySwitch() - if datapathName != "" { - // A datapath name implies that "Bridge" and "Overlay" - // packet handling use fast datapath, although other - // options can override that below. Even if both - // things are overridden, we might need bridging on - // the datapath. + switch { + case datapathName != "" && ifaceName != "": + Log.Fatal("At most one of --datapath and --iface must be specified.") + case datapathName != "": fastdp, err := weave.NewFastDatapath(datapathName, config.Port) checkFatal(err) networkConfig.Bridge = fastdp.Bridge() overlays.Add("fastdp", fastdp.Overlay()) - } - if ifaceName != "" { - // -iface can coexist with -datapath, because - // pcap-based packet capture is a bit more efficient - // than capture via ODP misses, even when using an - // ODP-based bridge. So when using weave encyption, - // it's preferable to use -iface. + case ifaceName != "": var err error iface, err = weavenet.EnsureInterface(ifaceName) checkFatal(err) diff --git a/weave b/weave index 8128bd44..f08cdaad 100755 --- a/weave +++ b/weave @@ -1622,7 +1622,6 @@ fetch_router_args() { CONTAINER_ARGS=$(docker inspect -f '{{.Args}}' $CONTAINER_NAME) IPRANGE=$(echo $CONTAINER_ARGS | grep -o -e '-ipalloc-range [^ ]*') || true NO_DNS_OPT=$(echo $CONTAINER_ARGS | grep -o -e '--no-dns') || true - WEAVE_PASSWORD=$(docker inspect -f '{{.Config.Env}}' $CONTAINER_NAME | sed -n -e 's/.*WEAVE_PASSWORD=\([^] ]*\).*/\1/p') } attach_router() {