encoding: Fix bug in getForwardingEntryFlags: Need to check all flags, not the first flag using "else if".