safchain / ethtool

A simple ethtool "like" library for GO
Apache License 2.0
116 stars 69 forks source link

Sending command panics with invalid argument #27

Open rolandjitsu opened 5 years ago

rolandjitsu commented 5 years ago

When running the following cmd I'm getting an invalid argument error:

func disableEth0AN() error {
    // `ethtool -s eth0 autoneg off speed 100 duplex full`
    cmd := &eth.EthtoolCmd{
        Autoneg: 0,
        Speed:   100,
        Duplex:  1,
    }

    ifa := "eth0"
    if _, err := cmd.CmdSet(ifa); err != nil {
        return fmt.Errorf("Cannot disable AN")
    }

    return nil
}

Are the values for the cmd wrong?