Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Help to understand.
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Nethfel" data-source="post: 1072415" data-attributes="member: 89124"><p><-- update edit --></p><p>I did a search on struct iphdr osx and it appears to not exist in the form you're using it. as you can see in this broken code: <a href="http://lists.linux-ha.org/pipermail/linux-ha/2010-March/040031.html" target="_blank">http://lists.linux-ha.org/pipermail/linux-ha/2010-March/040031.html</a> where it mentions struct iphdr not existing</p><p></p><p>I wouldn't be surprised if this line:</p><p>[code]</p><p>char sendbuf[sizeof(struct iphdr) + sizeof(struct icmp) + 1400];</p><p>[/code]</p><p></p><p>still doesn't work quite right as you're dynamically declaring the size of an array using a method usually used for statically sized arrays (ie: using the []) At least the way I was taught, if you're creating an array that is dynamically sized (as sizeof is calculated at runtime not compile time) you'd use a pointer and malloc/free to allocate and release the memory.</p><p></p><p><-- end update edit --></p><p></p><p><-- original post deleted --></p></blockquote><p></p>
[QUOTE="Nethfel, post: 1072415, member: 89124"] <-- update edit --> I did a search on struct iphdr osx and it appears to not exist in the form you're using it. as you can see in this broken code: [url]http://lists.linux-ha.org/pipermail/linux-ha/2010-March/040031.html[/url] where it mentions struct iphdr not existing I wouldn't be surprised if this line: [code] char sendbuf[sizeof(struct iphdr) + sizeof(struct icmp) + 1400]; [/code] still doesn't work quite right as you're dynamically declaring the size of an array using a method usually used for statically sized arrays (ie: using the []) At least the way I was taught, if you're creating an array that is dynamically sized (as sizeof is calculated at runtime not compile time) you'd use a pointer and malloc/free to allocate and release the memory. <-- end update edit --> <-- original post deleted --> [/QUOTE]
Verification
Post reply
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Help to understand.
Top