title: inet_ntoa problem
body: <p>I am declaring following variables</p>
  
  <pre><code>unsigned long   dstAddr;
  unsigned long   gateWay;
  unsigned long   mask;
  </code></pre>
  
  <p>These variables contains ipaddresses in network byte order. So when I am trying to print the dot notation using inet_ntoa function for mask variable sometimes it is printing strange values. The below code is in a while loop .. which loops for n times.</p>
  
  <pre><code>printf("%s\t%s\t%s\t",inet_ntoa(dstAddr),inet_ntoa(gateWay),inet_ntoa(mask));
  
    192.168.122.0         0.0.0.0    0.255.255.255    
  </code></pre>
  
  <p>but it should be </p>
  
  <pre><code>  192.168.122.0         0.0.0.0    255.255.255.0
  </code></pre>
  
  <p>I printed the HEX values of the variables and it shows ..</p>
  
  <pre><code>007aa8c0    00000000      ffffff00  
  </code></pre>
  
  <p>So is this because of inet_ntoa ??</p>
  
  <p>Actually I am trying to get the values of the declared variables from 254 routing table in kernel via NETLINKS. I guess I should still use inet_ntoa function to convert the value into dot notation .. ??</p>