netlink_linux: add remove address call, refactor add address call to share code with remove address call.

Please review. Will submit tests in a separate PR after #117 is merged. Have tested manually.
I wasn’t aware of that. Will retool. Thanks.

-Erik

> On Jul 23, 2014, at 3:45 PM, Michael Crosby <notifications@github.com> wrote:
> 
> In netlink/netlink_linux_test.go:
> 
> >  	"testing"
> >  )
> >  
> > +func TestAddRemNetworkIp(t *testing.T) {
> > +	var err error
> > +
> > +	ifaceString := "lo"
> > +	ip := net.ParseIP("127.0.1.1")
> > +	mask := net.IPv4Mask(255, 255, 255, 255)
> > +	ipNet := &net.IPNet{ip, mask}
> > +	rx := regexp.MustCompile(regexp.QuoteMeta(ip.String()))
> > +
> > +	iface, err := net.InterfaceByName(ifaceString)
> > +	if err != nil {
> > +		t.Skip("No 'lo' interface; skipping tests")
> > +	}
> > +
> > +	if _, err := os.Stat("/sbin/ip"); err != nil {
> Instead of using the ip command can't you use:
> 
> iface, err := net.InterfaceByName(name)
> 
> addrs := iface.Addrs()
> —
> Reply to this email directly or view it on GitHub.
>