msantos / procket

Erlang interface to low level socket operations
http://blog.listincomprehension.com/search/label/procket
BSD 3-Clause "New" or "Revised" License
283 stars 80 forks source link

fixes ifindex/2 to return correct interface index #35

Closed GoelDeepak closed 7 years ago

GoelDeepak commented 7 years ago

@msantos Could you please take a look?

msantos commented 7 years ago

Hey @GoelDeepak ! Looks good! It seems if_index is now an unsigned 32-bit integer (assuming it was 8-bits before and that wasn't a mistake :):

struct if_nameindex
  {
    unsigned int if_index;  /* 1, 2, ... */
    char *if_name;      /* null terminated name: "eth0", ... */
  };

Thanks so much for the patch!