Subject: Re: add ip to interface as primary ip address, not secondary ip when there is alreadly primary ip?

From: Cong Wang <[email-masked]>
Date: Fri, 20 Sep 2013 02:28:21 +0000 (UTC)

On Thu, 19 Sep 2013 at 16:54 GMT, Vincent Li <[email-masked]> wrote:
> thanks for the pointer
>
> 'ip addr' indeed has flag IFA_F_SECONDARY for this, but it is not
> available for 'ip addr add', so I made a simple patch for iproute2
> ip/ipaddress.c as below:

% git grep secondary ip/ipaddress.c
ip/ipaddress.c: fprintf(stderr, "FLAG  := [ permanent | dynamic |
secondary | primary |\n");
ip/ipaddress.c:                 fprintf(fp, "secondary ");
ip/ipaddress.c:static int print_addrinfo_secondary(const struct
sockaddr_nl *who,
ip/ipaddress.c:                         .filter =
print_addrinfo_secondary,
ip/ipaddress.c:         } else if (strcmp(*argv, "secondary") == 0 ||