summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhenning <henning@openbsd.org>2003-12-20 15:09:07 +0000
committerhenning <henning@openbsd.org>2003-12-20 15:09:07 +0000
commit1eec7c2d25e451da76fe936102dffaf7bed3b93b (patch)
treedbef14b235bbc4ce3a05915758748274e34be9ff
parentreconf is an enum reconf_action, not int (diff)
downloadwireguard-openbsd-1eec7c2d25e451da76fe936102dffaf7bed3b93b.tar.xz
wireguard-openbsd-1eec7c2d25e451da76fe936102dffaf7bed3b93b.zip
formulate two comparisons sligthly different to prevent the left side from
becoming negative. this was logically impossible already but this way gcc has the chance to notice that as well. together with the last commit this makes bgod -Wsign-compare clean
-rw-r--r--usr.sbin/bgpd/rde.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/bgpd/rde.c b/usr.sbin/bgpd/rde.c
index e9b6388563a..9e10396c2d2 100644
--- a/usr.sbin/bgpd/rde.c
+++ b/usr.sbin/bgpd/rde.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde.c,v 1.10 2003/12/20 14:36:46 henning Exp $ */
+/* $OpenBSD: rde.c,v 1.11 2003/12/20 15:09:07 henning Exp $ */
/*
* Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
@@ -296,7 +296,7 @@ rde_update_dispatch(struct imsg *imsg)
memcpy(&len, p, 2);
withdrawn_len = ntohs(len);
p += 2;
- if (imsg->hdr.len - IMSG_HEADER_SIZE < 2 + withdrawn_len + 2) {
+ if (imsg->hdr.len < IMSG_HEADER_SIZE + 2 + withdrawn_len + 2) {
rde_update_err(peer->conf.id, ERR_UPD_ATTRLIST);
return (-1);
}
@@ -315,8 +315,8 @@ rde_update_dispatch(struct imsg *imsg)
memcpy(&len, p, 2);
attrpath_len = ntohs(len);
p += 2;
- if (imsg->hdr.len - IMSG_HEADER_SIZE <
- 2 + withdrawn_len + 2 + attrpath_len) {
+ if (imsg->hdr.len <
+ IMSG_HEADER_SIZE + 2 + withdrawn_len + 2 + attrpath_len) {
rde_update_err(peer->conf.id, ERR_UPD_ATTRLIST);
return (-1);
}