sdhcp

simple dhcp client
git clone git://git.2f30.org/sdhcp
Log | Files | Refs | LICENSE

commit 9a516fee5f808e1fb8a33f93411df70471fa0b0c
parent 25a4c8c5c72961fdab5de9fc38472e6fca849a4a
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Fri, 25 Apr 2014 23:04:04 +0200

style

Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>

Diffstat:
Msdhcp.c | 10++++++----
1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/sdhcp.c b/sdhcp.c @@ -84,7 +84,7 @@ static unsigned char xid[sizeof bp.xid]; static unsigned char hwaddr[16]; static time_t starttime; static char *ifname = "eth0"; -static char *cid = ""; /* TODO sane default value */ +static char *cid = ""; static int sock; /* sav */ static unsigned char server[4]; @@ -94,7 +94,7 @@ static unsigned char router[4]; static unsigned char dns[4]; static unsigned long t1; -static int dflag = 0; +static int dflag = 0; /* set DNS: change /etc/resolv.conf ? */ #define IP(a,b,c,d) (unsigned char[4]){a,b,c,d} @@ -120,7 +120,8 @@ iptoaddr(struct sockaddr *ifaddr, unsigned char ip[4], int port) /* sendto UDP wrapper */ static ssize_t -udpsend(unsigned char ip[4], int fd, void *data, size_t n) { +udpsend(unsigned char ip[4], int fd, void *data, size_t n) +{ struct sockaddr addr; socklen_t addrlen = sizeof addr; ssize_t sent; @@ -133,7 +134,8 @@ udpsend(unsigned char ip[4], int fd, void *data, size_t n) { /* recvfrom UDP wrapper */ static ssize_t -udprecv(unsigned char ip[4], int fd, void *data, size_t n) { +udprecv(unsigned char ip[4], int fd, void *data, size_t n) +{ struct sockaddr addr; socklen_t addrlen = sizeof addr; ssize_t r;