Re: bind() not working for outbound socket connections...
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com On May 22, 2005, at 3:56 AM, Philip George wrote: On May 22, 2005, at 3:43 AM, Giuliano Gavazzi wrote: now THIS is the kind of thinking it's gonna take to get this working! great suggestion, and creative. i have a couple of questions about this suggestion: [1] if i add a route, how do i make sure that the new route is chosen and nothing else? [2] after using it, does the route need to be removed explicitly, or is closing the socket i used thru it enough? [3] does adding a new route or deleting a route only apply to the context of my app or does it affect the entire system? It's a system wide setting (that's why it's a privileged operation) [4] i have already played with this a little, but the examples i'm going off of are a little over-the-top. if you know of a simple example of how this is done in C, please post a link. Vincent Giuliano, you rock. - philip _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/vlubet%40apple.com This email sent to vlubet@apple.com _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... well, would it not be enough to add manually a route for the particular remote ip/net going through the dead router (and thus the interface he wants)? it requires that my app will have to be set to run as root unfortunately, but at this point i'm desperate. plus, i've buttoned up all possible places where buffers are flooded with user input. everything's bounds-checked. The routing engine picks the route that is the more specific for the destination address. A host route is the more specific kind of route, so simply add a host route with the IP address of the dead router. You need to remove the route yourself, there is no connection between the socket layer and the routing table. I suggest to have a look at the source code of the "route" command in Darwin or FreeBSD repository. and by the way, Giuliano, thanks for actually helping out instead of talking down to me and then giving me a reading assignment. i've been plagued with unhelpful responses on this issue on three lists... mostly from the same guy chasing me from list to list. Because you have out of the ordinary requirements you really need to understand what you are doing especially when changing system wide settings. This email sent to site_archiver@lists.apple.com
participants (1)
-
Vincent Lubet