Changes between Initial Version and Version 1 of Ticket #12377, comment 16


Ignore:
Timestamp:
Apr 11, 2015, 10:58:56 PM (4 years ago)
Author:
yawning
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #12377, comment 16

    initial v1  
    11This is an example of how to rewrite all of this code, to do the mostly right thing on Linux (For anything more recent than kernel 2.2 definitions of "more recent").  This supercedes the `getifaddr` code (which is broken), and is superior to the UDP trick since it doesn't make a random UDP socket.
    22
    3 Adapting it to fit into tor is left as an exercise for the student:
     3~~Adapting it to fit into tor is left as an exercise for the student:~~
    44https://gist.github.com/Yawning/c70d804d4b8ae78cc698
    55
    66The same socket type can also be used to have the kernel tell us when the IP address/routing table changed, which may be useful to some people.
    77
     8Edit: I lied about leaving it to the student.
     9
    810NB: Yes the code is ugly, I sort of threw it together.  No I will not do Darwin or Windows.