summaryrefslogtreecommitdiff
path: root/bgpd/bgp_aspath.c
diff options
context:
space:
mode:
authorDenis Ovsienko <infrastation@yandex.ru>2009-12-04 17:32:54 +0300
committerDenis Ovsienko <infrastation@yandex.ru>2009-12-04 17:32:54 +0300
commit2eb445e1c22e36d07e2dbfd302ff438c4190b9fe (patch)
tree82372e9d6fc630758fcf265cbdfdf3b826699cbd /bgpd/bgp_aspath.c
parente6f148e6e06a37a65afb322eca6a3298b8ade8d2 (diff)
bgpd: work around warning in assegments_parse()
Diffstat (limited to 'bgpd/bgp_aspath.c')
-rw-r--r--bgpd/bgp_aspath.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/bgpd/bgp_aspath.c b/bgpd/bgp_aspath.c
index 440815b4..3c8032f8 100644
--- a/bgpd/bgp_aspath.c
+++ b/bgpd/bgp_aspath.c
@@ -728,8 +728,11 @@ assegments_parse (struct stream *s, size_t length, int use32bit)
if ( ((bytes + seg_size) > length)
/* 1771bis 4.3b: seg length contains one or more */
|| (segh.length == 0)
- /* Paranoia in case someone changes type of segment length */
- || ((sizeof segh.length > 1) && (segh.length > AS_SEGMENT_MAX)) )
+ /* Paranoia in case someone changes type of segment length.
+ * Shift both values by 0x10 to make the comparison operate
+ * on more, than 8 bits (otherwise it's a warning, bug #564).
+ */
+ || ((sizeof segh.length > 1) && (0x10 + segh.length > 0x10 + AS_SEGMENT_MAX)) )
{
if (head)
assegment_free_all (head);