mirror of
https://github.com/torvalds/linux.git
synced 2026-03-13 22:36:17 +01:00
ipv4: output metric as unsigned int
adding a route metric greater than 0x7fff_ffff leads to an unintended wrap when printing the underlying u32 as an unsigned int (`%d`) thus incorrectly rendering the metric as negative. Formatting using `%u` corrects the issue. Signed-off-by: Maximilian Güntner <code@mguentner.de> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20241212161911.51598-1-code@mguentner.de Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
ab2cedb0d4
commit
329365dc46
1 changed files with 2 additions and 2 deletions
|
|
@ -2999,7 +2999,7 @@ static int fib_route_seq_show(struct seq_file *seq, void *v)
|
|||
|
||||
seq_printf(seq,
|
||||
"%s\t%08X\t%08X\t%04X\t%d\t%u\t"
|
||||
"%d\t%08X\t%d\t%u\t%u",
|
||||
"%u\t%08X\t%d\t%u\t%u",
|
||||
nhc->nhc_dev ? nhc->nhc_dev->name : "*",
|
||||
prefix, gw, flags, 0, 0,
|
||||
fi->fib_priority,
|
||||
|
|
@ -3011,7 +3011,7 @@ static int fib_route_seq_show(struct seq_file *seq, void *v)
|
|||
} else {
|
||||
seq_printf(seq,
|
||||
"*\t%08X\t%08X\t%04X\t%d\t%u\t"
|
||||
"%d\t%08X\t%d\t%u\t%u",
|
||||
"%u\t%08X\t%d\t%u\t%u",
|
||||
prefix, 0, flags, 0, 0, 0,
|
||||
mask, 0, 0, 0);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue