From 00fdbd21cc9d560643a7c72415c2d8e3a5947967 Mon Sep 17 00:00:00 2001 From: Guillaume Cottenceau Date: Thu, 8 Mar 2001 16:57:52 +0000 Subject: do not segfault in dhcp stuff, when af_packet is not honoured by kernel --- mdk-stage1/dhcp.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'mdk-stage1/dhcp.c') diff --git a/mdk-stage1/dhcp.c b/mdk-stage1/dhcp.c index 616d60f20..e2013994a 100644 --- a/mdk-stage1/dhcp.c +++ b/mdk-stage1/dhcp.c @@ -381,6 +381,10 @@ static int handle_transaction(int s, struct bootp_request * breq, struct bootp_r breq->secs = 0; sin = socket(AF_PACKET, SOCK_DGRAM, ntohs(ETH_P_IP)); + if (sin < 0) { + log_perror("af_packet socket"); + return -1; + } while (retry <= MAX_ARP_RETRIES) { i = sizeof(*breq); -- cgit v1.2.1