6135 links
  • GuiGui's Show
  • Home
  • Login
  • RSS Feed
  • ATOM Feed
  • Tag cloud
  • Picture wall
  • Daily
Links per page: 20 50 100
 
  • gopacket/pfring.go at master · packetbeat/gopacket · GitHub
    Hum, il y'a une erreur là...

    La doc de pf_ring (http://safemedia.com/builds/UsersGuide.pdf) nous dit :
    « int pfring_send(pfring *ring, u_char *pkt, u_int pkt_len, u_int8_t flush_packet)
    Although PF_RING has been optimized for RX, it is also possible to send packets (TX). This function allows
    to send a raw packet (i.e. it is sent on wire as specified). This packet must be fully specified (the MAC
    address up) and it will be transmitted as-is without any further manipulation.
    [...]
    Return value:
    The number of bytes sent if success, a negative value otherwise. »

    Là, le code dans gopacket retourne une erreur pour tout retour de pfring_send() différent de 0. Or, un nombre positif indique un succès, pas un échec pour envoyer le paquet ! Donc, si tu utilises gopacket + la lib pf_ring, que tu injectes des paquets avec WritePacketData() et que t'as l'erreur  « Unable to send packet data, got error code 60 » (60 peut-être un autre nombre ;) ), ne cherches pas plus loin. :D

    Patch : « if rv := C.pfring_send(r.cptr, buf, C.u_int(len(data)), 1); rv < 0 { »
    August 27, 2015 at 1:16:10 PM UTC - permalink - https://github.com/packetbeat/gopacket/blob/master/pfring/pfring.go#L212
Links per page: 20 50 100
 
Mentions légales identiques à celles de mon blog | CC BY-SA 3.0

Shaarli - The personal, minimalist, super fast, database-free, bookmarking service by the Shaarli community