Merge branch 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/roland/infiniband
[firefly-linux-kernel-4.4.55.git] / include / linux / icmp.h
index f0b571f1060ba23aa0542d1bc33943e2fbd0ef75..474f2a51cf0af66474be229b626403975a36683c 100644 (file)
 struct icmphdr {
   __u8         type;
   __u8         code;
-  __u16                checksum;
+  __sum16      checksum;
   union {
        struct {
-               __u16   id;
-               __u16   sequence;
+               __be16  id;
+               __be16  sequence;
        } echo;
-       __u32   gateway;
+       __be32  gateway;
        struct {
-               __u16   __unused;
-               __u16   mtu;
+               __be16  __unused;
+               __be16  mtu;
        } frag;
   } un;
 };
 
+#ifdef __KERNEL__
+#include <linux/skbuff.h>
+
+static inline struct icmphdr *icmp_hdr(const struct sk_buff *skb)
+{
+       return (struct icmphdr *)skb_transport_header(skb);
+}
+#endif
+
 /*
  *     constants for (set|get)sockopt
  */