From 01d1b424158214e583b8e8f356ad57728c8d091b Mon Sep 17 00:00:00 2001 From: jsg Date: Mon, 22 Feb 2021 23:43:59 +0000 Subject: [PATCH] remove unused decode_hw_header() function ok krw@ --- sbin/dhclient/dhcpd.h | 4 +--- sbin/dhclient/packet.c | 17 +---------------- 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/sbin/dhclient/dhcpd.h b/sbin/dhclient/dhcpd.h index e874d04c33c..57c0af2bcf5 100644 --- a/sbin/dhclient/dhcpd.h +++ b/sbin/dhclient/dhcpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: dhcpd.h,v 1.293 2021/02/22 02:19:03 krw Exp $ */ +/* $OpenBSD: dhcpd.h,v 1.294 2021/02/22 23:43:59 jsg Exp $ */ /* * Copyright (c) 2004 Henning Brauer @@ -231,8 +231,6 @@ char *rfc1035_as_string(unsigned char *, size_t); /* packet.c */ void assemble_eh_header(struct ether_addr, struct ether_header *); -ssize_t decode_hw_header(unsigned char *, uint32_t, - struct ether_addr *); ssize_t decode_udp_ip_header(unsigned char *, uint32_t, struct sockaddr_in *); uint32_t checksum(unsigned char *, uint32_t, uint32_t); diff --git a/sbin/dhclient/packet.c b/sbin/dhclient/packet.c index 903b719c772..8b4afbc7149 100644 --- a/sbin/dhclient/packet.c +++ b/sbin/dhclient/packet.c @@ -1,4 +1,4 @@ -/* $OpenBSD: packet.c,v 1.44 2018/02/28 22:16:56 krw Exp $ */ +/* $OpenBSD: packet.c,v 1.45 2021/02/22 23:43:59 jsg Exp $ */ /* Packet assembly code, originally contributed by Archie Cobbs. */ @@ -103,21 +103,6 @@ assemble_eh_header(struct ether_addr shost, struct ether_header *eh) eh->ether_type = htons(ETHERTYPE_IP); } -ssize_t -decode_hw_header(unsigned char *buf, uint32_t buflen, struct ether_addr *from) -{ - struct ether_header eh; - - if (buflen < sizeof(eh)) - return -1; - - memcpy(&eh, buf, sizeof(eh)); - - memcpy(from->ether_addr_octet, eh.ether_shost, ETHER_ADDR_LEN); - - return sizeof(eh); -} - ssize_t decode_udp_ip_header(unsigned char *buf, uint32_t buflen, struct sockaddr_in *from) -- 2.20.1