1314258

原来 socket.SOCK_RAW 在 os x 下不能抓到包。

  •  
  •   1314258 · May 25, 2015 · 2770 views
    This topic created in 4015 days ago, the information mentioned may be changed or developed.
    IGMP包是可以的。但tcp和udp是不能的。
    Supplement 1  ·  May 25, 2015
    FreeBSD takes another approach. It *never* passes TCP or UDP packets to raw
    sockets. Such packets need to be read directly at the datalink layer by using
    libraries like libpcap or the bpf API. It also *never* passes any fragmented
    datagram. Each datagram has to be completeley reassembled before it is passed
    to a raw socket.
    FreeBSD passes to a raw socket:
    a) every IP datagram with a protocol field that is not registered in
    the kernel
    b) all IGMP packets after kernel finishes processing them
    c) all ICMP packets (except echo request, timestamp request and address
    mask request) after kernel finishes processes them
    2 replies    2018-10-25 00:12:15 +08:00
    auser
        1
    auser  
       May 25, 2015 via Android
    可以在内核里头写扩展抓 ╯﹏╰
    autogen
        2
    autogen  
       Oct 25, 2018
    macOS 下居然能发 raw ip 包,不会[Error 22] invalid argument 吗
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3107 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 41ms · UTC 06:45 · PVG 14:45 · LAX 23:45 · JFK 02:45
    ♥ Do have faith in what you're doing.