aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2012-03-19 17:18:49 -0700
committerStephen Hemminger <shemminger@vyatta.com>2012-03-19 17:18:49 -0700
commit718165534d0c57ea23c536f57affe7f04a33199a (patch)
tree511e0437e886959ae23c1bf810935f0fabb3f668
parent7dd03712226d2943e46f427217158707c148d2b3 (diff)
downloadandroid_external_iproute2-718165534d0c57ea23c536f57affe7f04a33199a.tar.gz
android_external_iproute2-718165534d0c57ea23c536f57affe7f04a33199a.tar.bz2
android_external_iproute2-718165534d0c57ea23c536f57affe7f04a33199a.zip
gre: allow 0 as a legal key value
There is nothing in the standard that says 0 can't be used as a key. It makes sense to allow it. Also fix typo where ikey was printed for when printing okey.
-rw-r--r--ip/link_gre.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/ip/link_gre.c b/ip/link_gre.c
index c783203..5002095 100644
--- a/ip/link_gre.c
+++ b/ip/link_gre.c
@@ -331,16 +331,14 @@ static void gre_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
if (tb[IFLA_GRE_OFLAGS])
oflags = *(__u16 *)RTA_DATA(tb[IFLA_GRE_OFLAGS]);
- if (iflags & GRE_KEY && tb[IFLA_GRE_IKEY] &&
- *(__u32 *)RTA_DATA(tb[IFLA_GRE_IKEY])) {
+ if ((iflags & GRE_KEY) && tb[IFLA_GRE_IKEY]) {
inet_ntop(AF_INET, RTA_DATA(tb[IFLA_GRE_IKEY]), s2, sizeof(s2));
fprintf(f, "ikey %s ", s2);
}
- if (oflags & GRE_KEY && tb[IFLA_GRE_OKEY] &&
- *(__u32 *)RTA_DATA(tb[IFLA_GRE_OKEY])) {
+ if ((oflags & GRE_KEY) && tb[IFLA_GRE_OKEY]) {
inet_ntop(AF_INET, RTA_DATA(tb[IFLA_GRE_OKEY]), s2, sizeof(s2));
- fprintf(f, "ikey %s ", s2);
+ fprintf(f, "okey %s ", s2);
}
if (iflags & GRE_SEQ)