History

icmp: fix lib conflict with trinity

Including <linux/in.h> and <netinet/in.h> in the dependencies breaks compilation of trinity due to multiple definitions. <linux/in.h> is only used in <linux/icmp.h> to provide the definition of the struct in_addr, but this can be substituted out by using the datatype __be32.

Andreas Roeseler committed 5 years ago

Commit e32ea441 parent 118de612 files · +2 −3Browse files

Unified · Split

2 files
  1. include/uapi/linux/icmp.h +1 −2
  2. net/ipv4/icmp.c +1 −1
include/uapi/linux/icmp.h+1−2
@@ -20,7 +20,6 @@ · 19 unmodified lines
2020
2121 #include <linux/types.h>
2222 #include <asm/byteorder.h>
23−#include <linux/in.h>
2423 #include <linux/if.h>
2524 #include <linux/in6.h>
2625
@@ -154,7 +153,7 @@ struct icmp_ext_echo_iio { · 127 unmodified lines
154153 struct {
155154 struct icmp_ext_echo_ctype3_hdr ctype3_hdr;
156155 union {
157− struct in_addr ipv4_addr;
156+ __be32 ipv4_addr;
158157 struct in6_addr ipv6_addr;
159158 } ip_addr;
160159 } addr;
net/ipv4/icmp.c+1−1
@@ -1059,7 +1059,7 @@ static bool icmp_echo(struct sk_buff *skb) · 1058 unmodified lines
10591059 if (ident_len != sizeof(iio->ident.addr.ctype3_hdr) +
10601060 sizeof(struct in_addr))
10611061 goto send_mal_query;
1062− dev = ip_dev_find(net, iio->ident.addr.ip_addr.ipv4_addr.s_addr);
1062+ dev = ip_dev_find(net, iio->ident.addr.ip_addr.ipv4_addr);
10631063 break;
10641064 #if IS_ENABLED(CONFIG_IPV6)
10651065 case ICMP_AFI_IP6: