• Mikio Hara's avatar
    icmp: prevent stripping off ipv4 header twice on darwin · 23996681
    Mikio Hara authored
    We cannot use net.ReadFrom on darwin because a) net.ReadFrom and
    net.ReadFromIP unconditionally try to strip off ipv4 header due to
    and c) icmp.ListenPacket calls ipv4.PacketConn internally.
    
    Instead, we use ipv4.PacketConn.ReadFrom that calls net.ReadMsgIP
    internally to prevent icmp.ReadFrom from returning corrupted ICMP
    message.
    
    Fixes #9395.
    
    Change-Id: I269f3724de72bf37eb26921c251c2acb1c720fa3
    23996681
endpoint.go 2.75 KB