summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2012-01-23 09:13:17 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2012-01-23 09:13:17 +0000
commit7f03c6135168029dc951e54895750e5651e1f96e (patch)
tree75181406a326a3a9bde306a0aa4cf0c6a08716dd /usr.sbin
parent9167b078d58ed71865df477979a78820f6a24cca (diff)
Trim unused variables, from Michael W. Bombardieri.
ok yasuoka
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/ppp/ppp/alias_cuseeme.c7
-rw-r--r--usr.sbin/ppp/ppp/alias_db.c9
-rw-r--r--usr.sbin/ppp/ppp/alias_nbt.c6
-rw-r--r--usr.sbin/ppp/ppp/alias_skinny.c4
-rw-r--r--usr.sbin/ppp/ppp/iface.c9
-rw-r--r--usr.sbin/ppp/ppp/lqr.c5
-rw-r--r--usr.sbin/ppp/ppp/physical.c5
7 files changed, 17 insertions, 28 deletions
diff --git a/usr.sbin/ppp/ppp/alias_cuseeme.c b/usr.sbin/ppp/ppp/alias_cuseeme.c
index 8c456a426dd..68f2c3f1c4c 100644
--- a/usr.sbin/ppp/ppp/alias_cuseeme.c
+++ b/usr.sbin/ppp/ppp/alias_cuseeme.c
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $OpenBSD: alias_cuseeme.c,v 1.5 2002/06/15 08:01:59 brian Exp $
+ * $OpenBSD: alias_cuseeme.c,v 1.6 2012/01/23 09:13:16 nicm Exp $
*/
#include <sys/types.h>
@@ -72,16 +72,17 @@ AliasHandleCUSeeMeOut(struct ip *pip, struct alias_link *link)
ud = (struct udphdr *)((char *)pip + (pip->ip_hl << 2));
if (ntohs(ud->uh_ulen) - sizeof(struct udphdr) >= sizeof(struct cu_header)) {
struct cu_header *cu;
+#ifndef NO_FW_PUNCH
struct alias_link *cu_link;
+#endif
cu = (struct cu_header *)(ud + 1);
if (cu->addr)
cu->addr = (u_int32_t)GetAliasAddress(link).s_addr;
+#ifndef NO_FW_PUNCH
cu_link = FindUdpTcpOut(pip->ip_src, GetDestAddress(link),
ud->uh_dport, 0, IPPROTO_UDP, 1);
-
-#ifndef NO_FW_PUNCH
if (cu_link)
PunchFWHole(cu_link);
#endif
diff --git a/usr.sbin/ppp/ppp/alias_db.c b/usr.sbin/ppp/ppp/alias_db.c
index 5763358ea17..0a487f4fd61 100644
--- a/usr.sbin/ppp/ppp/alias_db.c
+++ b/usr.sbin/ppp/ppp/alias_db.c
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $OpenBSD: alias_db.c,v 1.23 2005/07/26 01:32:25 brad Exp $
+ * $OpenBSD: alias_db.c,v 1.24 2012/01/23 09:13:16 nicm Exp $
*/
/*
@@ -812,13 +812,10 @@ FindNewPortGroup(struct in_addr dst_addr,
/* Port number search */
for (i = 0; i < max_trials; i++) {
-
- struct alias_link *search_result;
-
for (j = 0; j < port_count; j++)
- if (0 != (search_result = FindLinkIn(dst_addr, alias_addr,
+ if (0 != FindLinkIn(dst_addr, alias_addr,
dst_port, htons(port_sys + j),
- link_type, 0)))
+ link_type, 0))
break;
/* Found a good range, return base */
diff --git a/usr.sbin/ppp/ppp/alias_nbt.c b/usr.sbin/ppp/ppp/alias_nbt.c
index 9d442824efd..936c8bd7d78 100644
--- a/usr.sbin/ppp/ppp/alias_nbt.c
+++ b/usr.sbin/ppp/ppp/alias_nbt.c
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $OpenBSD: alias_nbt.c,v 1.9 2004/05/31 02:21:17 brad Exp $
+ * $OpenBSD: alias_nbt.c,v 1.10 2012/01/23 09:13:16 nicm Exp $
*
* TODO:
* oClean up.
@@ -122,7 +122,6 @@ static void PrintRcode( u_char rcode ) {
static u_char *AliasHandleName ( u_char *p, char *pmax ) {
u_char *s;
- u_char c;
int compress;
/* Following length field */
@@ -154,8 +153,9 @@ static u_char *AliasHandleName ( u_char *p, char *pmax ) {
#endif
while (s < p) {
if ( compress == 1 ) {
- c = (u_char )(((((*s & 0x0f) << 4) | (*(s+1) & 0x0f)) - 0x11));
#ifdef DEBUG
+ u_char c = (u_char)(((((*s & 0x0f) << 4) |
+ (*(s+1) & 0x0f)) - 0x11));
if (isprint( c ) )
printf("%c", c );
else
diff --git a/usr.sbin/ppp/ppp/alias_skinny.c b/usr.sbin/ppp/ppp/alias_skinny.c
index 2e46eea1cb4..29c1aad46f4 100644
--- a/usr.sbin/ppp/ppp/alias_skinny.c
+++ b/usr.sbin/ppp/ppp/alias_skinny.c
@@ -27,7 +27,7 @@
*
* Author: Joe Marcus Clarke <marcus@FreeBSD.org>
*
- * $OpenBSD: alias_skinny.c,v 1.2 2010/01/05 22:28:09 jasper Exp $
+ * $OpenBSD: alias_skinny.c,v 1.3 2012/01/23 09:13:16 nicm Exp $
*/
#include <stdio.h>
@@ -180,10 +180,8 @@ alias_skinny_opnrcvch_ack(struct OpenReceiveChannelAck *opnrcvch_ack,
{
struct in_addr null_addr;
struct alias_link *opnrcv_link;
- u_int32_t localPort;
*localIpAddr = (u_int32_t) opnrcvch_ack->ipAddr;
- localPort = opnrcvch_ack->port;
null_addr.s_addr = INADDR_ANY;
opnrcv_link = FindUdpTcpOut(pip->ip_src, null_addr,
diff --git a/usr.sbin/ppp/ppp/iface.c b/usr.sbin/ppp/ppp/iface.c
index a30d95de099..cb4f002f48a 100644
--- a/usr.sbin/ppp/ppp/iface.c
+++ b/usr.sbin/ppp/ppp/iface.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $OpenBSD: iface.c,v 1.29 2009/07/02 16:08:29 claudio Exp $
+ * $OpenBSD: iface.c,v 1.30 2012/01/23 09:13:16 nicm Exp $
*/
#include <sys/param.h>
@@ -91,8 +91,6 @@ static const struct in6_addr in6mask128 = IN6MASK128;
struct iface *
iface_Create(const char *name)
{
- size_t namelen;
- struct sockaddr_dl *dl;
struct ifaddrs *ifap, *ifa;
struct iface *iface;
struct iface_addr *addr;
@@ -103,13 +101,11 @@ iface_Create(const char *name)
}
iface = NULL;
- namelen = strlen(name);
for (ifa = ifap; ifa != NULL; ifa = ifa->ifa_next) {
if (strcmp(name, ifa->ifa_name))
continue;
if (ifa->ifa_addr->sa_family == AF_LINK) {
- dl = (struct sockaddr_dl *)ifa->ifa_addr;
iface = (struct iface *)malloc(sizeof *iface);
if (iface == NULL) {
fprintf(stderr, "iface_Create: malloc: %s\n", strerror(errno));
@@ -327,11 +323,10 @@ iface_addr_Add(const char *name, struct iface_addr *addr, int s)
void
iface_Clear(struct iface *iface, struct ncp *ncp, int family, int how)
{
- int addrs, af, inskip, in6skip, n, s4 = -1, s6 = -1, *s;
+ int af, inskip, in6skip, n, s4 = -1, s6 = -1, *s;
if (iface->addrs) {
inskip = in6skip = how == IFACE_CLEAR_ALL ? 0 : 1;
- addrs = 0;
for (n = 0; n < iface->addrs; n++) {
af = ncprange_family(&iface->addr[n].ifa);
diff --git a/usr.sbin/ppp/ppp/lqr.c b/usr.sbin/ppp/ppp/lqr.c
index 24f653aef53..8392c5b5b68 100644
--- a/usr.sbin/ppp/ppp/lqr.c
+++ b/usr.sbin/ppp/ppp/lqr.c
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $OpenBSD: lqr.c,v 1.16 2005/07/17 07:33:22 brad Exp $
+ * $OpenBSD: lqr.c,v 1.17 2012/01/23 09:13:16 nicm Exp $
*/
#include <sys/param.h>
@@ -417,7 +417,7 @@ lqr_LayerPush(struct bundle *b, struct link *l, struct mbuf *bp,
int pri, u_short *proto)
{
struct physical *p = link2physical(l);
- int len, layer, extra_async_bytes;
+ int len, layer;
if (!p) {
/* Oops - can't happen :-] */
@@ -445,7 +445,6 @@ lqr_LayerPush(struct bundle *b, struct link *l, struct mbuf *bp,
* acf layers (to avoid alignment issues), so deal with this too.
*/
- extra_async_bytes = 0;
p->hdlc.lqm.ifOutUniPackets++;
p->hdlc.lqm.ifOutOctets += len + 1; /* plus 1 flag octet! */
for (layer = 0; layer < l->nlayers; layer++)
diff --git a/usr.sbin/ppp/ppp/physical.c b/usr.sbin/ppp/ppp/physical.c
index d77d85ed046..6c077a1885c 100644
--- a/usr.sbin/ppp/ppp/physical.c
+++ b/usr.sbin/ppp/ppp/physical.c
@@ -16,7 +16,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $OpenBSD: physical.c,v 1.41 2009/06/05 23:03:07 deraadt Exp $
+ * $OpenBSD: physical.c,v 1.42 2012/01/23 09:13:16 nicm Exp $
*
*/
@@ -593,7 +593,7 @@ iov2physical(struct datalink *dl, struct iovec *iov, int *niov, int maxiov,
int fd, int *auxfd, int *nauxfd)
{
struct physical *p;
- int len, h, type;
+ int h, type;
p = (struct physical *)iov[(*niov)++].iov_base;
p->link.name = dl->name;
@@ -605,7 +605,6 @@ iov2physical(struct datalink *dl, struct iovec *iov, int *niov, int maxiov,
p->desc.Write = physical_DescriptorWrite;
p->type = PHYS_DIRECT;
p->dl = dl;
- len = strlen(_PATH_DEV);
p->out = NULL;
p->connect_count = 1;