From a174c585ec3e299ce9bd7dab49713ec60e0516dd Mon Sep 17 00:00:00 2001 From: Alexander Morozov Date: Sat, 13 Jun 2015 21:01:03 -0700 Subject: [PATCH] Add info about NewLinkAttrs to readme Signed-off-by: Alexander Morozov --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 555f886..8cd50a9 100644 --- a/README.md +++ b/README.md @@ -43,13 +43,19 @@ import ( ) func main() { - mybridge := &netlink.Bridge{netlink.LinkAttrs{Name: "foo"}} + la := netlink.NewLinkAttrs() + la.Name = "foo" + mybridge := &netlink.Bridge{la}} _ := netlink.LinkAdd(mybridge) eth1, _ := netlink.LinkByName("eth1") netlink.LinkSetMaster(eth1, mybridge) } ``` +Note `NewLinkAttrs` constructor, it sets default values in structure. For now +it sets only `TxQLen` to `-1`, so kernel will set default by itself. If you're +using simple initialization(`LinkAttrs{Name: "foo"}`) `TxQLen` will be set to +`0` unless you specify it like `LinkAttrs{Name: "foo", TxQLen: 1000}`. Add a new ip address to loopback: