diff options
author | Chris Koch <chrisko@google.com> | 2020-09-16 00:18:02 -0700 |
---|---|---|
committer | Chris K <c@chrisko.ch> | 2020-09-16 08:00:50 -0700 |
commit | cb73b7f86cfe50b2863e863e809b3d16c23a08fb (patch) | |
tree | c876d51cf561a0865e08e652f5dcebd0fa8b948e /dhcpv4/nclient4/conn_linux.go | |
parent | 8b5422a4739e3f24a3f43fc20bf850907363751d (diff) |
nclient4: unexport unnecessarily exported symbols
Signed-off-by: Chris Koch <chrisko@google.com>
Diffstat (limited to 'dhcpv4/nclient4/conn_linux.go')
-rw-r--r-- | dhcpv4/nclient4/conn_linux.go | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/dhcpv4/nclient4/conn_linux.go b/dhcpv4/nclient4/conn_linux.go index 1d0ec3a..9257bee 100644 --- a/dhcpv4/nclient4/conn_linux.go +++ b/dhcpv4/nclient4/conn_linux.go @@ -82,8 +82,8 @@ func udpMatch(addr *net.UDPAddr, bound *net.UDPAddr) bool { // ReadFrom reads raw IP packets and will try to match them against // upc.boundAddr. Any matching packets are returned via the given buffer. func (upc *BroadcastRawUDPConn) ReadFrom(b []byte) (int, net.Addr, error) { - ipHdrMaxLen := IPv4MaximumHeaderSize - udpHdrLen := UDPMinimumSize + ipHdrMaxLen := ipv4MaximumHeaderSize + udpHdrLen := udpMinimumSize for { pkt := make([]byte, ipHdrMaxLen+udpHdrLen+len(b)) @@ -98,28 +98,28 @@ func (upc *BroadcastRawUDPConn) ReadFrom(b []byte) (int, net.Addr, error) { buf := uio.NewBigEndianBuffer(pkt) // To read the header length, access data directly. - ipHdr := IPv4(buf.Data()) - ipHdr = IPv4(buf.Consume(int(ipHdr.HeaderLength()))) + ipHdr := ipv4(buf.Data()) + ipHdr = ipv4(buf.Consume(int(ipHdr.headerLength()))) - if ipHdr.TransportProtocol() != UDPProtocolNumber { + if ipHdr.transportProtocol() != udpProtocolNumber { continue } - udpHdr := UDP(buf.Consume(udpHdrLen)) + udpHdr := udp(buf.Consume(udpHdrLen)) addr := &net.UDPAddr{ - IP: ipHdr.DestinationAddress(), - Port: int(udpHdr.DestinationPort()), + IP: ipHdr.destinationAddress(), + Port: int(udpHdr.destinationPort()), } if !udpMatch(addr, upc.boundAddr) { continue } srcAddr := &net.UDPAddr{ - IP: ipHdr.SourceAddress(), - Port: int(udpHdr.SourcePort()), + IP: ipHdr.sourceAddress(), + Port: int(udpHdr.sourcePort()), } // Extra padding after end of IP packet should be ignored, // if not dhcp option parsing will fail. - dhcpLen := int(ipHdr.PayloadLength()) - udpHdrLen + dhcpLen := int(ipHdr.payloadLength()) - udpHdrLen return copy(b, buf.Consume(dhcpLen)), srcAddr, nil } } |