1998-02-16 14:10:54 +03:00
|
|
|
/* $NetBSD: bootp.c,v 1.14 1998/02/16 11:10:54 drochner Exp $ */
|
1994-10-26 08:44:32 +03:00
|
|
|
|
1994-05-08 20:11:14 +04:00
|
|
|
/*
|
|
|
|
* Copyright (c) 1992 Regents of the University of California.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* This software was developed by the Computer Systems Engineering group
|
|
|
|
* at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
|
|
|
|
* contributed to Berkeley.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
* 3. All advertising materials mentioning features or use of this software
|
|
|
|
* must display the following acknowledgement:
|
|
|
|
* This product includes software developed by the University of
|
|
|
|
* California, Lawrence Berkeley Laboratory and its contributors.
|
|
|
|
* 4. Neither the name of the University nor the names of its contributors
|
|
|
|
* may be used to endorse or promote products derived from this software
|
|
|
|
* without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*
|
1994-10-26 08:44:32 +03:00
|
|
|
* @(#) Header: bootp.c,v 1.4 93/09/11 03:13:51 leres Exp (LBL)
|
1994-05-08 20:11:14 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <netinet/in.h>
|
|
|
|
#include <netinet/in_systm.h>
|
|
|
|
|
1997-06-26 23:11:30 +04:00
|
|
|
#ifdef _STANDALONE
|
|
|
|
#include <lib/libkern/libkern.h>
|
|
|
|
#else
|
1994-05-08 20:11:14 +04:00
|
|
|
#include <string.h>
|
1997-06-26 23:11:30 +04:00
|
|
|
#endif
|
1994-05-08 20:11:14 +04:00
|
|
|
|
|
|
|
#include "stand.h"
|
|
|
|
#include "net.h"
|
|
|
|
#include "netif.h"
|
|
|
|
#include "bootp.h"
|
|
|
|
|
1997-09-17 20:25:29 +04:00
|
|
|
struct in_addr servip;
|
|
|
|
|
1994-05-08 20:11:14 +04:00
|
|
|
static n_long nmask, smask;
|
|
|
|
|
|
|
|
static time_t bot;
|
|
|
|
|
|
|
|
static char vm_rfc1048[4] = VM_RFC1048;
|
1997-09-06 17:55:56 +04:00
|
|
|
#ifdef BOOTP_VEND_CMU
|
1994-05-08 20:11:14 +04:00
|
|
|
static char vm_cmu[4] = VM_CMU;
|
1997-09-06 17:55:56 +04:00
|
|
|
#endif
|
1994-05-08 20:11:14 +04:00
|
|
|
|
|
|
|
/* Local forwards */
|
1995-09-15 03:45:21 +04:00
|
|
|
static ssize_t bootpsend __P((struct iodesc *, void *, size_t));
|
|
|
|
static ssize_t bootprecv __P((struct iodesc *, void *, size_t, time_t));
|
1997-09-06 17:55:56 +04:00
|
|
|
static int vend_rfc1048 __P((u_char *, u_int));
|
|
|
|
#ifdef BOOTP_VEND_CMU
|
1994-05-08 20:11:14 +04:00
|
|
|
static void vend_cmu __P((u_char *));
|
1997-09-06 17:55:56 +04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef SUPPORT_DHCP
|
|
|
|
static char expected_dhcpmsgtype = -1, dhcp_ok;
|
|
|
|
struct in_addr dhcp_serverip;
|
|
|
|
#endif
|
1994-05-08 20:11:14 +04:00
|
|
|
|
|
|
|
/* Fetch required bootp infomation */
|
|
|
|
void
|
|
|
|
bootp(sock)
|
|
|
|
int sock;
|
|
|
|
{
|
|
|
|
struct iodesc *d;
|
|
|
|
register struct bootp *bp;
|
|
|
|
struct {
|
|
|
|
u_char header[HEADER_SIZE];
|
|
|
|
struct bootp wbootp;
|
|
|
|
} wbuf;
|
1995-02-20 14:04:00 +03:00
|
|
|
struct {
|
|
|
|
u_char header[HEADER_SIZE];
|
|
|
|
struct bootp rbootp;
|
1994-05-08 20:11:14 +04:00
|
|
|
} rbuf;
|
|
|
|
|
|
|
|
#ifdef BOOTP_DEBUG
|
|
|
|
if (debug)
|
1996-10-13 06:28:58 +04:00
|
|
|
printf("bootp: socket=%d\n", sock);
|
1994-05-08 20:11:14 +04:00
|
|
|
#endif
|
|
|
|
if (!bot)
|
|
|
|
bot = getsecs();
|
|
|
|
|
|
|
|
if (!(d = socktodesc(sock))) {
|
1996-10-13 06:28:58 +04:00
|
|
|
printf("bootp: bad socket. %d\n", sock);
|
1994-05-08 20:11:14 +04:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
#ifdef BOOTP_DEBUG
|
|
|
|
if (debug)
|
1997-09-06 17:55:56 +04:00
|
|
|
printf("bootp: d=%lx\n", (long)d);
|
1994-05-08 20:11:14 +04:00
|
|
|
#endif
|
1995-02-21 13:14:53 +03:00
|
|
|
|
1994-05-08 20:11:14 +04:00
|
|
|
bp = &wbuf.wbootp;
|
|
|
|
bzero(bp, sizeof(*bp));
|
|
|
|
|
|
|
|
bp->bp_op = BOOTREQUEST;
|
|
|
|
bp->bp_htype = 1; /* 10Mb Ethernet (48 bits) */
|
|
|
|
bp->bp_hlen = 6;
|
1995-09-19 01:19:18 +04:00
|
|
|
bp->bp_xid = htonl(d->xid);
|
1994-05-08 20:11:14 +04:00
|
|
|
MACPY(d->myea, bp->bp_chaddr);
|
1997-09-06 17:55:56 +04:00
|
|
|
strncpy(bp->bp_file, bootfile, sizeof(bp->bp_file));
|
1995-02-21 13:14:53 +03:00
|
|
|
bcopy(vm_rfc1048, bp->bp_vend, sizeof(vm_rfc1048));
|
1997-09-06 17:55:56 +04:00
|
|
|
#ifdef SUPPORT_DHCP
|
|
|
|
bp->bp_vend[4] = TAG_DHCP_MSGTYPE;
|
|
|
|
bp->bp_vend[5] = 1;
|
|
|
|
bp->bp_vend[6] = DHCPDISCOVER;
|
|
|
|
bp->bp_vend[7] = TAG_END;
|
|
|
|
#else
|
|
|
|
bp->bp_vend[4] = TAG_END;
|
|
|
|
#endif
|
1994-05-08 20:11:14 +04:00
|
|
|
|
1998-02-16 14:10:54 +03:00
|
|
|
d->myip.s_addr = INADDR_ANY;
|
1995-09-19 01:19:18 +04:00
|
|
|
d->myport = htons(IPPORT_BOOTPC);
|
|
|
|
d->destip.s_addr = INADDR_BROADCAST;
|
|
|
|
d->destport = htons(IPPORT_BOOTPS);
|
1994-05-08 20:11:14 +04:00
|
|
|
|
1997-09-06 17:55:56 +04:00
|
|
|
#ifdef SUPPORT_DHCP
|
|
|
|
expected_dhcpmsgtype = DHCPOFFER;
|
|
|
|
dhcp_ok = 0;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
if(sendrecv(d,
|
|
|
|
bootpsend, bp, sizeof(*bp),
|
|
|
|
bootprecv, &rbuf.rbootp, sizeof(rbuf.rbootp))
|
|
|
|
== -1) {
|
|
|
|
printf("bootp: no reply\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef SUPPORT_DHCP
|
|
|
|
if(dhcp_ok) {
|
|
|
|
u_int32_t leasetime;
|
|
|
|
bp->bp_vend[6] = DHCPREQUEST;
|
|
|
|
bp->bp_vend[7] = TAG_REQ_ADDR;
|
|
|
|
bp->bp_vend[8] = 4;
|
|
|
|
bcopy(&rbuf.rbootp.bp_yiaddr, &bp->bp_vend[9], 4);
|
|
|
|
bp->bp_vend[13] = TAG_SERVERID;
|
|
|
|
bp->bp_vend[14] = 4;
|
|
|
|
bcopy(&dhcp_serverip.s_addr, &bp->bp_vend[15], 4);
|
|
|
|
bp->bp_vend[19] = TAG_LEASETIME;
|
|
|
|
bp->bp_vend[20] = 4;
|
|
|
|
leasetime = htonl(300);
|
|
|
|
bcopy(&leasetime, &bp->bp_vend[21], 4);
|
|
|
|
bp->bp_vend[25] = TAG_END;
|
|
|
|
|
|
|
|
expected_dhcpmsgtype = DHCPACK;
|
|
|
|
|
|
|
|
if(sendrecv(d,
|
|
|
|
bootpsend, bp, sizeof(*bp),
|
|
|
|
bootprecv, &rbuf.rbootp, sizeof(rbuf.rbootp))
|
|
|
|
== -1) {
|
|
|
|
printf("DHCPREQUEST failed\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
myip = d->myip = rbuf.rbootp.bp_yiaddr;
|
1997-09-17 20:25:29 +04:00
|
|
|
servip = rbuf.rbootp.bp_siaddr;
|
|
|
|
if(rootip.s_addr == INADDR_ANY) rootip = servip;
|
1997-09-06 17:55:56 +04:00
|
|
|
bcopy(rbuf.rbootp.bp_file, bootfile, sizeof(bootfile));
|
|
|
|
bootfile[sizeof(bootfile) - 1] = '\0';
|
|
|
|
|
|
|
|
if (IN_CLASSA(myip.s_addr))
|
|
|
|
nmask = IN_CLASSA_NET;
|
|
|
|
else if (IN_CLASSB(myip.s_addr))
|
|
|
|
nmask = IN_CLASSB_NET;
|
|
|
|
else
|
|
|
|
nmask = IN_CLASSC_NET;
|
|
|
|
#ifdef BOOTP_DEBUG
|
|
|
|
if (debug)
|
|
|
|
printf("'native netmask' is %s\n", intoa(nmask));
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Check subnet mask against net mask; toss if bogus */
|
|
|
|
if ((nmask & smask) != nmask) {
|
|
|
|
#ifdef BOOTP_DEBUG
|
|
|
|
if (debug)
|
|
|
|
printf("subnet mask (%s) bad\n", intoa(smask));
|
|
|
|
#endif
|
|
|
|
smask = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Get subnet (or natural net) mask */
|
|
|
|
netmask = nmask;
|
|
|
|
if (smask)
|
|
|
|
netmask = smask;
|
|
|
|
#ifdef BOOTP_DEBUG
|
|
|
|
if (debug)
|
|
|
|
printf("mask: %s\n", intoa(netmask));
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* We need a gateway if root is on a different net */
|
|
|
|
if (!SAMENET(myip, rootip, netmask)) {
|
|
|
|
#ifdef BOOTP_DEBUG
|
|
|
|
if (debug)
|
|
|
|
printf("need gateway for root ip\n");
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Toss gateway if on a different net */
|
|
|
|
if (!SAMENET(myip, gateip, netmask)) {
|
|
|
|
#ifdef BOOTP_DEBUG
|
|
|
|
if (debug)
|
|
|
|
printf("gateway ip (%s) bad\n", inet_ntoa(gateip));
|
|
|
|
#endif
|
|
|
|
gateip.s_addr = 0;
|
|
|
|
}
|
1995-02-21 13:14:53 +03:00
|
|
|
|
|
|
|
/* Bump xid so next request will be unique. */
|
|
|
|
++d->xid;
|
1994-05-08 20:11:14 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Transmit a bootp request */
|
1995-09-15 03:45:21 +04:00
|
|
|
static ssize_t
|
1994-05-08 20:11:14 +04:00
|
|
|
bootpsend(d, pkt, len)
|
|
|
|
register struct iodesc *d;
|
|
|
|
register void *pkt;
|
1995-02-20 14:04:00 +03:00
|
|
|
register size_t len;
|
1994-05-08 20:11:14 +04:00
|
|
|
{
|
|
|
|
register struct bootp *bp;
|
|
|
|
|
|
|
|
#ifdef BOOTP_DEBUG
|
|
|
|
if (debug)
|
1997-09-06 17:55:56 +04:00
|
|
|
printf("bootpsend: d=%lx called.\n", (long)d);
|
1994-05-08 20:11:14 +04:00
|
|
|
#endif
|
1995-02-20 14:04:00 +03:00
|
|
|
|
1994-05-08 20:11:14 +04:00
|
|
|
bp = pkt;
|
1995-09-19 01:19:18 +04:00
|
|
|
bp->bp_secs = htons((u_short)(getsecs() - bot));
|
1995-02-20 14:04:00 +03:00
|
|
|
|
1994-05-08 20:11:14 +04:00
|
|
|
#ifdef BOOTP_DEBUG
|
|
|
|
if (debug)
|
1996-10-13 06:28:58 +04:00
|
|
|
printf("bootpsend: calling sendudp\n");
|
1994-05-08 20:11:14 +04:00
|
|
|
#endif
|
1995-02-20 14:04:00 +03:00
|
|
|
|
1994-05-08 20:11:14 +04:00
|
|
|
return (sendudp(d, pkt, len));
|
|
|
|
}
|
|
|
|
|
1995-09-15 03:45:21 +04:00
|
|
|
static ssize_t
|
1995-02-20 14:04:00 +03:00
|
|
|
bootprecv(d, pkt, len, tleft)
|
1997-09-06 17:55:56 +04:00
|
|
|
register struct iodesc *d;
|
|
|
|
register void *pkt;
|
|
|
|
register size_t len;
|
|
|
|
time_t tleft;
|
1994-05-08 20:11:14 +04:00
|
|
|
{
|
1995-09-15 03:45:21 +04:00
|
|
|
register ssize_t n;
|
1994-05-08 20:11:14 +04:00
|
|
|
register struct bootp *bp;
|
|
|
|
|
1997-09-06 17:55:56 +04:00
|
|
|
#ifdef BOOTP_DEBUGx
|
1994-05-08 20:11:14 +04:00
|
|
|
if (debug)
|
1997-09-06 17:55:56 +04:00
|
|
|
printf("bootp_recvoffer: called\n");
|
1994-05-08 20:11:14 +04:00
|
|
|
#endif
|
1995-02-20 14:04:00 +03:00
|
|
|
|
1995-09-15 03:45:21 +04:00
|
|
|
n = readudp(d, pkt, len, tleft);
|
1997-09-06 17:55:56 +04:00
|
|
|
if (n == -1 || n < sizeof(struct bootp) - BOOTP_VENDSIZE)
|
1995-02-20 14:04:00 +03:00
|
|
|
goto bad;
|
|
|
|
|
|
|
|
bp = (struct bootp *)pkt;
|
1997-09-06 17:55:56 +04:00
|
|
|
|
1994-05-08 20:11:14 +04:00
|
|
|
#ifdef BOOTP_DEBUG
|
|
|
|
if (debug)
|
1997-09-06 17:55:56 +04:00
|
|
|
printf("bootprecv: checked. bp = 0x%lx, n = %d\n",
|
|
|
|
(long)bp, (int)n);
|
1994-05-08 20:11:14 +04:00
|
|
|
#endif
|
1995-09-19 01:19:18 +04:00
|
|
|
if (bp->bp_xid != htonl(d->xid)) {
|
1994-05-08 20:11:14 +04:00
|
|
|
#ifdef BOOTP_DEBUG
|
|
|
|
if (debug) {
|
1997-09-06 17:55:56 +04:00
|
|
|
printf("bootprecv: expected xid 0x%lx, got 0x%x\n",
|
1995-09-19 01:19:18 +04:00
|
|
|
d->xid, ntohl(bp->bp_xid));
|
1994-05-08 20:11:14 +04:00
|
|
|
}
|
|
|
|
#endif
|
1995-02-20 14:04:00 +03:00
|
|
|
goto bad;
|
1994-05-08 20:11:14 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef BOOTP_DEBUG
|
|
|
|
if (debug)
|
1996-10-13 06:28:58 +04:00
|
|
|
printf("bootprecv: got one!\n");
|
1994-05-08 20:11:14 +04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Suck out vendor info */
|
1997-09-06 17:55:56 +04:00
|
|
|
if (bcmp(vm_rfc1048, bp->bp_vend, sizeof(vm_rfc1048)) == 0) {
|
|
|
|
if(vend_rfc1048(bp->bp_vend, sizeof(bp->bp_vend)) != 0)
|
|
|
|
goto bad;
|
|
|
|
}
|
|
|
|
#ifdef BOOTP_VEND_CMU
|
|
|
|
else if (bcmp(vm_cmu, bp->bp_vend, sizeof(vm_cmu)) == 0)
|
1994-05-08 20:11:14 +04:00
|
|
|
vend_cmu(bp->bp_vend);
|
1997-09-06 17:55:56 +04:00
|
|
|
#endif
|
1994-05-08 20:11:14 +04:00
|
|
|
else
|
1996-10-13 06:28:58 +04:00
|
|
|
printf("bootprecv: unknown vendor 0x%lx\n", (long)bp->bp_vend);
|
1994-05-08 20:11:14 +04:00
|
|
|
|
1997-09-06 17:55:56 +04:00
|
|
|
return(n);
|
1995-02-20 14:04:00 +03:00
|
|
|
bad:
|
|
|
|
errno = 0;
|
|
|
|
return (-1);
|
1994-05-08 20:11:14 +04:00
|
|
|
}
|
|
|
|
|
1997-09-06 17:55:56 +04:00
|
|
|
static int
|
1994-05-08 20:11:14 +04:00
|
|
|
vend_rfc1048(cp, len)
|
|
|
|
register u_char *cp;
|
|
|
|
u_int len;
|
|
|
|
{
|
|
|
|
register u_char *ep;
|
|
|
|
register int size;
|
|
|
|
register u_char tag;
|
|
|
|
|
|
|
|
#ifdef BOOTP_DEBUG
|
|
|
|
if (debug)
|
1996-10-13 06:28:58 +04:00
|
|
|
printf("vend_rfc1048 bootp info. len=%d\n", len);
|
1994-05-08 20:11:14 +04:00
|
|
|
#endif
|
|
|
|
ep = cp + len;
|
|
|
|
|
|
|
|
/* Step over magic cookie */
|
1996-09-27 03:22:01 +04:00
|
|
|
cp += sizeof(int);
|
1994-05-08 20:11:14 +04:00
|
|
|
|
|
|
|
while (cp < ep) {
|
|
|
|
tag = *cp++;
|
|
|
|
size = *cp++;
|
|
|
|
if (tag == TAG_END)
|
|
|
|
break;
|
|
|
|
|
|
|
|
if (tag == TAG_SUBNET_MASK) {
|
|
|
|
bcopy(cp, &smask, sizeof(smask));
|
|
|
|
}
|
|
|
|
if (tag == TAG_GATEWAY) {
|
1995-09-19 01:19:18 +04:00
|
|
|
bcopy(cp, &gateip.s_addr, sizeof(gateip.s_addr));
|
1994-05-08 20:11:14 +04:00
|
|
|
}
|
|
|
|
if (tag == TAG_SWAPSERVER) {
|
1997-09-06 17:55:56 +04:00
|
|
|
/* let it override bp_siaddr */
|
|
|
|
bcopy(cp, &rootip.s_addr, sizeof(swapip.s_addr));
|
1994-05-08 20:11:14 +04:00
|
|
|
}
|
|
|
|
if (tag == TAG_ROOTPATH) {
|
1995-09-19 01:19:18 +04:00
|
|
|
strncpy(rootpath, (char *)cp, sizeof(rootpath));
|
1994-05-08 20:11:14 +04:00
|
|
|
rootpath[size] = '\0';
|
|
|
|
}
|
|
|
|
if (tag == TAG_HOSTNAME) {
|
1995-09-19 01:19:18 +04:00
|
|
|
strncpy(hostname, (char *)cp, sizeof(hostname));
|
1994-05-08 20:11:14 +04:00
|
|
|
hostname[size] = '\0';
|
|
|
|
}
|
1997-09-06 17:55:56 +04:00
|
|
|
#ifdef SUPPORT_DHCP
|
|
|
|
if (tag == TAG_DHCP_MSGTYPE) {
|
|
|
|
if(*cp != expected_dhcpmsgtype)
|
|
|
|
return(-1);
|
|
|
|
dhcp_ok = 1;
|
|
|
|
}
|
|
|
|
if (tag == TAG_SERVERID) {
|
|
|
|
bcopy(cp, &dhcp_serverip.s_addr,
|
|
|
|
sizeof(dhcp_serverip.s_addr));
|
1994-05-08 20:11:14 +04:00
|
|
|
}
|
1997-09-06 17:55:56 +04:00
|
|
|
#endif
|
1994-05-08 20:11:14 +04:00
|
|
|
cp += size;
|
|
|
|
}
|
1997-09-06 17:55:56 +04:00
|
|
|
return(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef BOOTP_VEND_CMU
|
|
|
|
static void
|
|
|
|
vend_cmu(cp)
|
|
|
|
u_char *cp;
|
|
|
|
{
|
|
|
|
register struct cmu_vend *vp;
|
|
|
|
|
|
|
|
#ifdef BOOTP_DEBUG
|
|
|
|
if (debug)
|
|
|
|
printf("vend_cmu bootp info.\n");
|
|
|
|
#endif
|
|
|
|
vp = (struct cmu_vend *)cp;
|
|
|
|
|
|
|
|
if (vp->v_smask.s_addr != 0) {
|
|
|
|
smask = vp->v_smask.s_addr;
|
|
|
|
}
|
|
|
|
if (vp->v_dgate.s_addr != 0) {
|
|
|
|
gateip = vp->v_dgate;
|
|
|
|
}
|
1994-05-08 20:11:14 +04:00
|
|
|
}
|
1997-09-06 17:55:56 +04:00
|
|
|
#endif
|