Skip to content

Commit

Permalink
fix-netlink
Browse files Browse the repository at this point in the history
  • Loading branch information
henderiw committed Sep 3, 2020
1 parent 1408f92 commit 04ec1d1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,5 @@ graph/*
containerlab*
containerlab*/
license.key
<<<<<<< Updated upstream
lab-wan
lab-wan/*
=======
>>>>>>> Stashed changes
lab-wan/*
13 changes: 7 additions & 6 deletions clab/netlink.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,19 @@ func (c *cLab) CreateVirtualWiring(id int, link *Link) (err error) {
}

log.Debug("set RX, TX offload off on container A")
cmd = exec.Command("sudo", "docker", "exec", "-ti", link.a.Node.LongName, "ethtool", "--offload", link.a.EndpointName, "rx", "off", "tx", "off")
_, err = cmd.CombinedOutput()
var b []byte
b, err = exec.Command("docker", "exec", link.a.Node.LongName, "ethtool", "--offload", link.a.EndpointName, "rx", "off", "tx", "off").CombinedOutput()
if err != nil {
log.Debug("cmd.Run() failed with", err)
log.Debugf("cmd.Run() failed with: %s", err)
}
log.Debugf("%s", string(b))

log.Debug("set RX, TX offload off on container B")
cmd = exec.Command("sudo", "docker", "exec", "-ti", link.b.Node.LongName, "ethtool", "--offload", link.b.EndpointName, "rx", "off", "tx", "off")
_, err = cmd.CombinedOutput()
b, err = exec.Command("docker", "exec", link.b.Node.LongName, "ethtool", "--offload", link.b.EndpointName, "rx", "off", "tx", "off").CombinedOutput()
if err != nil {
log.Debug("cmd.Run() failed with", err)
log.Debugf("cmd.Run() failed with: %s", err)
}
log.Debugf("%s", string(b))

//ip link add tmp_a type veth peer name tmp_b
//ip link set tmp_a netns $srl_a
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func main() {
log.Error(err)
}

log.Info("Create contaianer:", shortDutName)
log.Info("Create container:", shortDutName)
if err = c.CreateContainer(ctx, shortDutName, node); err != nil {
log.Error(err)
}
Expand Down

0 comments on commit 04ec1d1

Please sign in to comment.