From de50ed921517ebbc58036c7d1ec591f3f5ab83b8 Mon Sep 17 00:00:00 2001 From: claudio Date: Sat, 24 Oct 2015 08:00:42 +0000 Subject: [PATCH] seg_type is only set but never used. So remove it. Someone reported this long time ago. --- usr.sbin/bgpd/rde_attr.c | 8 +++----- usr.sbin/bgpd/util.c | 6 ++---- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/usr.sbin/bgpd/rde_attr.c b/usr.sbin/bgpd/rde_attr.c index b69ff0c534b..5aa4f02bb45 100644 --- a/usr.sbin/bgpd/rde_attr.c +++ b/usr.sbin/bgpd/rde_attr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde_attr.c,v 1.94 2015/08/30 23:20:43 deraadt Exp $ */ +/* $OpenBSD: rde_attr.c,v 1.95 2015/10/24 08:00:42 claudio Exp $ */ /* * Copyright (c) 2004 Claudio Jeker @@ -801,11 +801,10 @@ aspath_loopfree(struct aspath *aspath, u_int32_t myAS) { u_int8_t *seg; u_int16_t len, seg_size; - u_int8_t i, seg_len, seg_type; + u_int8_t i, seg_len; seg = aspath->data; for (len = aspath->len; len > 0; len -= seg_size, seg += seg_size) { - seg_type = seg[0]; seg_len = seg[1]; seg_size = 2 + sizeof(u_int32_t) * seg_len; @@ -939,7 +938,7 @@ aspath_lenmatch(struct aspath *a, enum aslen_spec type, u_int aslen) u_int32_t as, lastas = 0; u_int count = 0; u_int16_t len, seg_size; - u_int8_t i, seg_type, seg_len; + u_int8_t i, seg_len; if (type == ASLEN_MAX) { if (aslen < aspath_count(a->data, a->len)) @@ -951,7 +950,6 @@ aspath_lenmatch(struct aspath *a, enum aslen_spec type, u_int aslen) /* type == ASLEN_SEQ */ seg = a->data; for (len = a->len; len > 0; len -= seg_size, seg += seg_size) { - seg_type = seg[0]; seg_len = seg[1]; seg_size = 2 + sizeof(u_int32_t) * seg_len; diff --git a/usr.sbin/bgpd/util.c b/usr.sbin/bgpd/util.c index 2b5c02e9962..61af75968ae 100644 --- a/usr.sbin/bgpd/util.c +++ b/usr.sbin/bgpd/util.c @@ -1,4 +1,4 @@ -/* $OpenBSD: util.c,v 1.19 2014/11/11 08:02:09 claudio Exp $ */ +/* $OpenBSD: util.c,v 1.20 2015/10/24 08:00:42 claudio Exp $ */ /* * Copyright (c) 2006 Claudio Jeker @@ -312,7 +312,7 @@ aspath_match(void *data, u_int16_t len, enum as_spec type, u_int32_t as) u_int8_t *seg; int final; u_int16_t seg_size; - u_int8_t i, seg_type, seg_len; + u_int8_t i, seg_len; if (type == AS_EMPTY) { if (len == 0) @@ -321,10 +321,8 @@ aspath_match(void *data, u_int16_t len, enum as_spec type, u_int32_t as) return (0); } - final = 0; seg = data; for (; len > 0; len -= seg_size, seg += seg_size) { - seg_type = seg[0]; seg_len = seg[1]; seg_size = 2 + sizeof(u_int32_t) * seg_len; -- 2.20.1