The original check would always evaluate to false since
ISIS_PREFIX_SID_VALUE and ISIS_PREFIX_SID_LOCAL have different
values. Use !! to normalize the return value of the individual
checks to either 0 or 1, making the code do what was intended
(ensure the V/L flags are both 0 or 1).
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
}
sid.flags = stream_getc(s);
- if ((sid.flags & ISIS_PREFIX_SID_VALUE)
- != (sid.flags & ISIS_PREFIX_SID_LOCAL)) {
+ if (!!(sid.flags & ISIS_PREFIX_SID_VALUE)
+ != !!(sid.flags & ISIS_PREFIX_SID_LOCAL)) {
sbuf_push(log, indent, "Flags inplausible: Local Flag needs to match Value Flag\n");
- return 0;
+ return 1;
}
sid.algorithm = stream_getc(s);