diff options
author | Jacek Masiulaniec <jacekm@cvs.openbsd.org> | 2010-02-01 10:22:07 +0000 |
---|---|---|
committer | Jacek Masiulaniec <jacekm@cvs.openbsd.org> | 2010-02-01 10:22:07 +0000 |
commit | 0b32db0c31d0365d28b6d8726e7596438b74d370 (patch) | |
tree | d4bdba09e61ddd7ccb05ae9d7cb73bc53d013f1a /usr.sbin | |
parent | 0b3e543aade4bf5bed93ea634da6fb56dd215276 (diff) |
Fix logic error (&& vs. ||), found while looking for inspiration for smtpd
state machine needed by the features that are coming along.
ok claudio@
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ospf6d/hello.c | 4 | ||||
-rw-r--r-- | usr.sbin/ospfd/hello.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/ospf6d/hello.c b/usr.sbin/ospf6d/hello.c index d9b2961ff67..becf70ee21d 100644 --- a/usr.sbin/ospf6d/hello.c +++ b/usr.sbin/ospf6d/hello.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hello.c,v 1.14 2009/03/29 16:24:38 stsp Exp $ */ +/* $OpenBSD: hello.c,v 1.15 2010/02/01 10:22:06 jacekm Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -125,7 +125,7 @@ recv_hello(struct iface *iface, struct in6_addr *src, u_int32_t rtr_id, u_int32_t nbr_id, opts; int nbr_change = 0; - if (len < sizeof(hello) && (len & 0x03)) { + if (len < sizeof(hello) || (len & 0x03)) { log_warnx("recv_hello: bad packet size, interface %s", iface->name); return; diff --git a/usr.sbin/ospfd/hello.c b/usr.sbin/ospfd/hello.c index f1be89ee8e5..d461102cf0e 100644 --- a/usr.sbin/ospfd/hello.c +++ b/usr.sbin/ospfd/hello.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hello.c,v 1.15 2009/01/31 08:55:00 claudio Exp $ */ +/* $OpenBSD: hello.c,v 1.16 2010/02/01 10:22:06 jacekm Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -122,7 +122,7 @@ recv_hello(struct iface *iface, struct in_addr src, u_int32_t rtr_id, char *buf, u_int32_t nbr_id; int nbr_change = 0; - if (len < sizeof(hello) && (len & 0x03)) { + if (len < sizeof(hello) || (len & 0x03)) { log_warnx("recv_hello: bad packet size, interface %s", iface->name); return; |