*** server/dhcps.c.orig	Sun Jul 19 09:16:53 1998
--- server/dhcps.c	Mon Aug 17 17:57:24 1998
***************
*** 136,142 ****
  int  nmacaddr;
  #endif
  
! void
  main(argc, argv)
    int argc;
    char **argv;
--- 136,142 ----
  int  nmacaddr;
  #endif
  
! int
  main(argc, argv)
    int argc;
    char **argv;
***************
*** 146,152 ****
    struct if_info *ifp = NULL;          /* pointer to interface */
    char *option = NULL;                 /* command line option */
    char msgtype;                        /* DHCP message type */
!   struct sockaddr_in my_addr, any_addr;
    struct ifreq ifreq;
  
    bzero(&ifreq, sizeof(ifreq));
--- 146,152 ----
    struct if_info *ifp = NULL;          /* pointer to interface */
    char *option = NULL;                 /* command line option */
    char msgtype;                        /* DHCP message type */
!   struct sockaddr_in my_addr;
    struct ifreq ifreq;
  
    bzero(&ifreq, sizeof(ifreq));
***************
*** 228,236 ****
--- 228,246 ----
  #define LOG_PERROR	0	/* Don't bother if not defined... */
  #endif
    if (debug == 1) {
+ #ifndef __OpenBSD__
      openlog("dhcps", LOG_PID | LOG_CONS | LOG_PERROR, LOG_LOCAL0);
+ #else
+     /* Using LOG_LOCAL1 to avoid OpenBSD ipmon log conflict */
+     openlog("dhcps", LOG_PID | LOG_CONS | LOG_PERROR, LOG_LOCAL1);
+ #endif
    } else {
+ #ifndef __OpenBSD__
      openlog("dhcps", LOG_PID | LOG_CONS, LOG_LOCAL0);
+ #else
+     /* Using LOG_LOCAL1 to avoid OpenBSD ipmon log conflict */
+     openlog("dhcps", LOG_PID | LOG_CONS, LOG_LOCAL1);
+ #endif
    }
  
    init_db();               /* initialize databases */
***************
*** 1921,1927 ****
--- 1931,1941 ----
      snd.dhcp->options[off_options] = END;
    } else if (off_extopt > 0 && off_extopt < maxoptlen - DFLTOPTLEN &&
  	     sbufvec[1].iov_base != NULL) {
+ #ifndef __OpenBSD__
      sbufvec[1].iov_base[off_extopt++] = END;
+ #else
+     *((char *)sbufvec[1].iov_base + off_extopt++) = END;
+ #endif
    }
  
    if (off_extopt < sbufvec[1].iov_len) {
***************
*** 2378,2384 ****
--- 2392,2402 ----
    char *inserted;
    char flag;
  {
+ #ifdef __OpenBSD__
+   u_int32_t *addr = 0;
+ #else
    u_Long *addr = 0;
+ #endif
    char option[6];
    int symbol = 0;
    int retval = 0;
***************
*** 2939,2945 ****
--- 2957,2967 ----
        len -= done;
        off_options += done; /* invalid offset, So, to access
  					    here will cause fatal error */
+ #ifndef __OpenBSD__
        bcopy(&opt[done], &sbufvec[1].iov_base[off_extopt], len);
+ #else
+       bcopy(&opt[done], (char *)sbufvec[1].iov_base + off_extopt, len);
+ #endif
        off_extopt += len;
        return(0);
      }
***************
*** 3016,3022 ****
      return(GOOD);
    }
  
! #if defined(__bsdi__) || (__FreeBSD__ >= 2)
    delarp(ip);
  #else
    delarp(ip, sockfd);
--- 3038,3044 ----
      return(GOOD);
    }
  
! #if defined(__bsdi__) || (__FreeBSD__ >= 2) || defined(__OpenBSD__)
    delarp(ip);
  #else
    delarp(ip, sockfd);
