Ignore:
Timestamp:
Nov 4, 2007, 3:16:40 AM (17 years ago)
Author:
Bruno Cornec
Message:

Update to busybox 1.7.2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.5/mindi-busybox/networking/udhcp/clientsocket.c

    r821 r1765  
     1/* vi: set sw=4 ts=4: */
    12/*
    23 * clientsocket.c -- DHCP client socket creation
     
    2122 */
    2223
    23 #include <sys/types.h>
    24 #include <sys/socket.h>
    25 #include <unistd.h>
    26 #include <netinet/in.h>
    2724#include <features.h>
    28 #if (__GLIBC__ >= 2 && __GLIBC_MINOR >= 1) || defined _NEWLIB_VERSION
     25#if (defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1) || defined(_NEWLIB_VERSION)
    2926#include <netpacket/packet.h>
    3027#include <net/ethernet.h>
     
    3532#endif
    3633
    37 #include "clientsocket.h"
    3834#include "common.h"
    3935
     
    4440    struct sockaddr_ll sock;
    4541
    46     DEBUG(LOG_INFO, "Opening raw socket on ifindex %d", ifindex);
    47     if ((fd = socket(PF_PACKET, SOCK_DGRAM, htons(ETH_P_IP))) < 0) {
    48         DEBUG(LOG_ERR, "socket call failed: %m");
    49         return -1;
    50     }
     42    DEBUG("Opening raw socket on ifindex %d", ifindex);
     43    fd = xsocket(PF_PACKET, SOCK_DGRAM, htons(ETH_P_IP));
    5144
    5245    sock.sll_family = AF_PACKET;
    5346    sock.sll_protocol = htons(ETH_P_IP);
    5447    sock.sll_ifindex = ifindex;
    55     if (bind(fd, (struct sockaddr *) &sock, sizeof(sock)) < 0) {
    56         DEBUG(LOG_ERR, "bind call failed: %m");
    57         close(fd);
    58         return -1;
    59     }
     48    xbind(fd, (struct sockaddr *) &sock, sizeof(sock));
    6049
    6150    return fd;
Note: See TracChangeset for help on using the changeset viewer.