diff options
author | Russ Dill | 2003-12-18 22:25:38 +0000 |
---|---|---|
committer | Russ Dill | 2003-12-18 22:25:38 +0000 |
commit | 4e864a36b611f56c6b347be1dace4e5e805a3eb8 (patch) | |
tree | 6582084290de4bead010f5fb8ff0a0a6d2b573fd /networking/udhcp/socket.c | |
parent | e30495654d8bb38f7ea234d9d0ab0929525501e3 (diff) | |
download | busybox-4e864a36b611f56c6b347be1dace4e5e805a3eb8.zip busybox-4e864a36b611f56c6b347be1dace4e5e805a3eb8.tar.gz |
Finish remerging busybox udhcp and udhcp. Some cleanups as well.
Diffstat (limited to 'networking/udhcp/socket.c')
-rw-r--r-- | networking/udhcp/socket.c | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/networking/udhcp/socket.c b/networking/udhcp/socket.c index 60190a0..c19838a 100644 --- a/networking/udhcp/socket.c +++ b/networking/udhcp/socket.c @@ -130,29 +130,3 @@ int listen_socket(unsigned int ip, int port, char *inf) return fd; } - - -int raw_socket(int ifindex) -{ - int fd; - struct sockaddr_ll sock; - - DEBUG(LOG_INFO, "Opening raw socket on ifindex %d", ifindex); - if ((fd = socket(PF_PACKET, SOCK_DGRAM, htons(ETH_P_IP))) < 0) { - DEBUG(LOG_ERR, "socket call failed: %m"); - return -1; - } - - while (fd >= 0 && fd < 3) fd = dup(fd); /* don't let daemon close fds on us */ - - sock.sll_family = AF_PACKET; - sock.sll_protocol = htons(ETH_P_IP); - sock.sll_ifindex = ifindex; - if (bind(fd, (struct sockaddr *) &sock, sizeof(sock)) < 0) { - DEBUG(LOG_ERR, "bind call failed: %m"); - close(fd); - return -1; - } - - return fd; -} |