veyron/profiles/roaming: Move ListenSpec initialization
Move the ListenSpec initialization after the flags have been parsed. Before
this change, the values used were zero.
Change-Id: I80372befb6af617abf0120b8d4837b904aa8ed08
diff --git a/profiles/roaming/init.go b/profiles/roaming/init.go
index d5221f0..ce5862a 100644
--- a/profiles/roaming/init.go
+++ b/profiles/roaming/init.go
@@ -43,11 +43,6 @@
flag.StringVar(&listenProxyFlag, "veyron.proxy", "", "proxy to use")
rt.RegisterProfile(New())
- ListenSpec = &ipc.ListenSpec{
- Protocol: listenProtocolFlag.Protocol,
- Address: listenAddressFlag.String(),
- Proxy: listenProxyFlag,
- }
}
type profile struct {
@@ -92,6 +87,12 @@
func (p *profile) Init(rt veyron2.Runtime, publisher *config.Publisher) {
log := rt.Logger()
+ ListenSpec = &ipc.ListenSpec{
+ Protocol: listenProtocolFlag.Protocol,
+ Address: listenAddressFlag.String(),
+ Proxy: listenProxyFlag,
+ }
+
state, err := netstate.GetAccessibleIPs()
if err != nil {
log.Infof("failed to determine network state")