printk from iph->saddr stops my system
by Traumatan from LinuxQuestions.org on (#54S9T)
I am trying to print the IP address from the skb structure but I have no luck so far. After checking the documentation, I tried:
Code:printk(KERN_INFO "%pI4", iph->saddr);However, not only does it not work, it stops the system entirely.
First, how can this printk statement stop the whole system?
Second, what is the correct way to print the IP from the skb structure?
Edit: There were some notes when I compiled it, maybe they explain the problem?
Quote:


Code:printk(KERN_INFO "%pI4", iph->saddr);However, not only does it not work, it stops the system entirely.
First, how can this printk statement stop the whole system?
Second, what is the correct way to print the IP from the skb structure?
Edit: There were some notes when I compiled it, maybe they explain the problem?
Quote:
/include/linux/kern_levels.h:14:19: note: in expansion of macro KERN_SOH' 14 | #define KERN_INFO KERN_SOH "6" /* informational */ | ^~~~~~~~ /home/jens/bproram/test2.c:28:9: note: in expansion of macro KERN_INFO' 28 | printk(KERN_INFO "%pI4", iph->saddr); | ^~~~~~~~~ /home/jens/bproram/test2.c:28:21: note: format string is defined here 28 | printk(KERN_INFO "%pI4", iph->saddr); | ~^ |