diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2007-01-04 22:30:58 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2007-01-04 22:30:58 +0000 |
commit | 122f0e6bacae5f9554fb3dad0c957ab5c3e0c342 (patch) | |
tree | 48f13ceda98520fd3aacb1c9ffbee45e126553d3 /sbin | |
parent | 5e23b0060e1a09deda402f4ee3adc52ba4b1735a (diff) |
Eliminate the 'len' parameter from send_packet() since it always
contains the global value client->packet_length. Use
client->packet_length. No functional change.
Suggested by stevesk@.
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/dhclient/bpf.c | 8 | ||||
-rw-r--r-- | sbin/dhclient/dhclient.c | 10 | ||||
-rw-r--r-- | sbin/dhclient/dhcpd.h | 5 |
3 files changed, 10 insertions, 13 deletions
diff --git a/sbin/dhclient/bpf.c b/sbin/dhclient/bpf.c index a4909561c53..4129c34b756 100644 --- a/sbin/dhclient/bpf.c +++ b/sbin/dhclient/bpf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bpf.c,v 1.18 2007/01/04 22:17:48 krw Exp $ */ +/* $OpenBSD: bpf.c,v 1.19 2007/01/04 22:30:57 krw Exp $ */ /* BPF socket interface code, originally contributed by Archie Cobbs. */ @@ -250,7 +250,7 @@ if_register_receive(void) } ssize_t -send_packet(size_t len, struct in_addr from, struct sockaddr_in *to, +send_packet(struct in_addr from, struct sockaddr_in *to, struct hardware *hto) { #define IOVCNT 2 @@ -266,12 +266,12 @@ send_packet(size_t len, struct in_addr from, struct sockaddr_in *to, assemble_udp_ip_header(buf, &bufp, from.s_addr, to->sin_addr.s_addr, to->sin_port, (unsigned char *)&client->packet, - len); + client->packet_length); iov[0].iov_base = (char *)buf; iov[0].iov_len = bufp; iov[1].iov_base = (char *)&client->packet; - iov[1].iov_len = len; + iov[1].iov_len = client->packet_length; if (to->sin_addr.s_addr == INADDR_BROADCAST) { result = writev(ifi->wfdesc, iov, IOVCNT); diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c index a4b2715fc95..537385c508e 100644 --- a/sbin/dhclient/dhclient.c +++ b/sbin/dhclient/dhclient.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dhclient.c,v 1.101 2007/01/04 22:17:48 krw Exp $ */ +/* $OpenBSD: dhclient.c,v 1.102 2007/01/04 22:30:57 krw Exp $ */ /* * Copyright 2004 Henning Brauer <henning@openbsd.org> @@ -1094,8 +1094,7 @@ again: ntohs(sockaddr_broadcast.sin_port), client->interval); /* Send out a packet. */ - send_packet(client->packet_length, inaddr_any, &sockaddr_broadcast, - NULL); + send_packet(inaddr_any, &sockaddr_broadcast, NULL); add_timeout(cur_time + client->interval, send_discover); } @@ -1315,7 +1314,7 @@ cancel: inet_ntoa(destination.sin_addr), ntohs(destination.sin_port)); /* Send out a packet. */ - send_packet(client->packet_length, from, &destination, NULL); + send_packet(from, &destination, NULL); add_timeout(cur_time + client->interval, send_request); } @@ -1328,8 +1327,7 @@ send_decline(void) ntohs(sockaddr_broadcast.sin_port)); /* Send out a packet. */ - send_packet(client->packet_length, inaddr_any, &sockaddr_broadcast, - NULL); + send_packet(inaddr_any, &sockaddr_broadcast, NULL); } void diff --git a/sbin/dhclient/dhcpd.h b/sbin/dhclient/dhcpd.h index d00c3a03295..8d8867fd5a2 100644 --- a/sbin/dhclient/dhcpd.h +++ b/sbin/dhclient/dhcpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: dhcpd.h,v 1.59 2007/01/04 22:17:48 krw Exp $ */ +/* $OpenBSD: dhcpd.h,v 1.60 2007/01/04 22:30:57 krw Exp $ */ /* * Copyright (c) 2004 Henning Brauer <henning@openbsd.org> @@ -257,8 +257,7 @@ time_t parse_date(FILE *); int if_register_bpf(void); void if_register_send(void); void if_register_receive(void); -ssize_t send_packet(size_t, struct in_addr, struct sockaddr_in *, - struct hardware *); +ssize_t send_packet(struct in_addr, struct sockaddr_in *, struct hardware *); ssize_t receive_packet(struct sockaddr_in *, struct hardware *); /* dispatch.c */ |