openbsd-ports/net/netatalk/patches/patch-etcatalkd-routec
wilfried b8543e49b9 Fix the way in which the atalkd routing daemon handles startup with
repect to non-allowable zero appletalk zone range.
from maintainer
2001-03-19 13:50:01 +00:00

66 lines
1.7 KiB
Plaintext

$OpenBSD: patch-etcatalkd-routec,v 1.2 2001/03/19 13:50:01 wilfried Exp $
--- etc/atalkd/route.c.orig Sun Aug 17 09:20:18 1997
+++ etc/atalkd/route.c Fri Mar 16 15:23:59 2001
@@ -3,6 +3,8 @@
* All Rights Reserved. See COPYRIGHT.
*/
+#include <string.h>
+#include <unistd.h>
#include <sys/param.h>
#include <sys/types.h>
#include <sys/socket.h>
@@ -12,7 +14,7 @@
#include "rtmp.h"
-#if !defined (BSD4_4)
+#ifndef BSD4_4
route( message, dst, gate, flags )
int message;
struct sockaddr *dst, *gate;
@@ -20,7 +22,7 @@ route( message, dst, gate, flags )
{
struct rtentry rtent;
- bzero( &rtent, sizeof( struct rtentry ));
+ memset( &rtent, 0, sizeof( struct rtentry ));
rtent.rt_dst = *dst;
rtent.rt_gateway = *gate;
rtent.rt_flags = flags;
@@ -30,11 +32,12 @@ route( message, dst, gate, flags )
#else BSD4_4
struct sockaddr_m {
- u_char sam_len;
- u_char sam_family;
- u_short sam_pad;
- u_short sam_mask;
-} mask = { sizeof( struct sockaddr_m ), 0, 0, 0xffff };
+ u_int8_t sam_len;
+ u_int8_t sam_family;
+ u_int16_t sam_pad;
+ u_int16_t sam_mask;
+ u_int16_t sam_pad2;
+} mask = { sizeof( struct sockaddr_m ), 0, 0, 0xffff, 0 };
struct rt_msg_at {
struct rt_msghdr rtma_rtm;
@@ -43,6 +46,7 @@ struct rt_msg_at {
struct sockaddr_m rtma_mask;
} rtma;
+int
route( message, dst, gate, flags )
int message;
struct sockaddr_at *dst, *gate;
@@ -50,7 +54,7 @@ route( message, dst, gate, flags )
{
int rc;
- bzero( &rtma, sizeof( struct rt_msg_at ));
+ memset( &rtma, 0, sizeof( struct rt_msg_at ));
rtma.rtma_rtm.rtm_msglen = sizeof( struct rt_msg_at );
rtma.rtma_rtm.rtm_version = RTM_VERSION;
rtma.rtma_rtm.rtm_type = message;