From 68defd6ddbc840f4877a817dd651a243a398049d Mon Sep 17 00:00:00 2001 From: paul Date: Mon, 27 Sep 2004 07:27:13 +0000 Subject: 2004-09-27 Paul Jakma * ospf_packet.c: (ospf_write) (struct msghdr).msg_name is caddr_t on most platforms. (ospf_recv_packet) ditto. And msg_flags is not always there memset struct then set fields we care about rather than initialise all fields individually. --- ospfd/ChangeLog | 8 ++++++++ ospfd/ospf_packet.c | 6 ++---- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'ospfd') diff --git a/ospfd/ChangeLog b/ospfd/ChangeLog index 8423cab0..3724e360 100644 --- a/ospfd/ChangeLog +++ b/ospfd/ChangeLog @@ -1,3 +1,11 @@ +2004-09-27 Paul Jakma + + * ospf_packet.c: (ospf_write) (struct msghdr).msg_name is caddr_t + on most platforms. + (ospf_recv_packet) ditto. And msg_flags is not always there + memset struct then set fields we care about rather than + initialise all fields individually. + 2004-09-26 Hasso Tepper * ospf_abr.c, ospf_dump.c, ospf_lsa.c, ospf_packet.c, ospf_vty.c, diff --git a/ospfd/ospf_packet.c b/ospfd/ospf_packet.c index 67926fc3..c362b9fd 100644 --- a/ospfd/ospf_packet.c +++ b/ospfd/ospf_packet.c @@ -665,7 +665,7 @@ ospf_write (struct thread *thread) iph.ip_dst.s_addr = op->dst.s_addr; memset (&msg, 0, sizeof (msg)); - msg.msg_name = &sa_dst; + msg.msg_name = (caddr_t) &sa_dst; msg.msg_namelen = sizeof (sa_dst); msg.msg_iov = iov; msg.msg_iovlen = 2; @@ -2018,13 +2018,11 @@ ospf_recv_packet (int fd, struct interface **ifp) #endif struct msghdr msgh; - msgh.msg_name = NULL; - msgh.msg_namelen = 0; + memset (&msgh, 0, sizeof (struct msghdr)); msgh.msg_iov = &iov; msgh.msg_iovlen = 1; msgh.msg_control = (caddr_t) buff; msgh.msg_controllen = sizeof (buff); - msgh.msg_flags = 0; ret = recvfrom (fd, (void *)&iph, sizeof (iph), MSG_PEEK, NULL, 0); -- cgit v1.2.1