summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
7dd0371)
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.
if (tb[IFLA_GRE_OFLAGS])
oflags = *(__u16 *)RTA_DATA(tb[IFLA_GRE_OFLAGS]);
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);
}
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));
inet_ntop(AF_INET, RTA_DATA(tb[IFLA_GRE_OKEY]), s2, sizeof(s2));
- fprintf(f, "ikey %s ", s2);
+ fprintf(f, "okey %s ", s2);