summaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorPeter Hessler <phessler@cvs.openbsd.org>2018-04-28 07:45:48 +0000
committerPeter Hessler <phessler@cvs.openbsd.org>2018-04-28 07:45:48 +0000
commit03ef73900f308a495a31922d643bdd0318e03c81 (patch)
tree298c529570d308c2d02fffe733684976f382033f /sys/net
parent2d0986da26aeb1388449be262d02449fa58adf3e (diff)
use unsigned variables for things that we use as unsigned
noticed by clang
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/bfd.c6
-rw-r--r--sys/net/bfd.h30
2 files changed, 18 insertions, 18 deletions
diff --git a/sys/net/bfd.c b/sys/net/bfd.c
index 52bd4388826..eebb69bfbcf 100644
--- a/sys/net/bfd.c
+++ b/sys/net/bfd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bfd.c,v 1.66 2018/04/28 07:44:44 phessler Exp $ */
+/* $OpenBSD: bfd.c,v 1.67 2018/04/28 07:45:47 phessler Exp $ */
/*
* Copyright (c) 2016 Peter Hessler <phessler@openbsd.org>
@@ -149,7 +149,7 @@ void bfddestroy(void);
struct socket *bfd_listener(struct bfd_config *, unsigned int);
struct socket *bfd_sender(struct bfd_config *, unsigned int);
void bfd_input(struct bfd_config *, struct mbuf *);
-void bfd_set_state(struct bfd_config *, int);
+void bfd_set_state(struct bfd_config *, unsigned int);
int bfd_send(struct bfd_config *, struct mbuf *);
void bfd_send_control(void *);
@@ -904,7 +904,7 @@ bfd_input(struct bfd_config *bfd, struct mbuf *m)
}
void
-bfd_set_state(struct bfd_config *bfd, int state)
+bfd_set_state(struct bfd_config *bfd, unsigned int state)
{
struct ifnet *ifp;
struct rtentry *rt = bfd->bc_rt;
diff --git a/sys/net/bfd.h b/sys/net/bfd.h
index 550675e12ff..3e8da45086f 100644
--- a/sys/net/bfd.h
+++ b/sys/net/bfd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: bfd.h,v 1.12 2017/03/10 02:12:46 phessler Exp $ */
+/* $OpenBSD: bfd.h,v 1.13 2018/04/28 07:45:47 phessler Exp $ */
/*
* Copyright (c) 2016 Peter Hessler <phessler@openbsd.org>
@@ -77,10 +77,10 @@ struct sockaddr_bfd {
uint16_t bs_multiplier;
uint16_t bs_pad0;
- int bs_state;
- int bs_remotestate;
- int bs_laststate;
- int bs_error;
+ unsigned int bs_state;
+ unsigned int bs_remotestate;
+ unsigned int bs_laststate;
+ unsigned int bs_error;
/* add padding to reach a power of two */
uint64_t bs_pad1;
@@ -118,11 +118,11 @@ struct bfd_neighbor {
uint32_t bn_rminrx; /* RemoteMinRxInterval */
uint32_t bn_demand; /* DemandMode */
uint32_t bn_rdemand; /* RemoteDemandMode */
- uint32_t bn_mult; /* DetectMult */
uint32_t bn_authtype; /* AuthType */
uint32_t bn_rauthseq; /* RcvAuthSeq */
uint32_t bn_lauthseq; /* XmitAuthSeq */
uint32_t bn_authseqknown; /* AuthSeqKnown */
+ uint16_t bn_mult; /* DetectMult */
};
struct bfd_config {
@@ -141,15 +141,15 @@ struct bfd_config {
struct timeout bc_timo_rx;
struct timeout bc_timo_tx;
time_t bc_lastuptime;
- int bc_laststate;
- int bc_state;
- int bc_mode;
- int bc_poll;
- int bc_error;
- int bc_minrx;
- int bc_mintx;
- int bc_minecho;
- int bc_multiplier;
+ unsigned int bc_laststate;
+ unsigned int bc_state;
+ unsigned int bc_poll;
+ unsigned int bc_error;
+ uint32_t bc_minrx;
+ uint32_t bc_mintx;
+ uint32_t bc_minecho;
+ uint16_t bc_multiplier;
+ uint16_t bc_mode;
};
struct sockaddr *bfd2sa(struct rtentry *, struct sockaddr_bfd *);