From: Jiri Pirko Subject: [patch iproute2 RFC v2 2/2] add support for IFA_F_MANAGETEMPADDR Date: Tue, 19 Nov 2013 11:44:19 +0100 Message-ID: <1384857859-6618-2-git-send-email-jiri@resnulli.us> References: <1384857809-6573-1-git-send-email-jiri@resnulli.us> <1384857859-6618-1-git-send-email-jiri@resnulli.us> Cc: davem@davemloft.net, kuznet@ms2.inr.ac.ru, jmorris@namei.org, yoshfuji@linux-ipv6.org, kaber@trash.net, thaller@redhat.com, stephen@networkplumber.org, hannes@stressinduktion.org, vyasevich@gmail.com, dcbw@redhat.com, David.Laight@ACULAB.COM To: netdev@vger.kernel.org Return-path: Received: from mail-ea0-f179.google.com ([209.85.215.179]:63482 "EHLO mail-ea0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750833Ab3KSKoZ (ORCPT ); Tue, 19 Nov 2013 05:44:25 -0500 Received: by mail-ea0-f179.google.com with SMTP id r15so3025361ead.38 for ; Tue, 19 Nov 2013 02:44:24 -0800 (PST) In-Reply-To: <1384857859-6618-1-git-send-email-jiri@resnulli.us> Sender: netdev-owner@vger.kernel.org List-ID: Signed-off-by: Jiri Pirko --- include/linux/if_addr.h | 1 + ip/ipaddress.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/include/linux/if_addr.h b/include/linux/if_addr.h index cced59f..e1e95ce 100644 --- a/include/linux/if_addr.h +++ b/include/linux/if_addr.h @@ -45,6 +45,7 @@ enum { #define IFA_F_DEPRECATED 0x20 #define IFA_F_TENTATIVE 0x40 #define IFA_F_PERMANENT 0x80 +#define IFA_F_MANAGETEMPADDR 0x0100 struct ifa_cacheinfo { __u32 ifa_prefered; diff --git a/ip/ipaddress.c b/ip/ipaddress.c index 59dbd71..fa6417d 100644 --- a/ip/ipaddress.c +++ b/ip/ipaddress.c @@ -703,6 +703,10 @@ int print_addrinfo(const struct sockaddr_nl *who, struct nlmsghdr *n, ifa_flags &= ~IFA_F_NODAD; fprintf(fp, "nodad "); } + if (ifa_flags & IFA_F_MANAGETEMPADDR) { + ifa_flags &= ~IFA_F_MANAGETEMPADDR; + fprintf(fp, "mngtmpaddr "); + } if (!(ifa_flags & IFA_F_PERMANENT)) { fprintf(fp, "dynamic "); } else @@ -1345,6 +1349,8 @@ static int ipaddr_modify(int cmd, int flags, int argc, char **argv) ifa_flags |= IFA_F_HOMEADDRESS; } else if (strcmp(*argv, "nodad") == 0) { ifa_flags |= IFA_F_NODAD; + } else if (strcmp(*argv, "mngtmpaddr") == 0) { + ifa_flags |= IFA_F_MANAGETEMPADDR; } else { if (strcmp(*argv, "local") == 0) { NEXT_ARG(); -- 1.8.3.1