summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2001-03-08 16:57:52 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2001-03-08 16:57:52 +0000
commit00fdbd21cc9d560643a7c72415c2d8e3a5947967 (patch)
tree5864213f3bfa6726c5d6023d8c3c0068b2222b46
parentdda1097710142aa02e6e81754b93959e245f6436 (diff)
downloaddrakx-backup-do-not-use-00fdbd21cc9d560643a7c72415c2d8e3a5947967.tar
drakx-backup-do-not-use-00fdbd21cc9d560643a7c72415c2d8e3a5947967.tar.gz
drakx-backup-do-not-use-00fdbd21cc9d560643a7c72415c2d8e3a5947967.tar.bz2
drakx-backup-do-not-use-00fdbd21cc9d560643a7c72415c2d8e3a5947967.tar.xz
drakx-backup-do-not-use-00fdbd21cc9d560643a7c72415c2d8e3a5947967.zip
do not segfault in dhcp stuff, when af_packet is not honoured by kernel
-rw-r--r--mdk-stage1/dhcp.c4
1 files changed, 4 insertions, 0 deletions
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);