From 2af4a4fa332132901611faffcd11bd4eedc93639 Mon Sep 17 00:00:00 2001 From: Kenneth R Westerback Date: Tue, 6 Nov 2012 00:05:12 +0000 Subject: Kill two unused functions, subnet_number() and broadcast_addr(). --- sbin/dhclient/dhcpd.h | 4 +--- sbin/dhclient/inet.c | 46 +--------------------------------------------- 2 files changed, 2 insertions(+), 48 deletions(-) (limited to 'sbin') diff --git a/sbin/dhclient/dhcpd.h b/sbin/dhclient/dhcpd.h index fd458280bf7..c67e0f0a3c5 100644 --- a/sbin/dhclient/dhcpd.h +++ b/sbin/dhclient/dhcpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: dhcpd.h,v 1.87 2012/11/04 03:36:39 krw Exp $ */ +/* $OpenBSD: dhcpd.h,v 1.88 2012/11/06 00:05:11 krw Exp $ */ /* * Copyright (c) 2004 Henning Brauer @@ -271,8 +271,6 @@ void putUShort(unsigned char *, unsigned int); void putShort(unsigned char *, int); /* inet.c */ -struct iaddr subnet_number(struct iaddr, struct iaddr); -struct iaddr broadcast_addr(struct iaddr, struct iaddr); int addr_eq(struct iaddr, struct iaddr); char *piaddr(struct iaddr); diff --git a/sbin/dhclient/inet.c b/sbin/dhclient/inet.c index a52847596e1..6365b2b2c08 100644 --- a/sbin/dhclient/inet.c +++ b/sbin/dhclient/inet.c @@ -1,4 +1,4 @@ -/* $OpenBSD: inet.c,v 1.7 2004/05/04 21:48:16 deraadt Exp $ */ +/* $OpenBSD: inet.c,v 1.8 2012/11/06 00:05:11 krw Exp $ */ /* * Subroutines to manipulate internet addresses in a safely portable @@ -44,50 +44,6 @@ #include "dhcpd.h" -/* - * Return just the network number of an internet address... - */ -struct iaddr -subnet_number(struct iaddr addr, struct iaddr mask) -{ - struct iaddr rv; - int i; - - rv.len = 0; - - /* Both addresses must have the same length... */ - if (addr.len != mask.len) - return (rv); - - rv.len = addr.len; - for (i = 0; i < rv.len; i++) - rv.iabuf[i] = addr.iabuf[i] & mask.iabuf[i]; - return (rv); -} - -/* - * Given a subnet number and netmask, return the address on that subnet - * for which the host portion of the address is all ones (the standard - * broadcast address). - */ -struct iaddr -broadcast_addr(struct iaddr subnet, struct iaddr mask) -{ - struct iaddr rv; - int i; - - if (subnet.len != mask.len) { - rv.len = 0; - return (rv); - } - - for (i = 0; i < subnet.len; i++) - rv.iabuf[i] = subnet.iabuf[i] | (~mask.iabuf[i] & 255); - rv.len = subnet.len; - - return (rv); -} - int addr_eq(struct iaddr addr1, struct iaddr addr2) { -- cgit v1.2.3