title: icmp.ListenPacket("udp4", "127.0.0.1") return permission denied
body: <p>In <a href="https://godoc.org/golang.org/x/net/icmp#ListenPacket" rel="nofollow noreferrer">https://godoc.org/golang.org/x/net/icmp#ListenPacket</a> documentation, it mentions:</p>
  
  <blockquote>
    <p>For non-privileged datagram-oriented ICMP endpoints, network must be
    "udp4" or "udp6". The endpoint allows to read, write a few limited
    ICMP messages such as echo request and echo reply. Currently only
    Darwin and Linux support this.</p>
    
    <p>For privileged raw ICMP endpoints, network must be "ip4" or "ip6"
    followed by a colon and an ICMP protocol number or name.</p>
  </blockquote>
  
  <p>But when I try this code:</p>
  
  <pre class="lang-golang prettyprint-override"><code>package main
  
  import (
      "fmt"
  
      "golang.org/x/net/icmp"
  )
  
  func main() {
      _, err := icmp.ListenPacket("udp4", "127.0.0.1")
      fmt.Println(err)
  }
  </code></pre>
  
  <p>Error returned:</p>
  
  <pre class="lang-golang prettyprint-override"><code>socket: permission denied
  </code></pre>
  
  <p>Is there something wrong in my code?</p>
  
  <p><strong>Operating System</strong>: Ubuntu 18.04</p>