summaryrefslogtreecommitdiff
path: root/ospfd/ospf_packet.c
diff options
context:
space:
mode:
authorpaul <paul>2004-10-11 11:00:30 +0000
committerpaul <paul>2004-10-11 11:00:30 +0000
commit6c83567192ada1a66822c3f35580ce6a85f51ac9 (patch)
tree39ef09859fae79b7c7e234a671bf2e04f8e9264a /ospfd/ospf_packet.c
parent6b33361187feeb8c9c257ec149b4f75238af6c48 (diff)
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.
Diffstat (limited to 'ospfd/ospf_packet.c')
-rw-r--r--ospfd/ospf_packet.c12
1 files changed, 7 insertions, 5 deletions
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++;