2005-10-11 Paul Jakma <paul.jakma@sun.com>

* ospf_api.c: sign warnings.
	* ospf_apiserver.c: sign warning and convert all the struct
	  in_addr initialisations so as not to make assumptions about
	  how this struct is organised, initialise the s_addr member
	  explicitely.
	* ospf_packet.c: Add const qualifier to auth_key.
This commit is contained in:
paul 2005-10-11 04:12:54 +00:00
parent d751f00299
commit 3623814abc
4 changed files with 32 additions and 23 deletions

View File

@ -1,3 +1,12 @@
2005-10-11 Paul Jakma <paul.jakma@sun.com>
* ospf_api.c: sign warnings.
* ospf_apiserver.c: sign warning and convert all the struct
in_addr initialisations so as not to make assumptions about
how this struct is organised, initialise the s_addr member
explicitely.
* ospf_packet.c: Add const qualifier to auth_key.
2005-10-06 Alain Ritoux <alain.ritoux@6wind.com> 2005-10-06 Alain Ritoux <alain.ritoux@6wind.com>
* ospf_snmp.c: Avoid mixing interface and ospf_interface objects * ospf_snmp.c: Avoid mixing interface and ospf_interface objects

View File

@ -350,12 +350,12 @@ msg_read (int fd)
{ {
struct msg *msg; struct msg *msg;
struct apimsghdr hdr; struct apimsghdr hdr;
char buf[OSPF_API_MAX_MSG_SIZE]; u_char buf[OSPF_API_MAX_MSG_SIZE];
int bodylen; int bodylen;
int rlen; int rlen;
/* Read message header */ /* Read message header */
rlen = readn (fd, (char *) &hdr, sizeof (struct apimsghdr)); rlen = readn (fd, (u_char *) &hdr, sizeof (struct apimsghdr));
if (rlen < 0) if (rlen < 0)
{ {

View File

@ -660,7 +660,7 @@ ospf_apiserver_accept (struct thread *thread)
struct ospf_apiserver *apiserv; struct ospf_apiserver *apiserv;
struct sockaddr_in peer_async; struct sockaddr_in peer_async;
struct sockaddr_in peer_sync; struct sockaddr_in peer_sync;
int peerlen; unsigned int peerlen;
int ret; int ret;
/* THREAD_ARG (thread) is NULL */ /* THREAD_ARG (thread) is NULL */
@ -1174,7 +1174,7 @@ ospf_apiserver_notify_ready_type11 (struct ospf_apiserver *apiserv)
for (ALL_LIST_ELEMENTS (apiserv->opaque_types, node, nnode, r)) for (ALL_LIST_ELEMENTS (apiserv->opaque_types, node, nnode, r))
{ {
struct msg *msg; struct msg *msg;
struct in_addr noarea_id = { 0L }; struct in_addr noarea_id = { .s_addr = 0L };
if (r->lsa_type == OSPF_OPAQUE_AS_LSA) if (r->lsa_type == OSPF_OPAQUE_AS_LSA)
{ {
@ -1296,10 +1296,10 @@ apiserver_sync_callback (struct ospf_lsa *lsa, void *p_arg, int int_arg)
{ {
/* Default area for AS-External and Opaque11 LSAs */ /* Default area for AS-External and Opaque11 LSAs */
struct in_addr area_id = { 0L }; struct in_addr area_id = { .s_addr = 0L };
/* Default interface for non Opaque9 LSAs */ /* Default interface for non Opaque9 LSAs */
struct in_addr ifaddr = { 0L }; struct in_addr ifaddr = { .s_addr = 0L };;
if (lsa->area) if (lsa->area)
{ {
@ -2356,7 +2356,7 @@ ospf_apiserver_clients_notify_ready_type11 (struct ospf *top)
{ {
struct listnode *node, *nnode; struct listnode *node, *nnode;
struct msg *msg; struct msg *msg;
struct in_addr id_null = { 0L }; struct in_addr id_null = { .s_addr = 0L };
struct ospf_apiserver *apiserv; struct ospf_apiserver *apiserv;
assert (top); assert (top);
@ -2429,8 +2429,8 @@ void
ospf_apiserver_clients_notify_ism_change (struct ospf_interface *oi) ospf_apiserver_clients_notify_ism_change (struct ospf_interface *oi)
{ {
struct msg *msg; struct msg *msg;
struct in_addr ifaddr = { 0L }; struct in_addr ifaddr = { .s_addr = 0L };
struct in_addr area_id = { 0L }; struct in_addr area_id = { .s_addr = 0L };
assert (oi); assert (oi);
assert (oi->ifp); assert (oi->ifp);
@ -2459,8 +2459,8 @@ void
ospf_apiserver_clients_notify_nsm_change (struct ospf_neighbor *nbr) ospf_apiserver_clients_notify_nsm_change (struct ospf_neighbor *nbr)
{ {
struct msg *msg; struct msg *msg;
struct in_addr ifaddr = { 0L }; struct in_addr ifaddr = { .s_addr = 0L };
struct in_addr nbraddr = { 0L }; struct in_addr nbraddr = { .s_addr = 0L };
assert (nbr); assert (nbr);
@ -2490,10 +2490,10 @@ apiserver_clients_lsa_change_notify (u_char msgtype, struct ospf_lsa *lsa)
struct ospf_apiserver *apiserv; struct ospf_apiserver *apiserv;
/* Default area for AS-External and Opaque11 LSAs */ /* Default area for AS-External and Opaque11 LSAs */
struct in_addr area_id = { 0L }; struct in_addr area_id = { .s_addr = 0L };
/* Default interface for non Opaque9 LSAs */ /* Default interface for non Opaque9 LSAs */
struct in_addr ifaddr = { 0L }; struct in_addr ifaddr = { .s_addr = 0L };
if (lsa->area) if (lsa->area)
{ {
@ -2588,10 +2588,10 @@ apiserver_notify_clients_lsa (u_char msgtype, struct ospf_lsa *lsa)
{ {
struct msg *msg; struct msg *msg;
/* default area for AS-External and Opaque11 LSAs */ /* default area for AS-External and Opaque11 LSAs */
struct in_addr area_id = { 0L }; struct in_addr area_id = { .s_addr = 0L };
/* default interface for non Opaque9 LSAs */ /* default interface for non Opaque9 LSAs */
struct in_addr ifaddr = { 0L }; struct in_addr ifaddr = { .s_addr = 0L };
/* Only notify this update if the LSA's age is smaller than /* Only notify this update if the LSA's age is smaller than
MAXAGE. Otherwise clients would see LSA updates with max age just MAXAGE. Otherwise clients would see LSA updates with max age just

View File

@ -329,7 +329,7 @@ ospf_make_md5_digest (struct ospf_interface *oi, struct ospf_packet *op)
void *ibuf; void *ibuf;
u_int32_t t; u_int32_t t;
struct crypt_key *ck; struct crypt_key *ck;
const char *auth_key; const u_int8_t *auth_key;
ibuf = STREAM_DATA (op->s); ibuf = STREAM_DATA (op->s);
ospfh = (struct ospf_header *) ibuf; ospfh = (struct ospf_header *) ibuf;
@ -345,7 +345,7 @@ ospf_make_md5_digest (struct ospf_interface *oi, struct ospf_packet *op)
/* Get MD5 Authentication key from auth_key list. */ /* Get MD5 Authentication key from auth_key list. */
if (list_isempty (OSPF_IF_PARAM (oi, auth_crypt))) if (list_isempty (OSPF_IF_PARAM (oi, auth_crypt)))
auth_key = ""; auth_key = (const u_int8_t *) "";
else else
{ {
ck = listgetdata (listtail(OSPF_IF_PARAM (oi, auth_crypt))); ck = listgetdata (listtail(OSPF_IF_PARAM (oi, auth_crypt)));