Calling mnl_socket_sendto caused error of netlink attribute type 1 has an invalid length

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I have following error of attribute type 1 has an invalid length when
calling following mnl_socket_sendto(channel->mnlSocket, nlh,
nlh->nlmsg_len), I cannot see what was wrong about it, the
nlh->nlmsg_len = 40 which is from libnml, is that wrong? Please advise
how to fix it.

[ 3240.939609] netlink: 'wifi_signal': attribute type 1 has an invalid
length. I have a WiFi function using nml API:

typedef struct {
        struct mnl_socket *mnlSocket;
        char buf[BUFFER_SIZE];
        uint16_t channelId;
        uint32_t interfaceIndex;
        uint32_t sequence;
        void *context;
} __attribute__ ((packed)) Netlink80211Channel_t;

void WiFiScan::Send80211Message(struct nlmsghdr *nlh,
Netlink80211Channel_t *channel) {
    if (mnl_socket_sendto(channel->mnlSocket, nlh, nlh->nlmsg_len) < 0) {
         std::cout << "Failed to send socket" << std::endl;
    }
}

Thank you.

- jh



[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux