mac address - Print the MAC addresses from the mac header of IEEE802.11 packet when extracted using sk_buff -
i writing module extracts mac address of ethernet mac header of wireless 802.11 packet. extract ethernetmac header
ieee = (struct ieee80211_hdr *)skb_mac_header(sock_buff); ieee->addr1[eth_alen]; ieee->addr2[eth_alen]; ieee->addr3[eth_alen];
i want print these addresses see values contains. how do using printk
, kern_info
currently using statement causes kernel in panic mode
printk(kern_info "the address %x:%x:%x:%x:%x:%x", ieee->addr1[0],ieee->addr1[1],ieee->addr1[2],ieee->addr1[3],ieee->addr1[4],ieee->addr1[5]);
hm, according this, addr1 u8 addr1[eth_len], so:
printk("mac %pm: \n", ieee->addr1);
Comments
Post a Comment