2004-10-11 Paul Jakma <paul@dishone.st>
* (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.
diff --git a/ospfd/ospf_packet.c b/ospfd/ospf_packet.c
index d62a06e..dc1ee0b 100644
--- a/ospfd/ospf_packet.c
+++ b/ospfd/ospf_packet.c
@@ -241,7 +241,7 @@
return new;
}
-int
+unsigned int
ospf_packet_max (struct ospf_interface *oi)
{
int max;
@@ -261,7 +261,7 @@
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 @@
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 @@
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 @@
struct in_addr adv_router;
struct ospf_lsa *find;
struct list *ls_upd;
- int length;
+ unsigned int length;
/* Increment statistics. */
oi->ls_req_in++;