> That's exactly what this feature was designed to *avoid*.
> 
> You can have a single socket bound to address INADDR_ANY and port 500,
> and use that one socket to send replies to clients, and use the proper
> source address (and port 500) on each.

Thanks for your patience.  I think I got it...

If I have UDP socket 's' bound to INADDR_ANY/500, can I do something like
(pardon my abstraction):

        init_cmsg(&msg);
        add_data(&msg, data, len);
        add_name(&msg, peers_sockaddr_ptr);  /* Assume len from sa_family */
        add_ancillary(&msg, IP{,V6}_PKTINFO, my_specific_local_addr)

        rc = sendmsg(s, &msg, 0);

and it'll send a UDP datagram that looks like:

        IP (my_specific_local_addr -> peer_addr) + UDP (500, peer_port) + data

correct?

If so, I'm golden.  :)

Thanks,
Dan
_______________________________________________
networking-discuss mailing list
[email protected]

Reply via email to