From 6c83567192ada1a66822c3f35580ce6a85f51ac9 Mon Sep 17 00:00:00 2001 From: paul Date: Mon, 11 Oct 2004 11:00:30 +0000 Subject: 2004-10-11 Paul Jakma * (global) Const char update and signed/unsigned fixes. * (various headers) size defines should be unsigned. * ospf_interface.h: remove duplicated defines, include the authoritative header - though, these defines should probably be moved to a dedicated header, or ospfd.h. * ospf_lsa.h: (struct lsa) ls_seqnum should be unsigned. * ospf_packet.c: (ospf_write) cast result of shift to unsigned. --- ospfd/ospf_packet.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'ospfd/ospf_packet.c') diff --git a/ospfd/ospf_packet.c b/ospfd/ospf_packet.c index d62a06ed..dc1ee0ba 100644 --- a/ospfd/ospf_packet.c +++ b/ospfd/ospf_packet.c @@ -241,7 +241,7 @@ ospf_packet_dup (struct ospf_packet *op) return new; } -int +unsigned int ospf_packet_max (struct ospf_interface *oi) { int max; @@ -261,7 +261,7 @@ int ospf_check_md5_digest (struct ospf_interface *oi, struct stream *s, u_int16_t length) { - void *ibuf; + unsigned char *ibuf; struct md5_ctx ctx; unsigned char digest[OSPF_AUTH_MD5_SIZE]; unsigned char *pdigest; @@ -486,7 +486,8 @@ ospf_ls_ack_timer (struct thread *thread) void ospf_write_frags (int fd, struct ospf_packet *op, struct ip *iph, struct msghdr *msg, struct iovec **iov, - int maxdatasize, int mtu, int flags) + unsigned int maxdatasize, + unsigned int mtu, int flags) { #define OSPF_WRITE_FRAG_SHIFT 3 u_int16_t offset; @@ -617,7 +618,8 @@ ospf_write (struct thread *thread) iph.ip_hl = sizeof (struct ip) >> OSPF_WRITE_IPHL_SHIFT; /* it'd be very strange for header to not be 4byte-word aligned but.. */ - if ( sizeof (struct ip) > (iph.ip_hl << OSPF_WRITE_IPHL_SHIFT) ) + if ( sizeof (struct ip) + > (unsigned int)(iph.ip_hl << OSPF_WRITE_IPHL_SHIFT) ) iph.ip_hl++; /* we presume sizeof struct ip cant overflow ip_hl.. */ iph.ip_v = IPVERSION; @@ -1326,7 +1328,7 @@ ospf_ls_req (struct ip *iph, struct ospf_header *ospfh, struct in_addr adv_router; struct ospf_lsa *find; struct list *ls_upd; - int length; + unsigned int length; /* Increment statistics. */ oi->ls_req_in++; -- cgit v1.2.1