summaryrefslogtreecommitdiff
path: root/sbin/dhclient
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2004-02-24 17:26:44 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2004-02-24 17:26:44 +0000
commit55cf99bc1aaebebaf1f89e02b769764b086a6fe6 (patch)
treebb032812bbe25934c51ff872e74e87bce250fec3 /sbin/dhclient
parentddcaf000e38a3baae7f5e712227e8ec2eb3ab043 (diff)
whack unused token ring code and a few empty functions
Diffstat (limited to 'sbin/dhclient')
-rw-r--r--sbin/dhclient/bpf.c50
-rw-r--r--sbin/dhclient/dhclient.c13
-rw-r--r--sbin/dhclient/dhcpd.h9
-rw-r--r--sbin/dhclient/dispatch.c12
4 files changed, 8 insertions, 76 deletions
diff --git a/sbin/dhclient/bpf.c b/sbin/dhclient/bpf.c
index 4ee46810bed..5d4b5fcdbc8 100644
--- a/sbin/dhclient/bpf.c
+++ b/sbin/dhclient/bpf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bpf.c,v 1.8 2004/02/24 13:36:13 henning Exp $ */
+/* $OpenBSD: bpf.c,v 1.9 2004/02/24 17:26:43 henning Exp $ */
/* BPF socket interface code, originally contributed by Archie Cobbs. */
@@ -53,20 +53,6 @@
#define BPF_FORMAT "/dev/bpf%d"
/*
- * Reinitializes the specified interface after an address change. This
- * is not required for packet-filter APIs.
- */
-void
-if_reinitialize_send(struct interface_info *info)
-{
-}
-
-void
-if_reinitialize_receive(struct interface_info *info)
-{
-}
-
-/*
* Called by get_interface_list for each interface that's discovered.
* Opens a packet filter for each interface and adds it to the select
* mask.
@@ -84,14 +70,8 @@ if_register_bpf(struct interface_info *info)
if (sock < 0) {
if (errno == EBUSY)
continue;
- else {
- if (!b)
- error("No bpf devices.%s%s%s",
- " Please read the README",
- " section for your operating",
- " system.");
+ else
error("Can't find free bpf: %m");
- }
} else
break;
}
@@ -149,20 +129,6 @@ struct bpf_insn dhcp_bpf_filter[] = {
int dhcp_bpf_filter_len = sizeof(dhcp_bpf_filter) / sizeof(struct bpf_insn);
-struct bpf_insn dhcp_bpf_tr_filter[] = {
- /* accept all token ring packets due to variable length header */
- /* if we want to get clever, insert the program here */
-
- /* If we passed all the tests, ask for the whole packet. */
- BPF_STMT(BPF_RET+BPF_K, (u_int)-1),
-
- /* Otherwise, drop it. */
- BPF_STMT(BPF_RET+BPF_K, 0),
-};
-
-int dhcp_bpf_tr_filter_len =
- sizeof(dhcp_bpf_tr_filter) / sizeof(struct bpf_insn);
-
void
if_register_receive(struct interface_info *info)
{
@@ -355,15 +321,3 @@ receive_packet(struct interface_info *interface, unsigned char *buf,
} while (!length);
return (0);
}
-
-int
-can_unicast_without_arp(void)
-{
- return (1);
-}
-
-int
-can_receive_unicast_unconfigured(struct interface_info *ip)
-{
- return (1);
-}
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c
index 96502b1c4ca..b5ce59a1f90 100644
--- a/sbin/dhclient/dhclient.c
+++ b/sbin/dhclient/dhclient.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dhclient.c,v 1.19 2004/02/24 15:35:56 henning Exp $ */
+/* $OpenBSD: dhclient.c,v 1.20 2004/02/24 17:26:43 henning Exp $ */
/* DHCP Client. */
@@ -1409,11 +1409,7 @@ make_discover(struct interface_info *ip, struct client_lease *lease)
ip->client->packet.hops = 0;
ip->client->packet.xid = arc4random();
ip->client->packet.secs = 0; /* filled in by send_discover. */
-
- if (can_receive_unicast_unconfigured(ip))
- ip->client->packet.flags = 0;
- else
- ip->client->packet.flags = htons(BOOTP_BROADCAST);
+ ip->client->packet.flags = 0;
memset(&(ip->client->packet.ciaddr),
0, sizeof(ip->client->packet.ciaddr));
@@ -1523,10 +1519,7 @@ make_request(struct interface_info *ip, struct client_lease * lease)
} else {
memset(&ip->client->packet.ciaddr, 0,
sizeof(ip->client->packet.ciaddr));
- if (can_receive_unicast_unconfigured(ip))
- ip->client->packet.flags = 0;
- else
- ip->client->packet.flags = htons(BOOTP_BROADCAST);
+ ip->client->packet.flags = 0;
}
memset(&ip->client->packet.yiaddr, 0,
diff --git a/sbin/dhclient/dhcpd.h b/sbin/dhclient/dhcpd.h
index 42f3194fd20..9202afdcfb2 100644
--- a/sbin/dhclient/dhcpd.h
+++ b/sbin/dhclient/dhcpd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: dhcpd.h,v 1.17 2004/02/24 17:02:40 henning Exp $ */
+/* $OpenBSD: dhcpd.h,v 1.18 2004/02/24 17:26:43 henning Exp $ */
/*
* Copyright (c) 2004 Henning Brauer <henning@openbsd.org>
@@ -310,18 +310,13 @@ void free_string_list(struct string_list *, char *);
/* bpf.c */
int if_register_bpf(struct interface_info *);
-void if_reinitialize_send(struct interface_info *);
void if_register_send(struct interface_info *);
+void if_register_receive(struct interface_info *);
ssize_t send_packet(struct interface_info *,
struct packet *, struct dhcp_packet *, size_t, struct in_addr,
struct sockaddr_in *, struct hardware *);
-void if_reinitialize_receive(struct interface_info *);
-void if_register_receive(struct interface_info *);
ssize_t receive_packet(struct interface_info *, unsigned char *, size_t,
struct sockaddr_in *, struct hardware *);
-int can_unicast_without_arp(void);
-int can_receive_unicast_unconfigured(struct interface_info *);
-void maybe_setup_fallback(void);
/* dispatch.c */
extern struct interface_info *interfaces,
diff --git a/sbin/dhclient/dispatch.c b/sbin/dhclient/dispatch.c
index f360fd0201d..b115d29d34b 100644
--- a/sbin/dhclient/dispatch.c
+++ b/sbin/dhclient/dispatch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dispatch.c,v 1.14 2004/02/24 15:35:56 henning Exp $ */
+/* $OpenBSD: dispatch.c,v 1.15 2004/02/24 17:26:43 henning Exp $ */
/* Network input dispatcher... */
@@ -183,16 +183,6 @@ discover_interfaces(void)
void
reinitialize_interfaces(void)
{
- struct interface_info *ip;
-
- for (ip = interfaces; ip; ip = ip->next) {
- if_reinitialize_receive(ip);
- if_reinitialize_send(ip);
- }
-
- if (fallback_interface)
- if_reinitialize_send(fallback_interface);
-
interfaces_invalidated = 1;
}