summaryrefslogtreecommitdiffstats
path: root/adapter
diff options
context:
space:
mode:
authorOndrej Fabry <ofabry@cisco.com>2019-05-15 00:01:28 +0200
committerOndrej Fabry <ofabry@cisco.com>2019-05-15 00:01:28 +0200
commit87e79ec9fa48e5f8b2eb949c337488db75a17b29 (patch)
tree6ba64c03b55eb5cc2b059b361030d79af0851ab4 /adapter
parent6acebecfc33da246685c1cc14b2fc8bc6be3191b (diff)
Try using different type of unix socket connection
Change-Id: I6abde10043c4ff4d42d15a39cca10f82327d83dc Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
Diffstat (limited to 'adapter')
-rw-r--r--adapter/socketclient/socketclient.go11
1 files changed, 8 insertions, 3 deletions
diff --git a/adapter/socketclient/socketclient.go b/adapter/socketclient/socketclient.go
index 8efc7ba..2b67645 100644
--- a/adapter/socketclient/socketclient.go
+++ b/adapter/socketclient/socketclient.go
@@ -171,10 +171,15 @@ func (c *vppClient) connect(sockAddr string) error {
return err
}
- conn, err := net.DialUnix("unixpacket", nil, addr)
+ conn, err := net.DialUnix("unix", nil, addr)
if err != nil {
- Log.Debugln("Dial error:", err)
- return err
+ if strings.Contains(err.Error(), "wrong type for socket") {
+ conn, err = net.DialUnix("unixpacket", nil, addr)
+ }
+ if err != nil {
+ Log.Debugln("Dial error:", err)
+ return err
+ }
}
c.conn = conn