summaryrefslogtreecommitdiffstats
path: root/sbin/dhclient/bpf.c
diff options
context:
space:
mode:
authorkrw <krw@openbsd.org>2017-07-10 00:47:47 +0000
committerkrw <krw@openbsd.org>2017-07-10 00:47:47 +0000
commit5d0bc9708922b1546ae43d4efdd6b913facbb34a (patch)
treef4ff3cd550acd34f6c0ab8d70ca05a8664b9c2b1 /sbin/dhclient/bpf.c
parentMake pkg-config regress tests pass: (diff)
downloadwireguard-openbsd-5d0bc9708922b1546ae43d4efdd6b913facbb34a.tar.xz
wireguard-openbsd-5d0bc9708922b1546ae43d4efdd6b913facbb34a.zip
Use a modern spacious idiom on all function local variable
declarations.
Diffstat (limited to 'sbin/dhclient/bpf.c')
-rw-r--r--sbin/dhclient/bpf.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/sbin/dhclient/bpf.c b/sbin/dhclient/bpf.c
index 21e6ba981ec..1f701e55123 100644
--- a/sbin/dhclient/bpf.c
+++ b/sbin/dhclient/bpf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bpf.c,v 1.58 2017/07/09 19:19:58 krw Exp $ */
+/* $OpenBSD: bpf.c,v 1.59 2017/07/10 00:47:47 krw Exp $ */
/* BPF socket interface code, originally contributed by Archie Cobbs. */
@@ -75,8 +75,8 @@ void if_register_bpf(struct interface_info *ifi);
void
if_register_bpf(struct interface_info *ifi)
{
- struct ifreq ifr;
- int sock;
+ struct ifreq ifr;
+ int sock;
if ((sock = open("/dev/bpf", O_RDWR | O_CLOEXEC)) == -1)
fatal("Can't open bpf");
@@ -92,7 +92,7 @@ if_register_bpf(struct interface_info *ifi)
void
if_register_send(struct interface_info *ifi)
{
- int sock, on = 1;
+ int sock, on = 1;
/*
* Use raw socket for unicast send.
@@ -187,9 +187,9 @@ int dhcp_bpf_wfilter_len = sizeof(dhcp_bpf_wfilter) / sizeof(struct bpf_insn);
void
if_register_receive(struct interface_info *ifi)
{
- struct bpf_version v;
- struct bpf_program p;
- int flag = 1, sz;
+ struct bpf_version v;
+ struct bpf_program p;
+ int flag = 1, sz;
/* Open a BPF device and hang it on this interface. */
if_register_bpf(ifi);
@@ -256,15 +256,15 @@ if_register_receive(struct interface_info *ifi)
ssize_t
send_packet(struct interface_info *ifi, struct in_addr from, struct in_addr to)
{
- struct sockaddr_in dest;
- struct ether_header eh;
- struct ip ip;
- struct udphdr udp;
- struct iovec iov[4];
- struct msghdr msg;
- struct dhcp_packet *packet = &ifi->sent_packet;
- ssize_t result;
- int iovcnt = 0, len = ifi->sent_packet_length;
+ struct iovec iov[4];
+ struct sockaddr_in dest;
+ struct ether_header eh;
+ struct ip ip;
+ struct udphdr udp;
+ struct msghdr msg;
+ struct dhcp_packet *packet = &ifi->sent_packet;
+ ssize_t result;
+ int iovcnt = 0, len = ifi->sent_packet_length;
memset(&dest, 0, sizeof(dest));
dest.sin_family = AF_INET;
@@ -331,9 +331,9 @@ ssize_t
receive_packet(struct interface_info *ifi, struct sockaddr_in *from,
struct ether_addr *hfrom)
{
- struct dhcp_packet *packet = &ifi->recv_packet;
- int length = 0, offset = 0;
- struct bpf_hdr hdr;
+ struct bpf_hdr hdr;
+ struct dhcp_packet *packet = &ifi->recv_packet;
+ int length = 0, offset = 0;
/*
* All this complexity is because BPF doesn't guarantee that