mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-14 18:27:21 +00:00
bgpd: avoid recalculating as_val value in str2prefix_rd
This is an optimisation that consists in avoiding calling twice atol() function when converting an ext. community to an AS4 byte or a standard AS byte value. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
This commit is contained in:
parent
cc5eb67752
commit
bac21a7c4b
@ -346,13 +346,13 @@ str2prefix_rd (const char *str, struct prefix_rd *prd)
|
|||||||
if (as_val > 0xffff)
|
if (as_val > 0xffff)
|
||||||
{
|
{
|
||||||
stream_putw (s, RD_TYPE_AS4);
|
stream_putw (s, RD_TYPE_AS4);
|
||||||
stream_putl (s, atol (half));
|
stream_putl (s, as_val);
|
||||||
stream_putw (s, atol (p + 1));
|
stream_putw (s, atol (p + 1));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
stream_putw (s, RD_TYPE_AS);
|
stream_putw (s, RD_TYPE_AS);
|
||||||
stream_putw (s, atol (half));
|
stream_putw (s, as_val);
|
||||||
stream_putl (s, atol (p + 1));
|
stream_putl (s, atol (p + 1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user