<p>If you don't *have* to use the actual socket library, you might want to have a look at scapy.  It's a packet manipulation program/library. It might make things a little easier.</p>
<p><a href="http://www.secdev.org/projects/scapy/">http://www.secdev.org/projects/scapy/</a></p>
<p> </p>
<div class="gmail_quote">On Jan 22, 2013 9:17 AM, "Peter Steele" <<a href="mailto:pwsteele@gmail.com">pwsteele@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I just tried running you code, and the "sendto" call fails with "Network is unreachable". That's what I expected, based on other tests I've done. That's why I was asking about how to do raw sockets, since tools like dhclient use raw sockets to do what they do. It can clearly be duplicated in Python, I just need to find some code samples on how to construct a raw packet.<br>

<br>
--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</blockquote></div>