Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>@adjuster..</p> <p>Acctually, I just got it. When I'm setting <code>SO_BROADCAST</code>, I'm receiving 92 (Package not installed)</p> <p>What package should I install, then?</p> <hr> <p>Edit: The Kernel version is 2.6.18, and you are right! 92 is <code>ENOPROTOOPT</code></p> <pre><code>//Socket creation sock_create(AF_INET, SOCK_DGRAM, IPPROTO_UDP, &amp;sock); //Broadcasting int broadcast = 1; int err; if( (err = sock-&gt;ops-&gt;setsockopt(sock, SOL_SOCKET, SO_BROADCAST, (char *)&amp;broadcast, sizeof broadcast)) &lt; 0 ) { printk(KERN_ALERT MODULE_NAME ": Could not configure broadcast, error %d\n", err); return -1; } </code></pre> <hr> <p>Edit: I've got this from <code>setsockopt</code> <a href="http://linux.die.net/man/2/setsockopt" rel="nofollow noreferrer">man page</a>...</p> <blockquote> <p><strong><code>ENOPROTOOPT</code></strong><br> The option is unknown at the level indicated.</p> </blockquote> <p>...so, I supose that <code>SOL_SOCKET</code> isn't the right value to pass. I've also tried <code>IPPROTO_UDP</code> instead of <code>SOL_SOCKET</code> with no luck.</p> <hr> <p>Edit: <a href="http://docs.hp.com/en/32650-90372/ch02s10.html" rel="nofollow noreferrer">http://docs.hp.com/en/32650-90372/ch02s10.html</a> says that <code>SO_BROADCAST</code> is an option of the <code>SOL_SOCKET</code> level, but I continue to get -92</p> <hr> <p>Edit: I'm desperate, so I've tried <code>SOL_UDP</code>, still -92.<br> Yes, it is fun :) ... Good synergy! At the end (I hope we get there soon) let's assembly a definitive answer clean and nice! :)</p> <hr> <p>Edit: Even if a hard set the broadcast flag, the <code>sock_sendmsg</code> will fail (-13, "Permission denied")</p> <pre><code>sock-&gt;sk-&gt;sk_flags |= SO_BROADCAST; </code></pre> <p>I really need some help on this one..</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload