summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorps <ps@FreeBSD.org>2001-03-14 23:53:25 +0000
committerps <ps@FreeBSD.org>2001-03-14 23:53:25 +0000
commitcbac3232d7d6ed6606b3884259212b089b452420 (patch)
treeddb109ee2d792773126d3b965f3790f5b9550dc4
parent749fdab956ac2f75abfce4bdc50eaa5dae0e2e17 (diff)
downloadFreeBSD-src-cbac3232d7d6ed6606b3884259212b089b452420.zip
FreeBSD-src-cbac3232d7d6ed6606b3884259212b089b452420.tar.gz
Don't set the gateway address if the netmask is zero or we're on
the same network. PXE does not do netmask calculations, so if the gateway is set it will use it. Submitted by: peter & FreeBSD cluster ACLs
-rw-r--r--sys/boot/i386/libi386/pxe.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/boot/i386/libi386/pxe.c b/sys/boot/i386/libi386/pxe.c
index 5cbf545..6e01a28 100644
--- a/sys/boot/i386/libi386/pxe.c
+++ b/sys/boot/i386/libi386/pxe.c
@@ -553,11 +553,15 @@ sendudp(struct iodesc *h, void *pkt, size_t len)
udpwrite_p->ip = h->destip.s_addr;
udpwrite_p->dst_port = h->destport;
udpwrite_p->src_port = h->myport;
- udpwrite_p->gw = gateip.s_addr;
udpwrite_p->buffer_size = len;
udpwrite_p->buffer.segment = VTOPSEG(pkt);
udpwrite_p->buffer.offset = VTOPOFF(pkt);
+ if (netmask == 0 || SAMENET(myip, h->destip, netmask))
+ udpwrite_p->gw = 0;
+ else
+ udpwrite_p->gw = gateip.s_addr;
+
pxe_call(PXENV_UDP_WRITE);
#if 0
OpenPOWER on IntegriCloud