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
20 20
21#include <linux/types.h>21#include <linux/types.h>
22#include <asm/byteorder.h>22#include <asm/byteorder.h>
23#include <linux/in.h>
24#include <linux/if.h>23#include <linux/if.h>
25#include <linux/in6.h>24#include <linux/in6.h>
26 25
@@ -154,7 +153,7 @@ struct icmp_ext_echo_iio { · 127 unmodified lines
154 struct {153 struct {
155 struct icmp_ext_echo_ctype3_hdr ctype3_hdr;154 struct icmp_ext_echo_ctype3_hdr ctype3_hdr;
156 union {155 union {
157 struct in_addr ipv4_addr;156 __be32 ipv4_addr;
158 struct in6_addr ipv6_addr;157 struct in6_addr ipv6_addr;
159 } ip_addr;158 } ip_addr;
160 } addr;159 } addr;
net/ipv4/icmp.c+1−1
@@ -1059,7 +1059,7 @@ static bool icmp_echo(struct sk_buff *skb) · 1058 unmodified lines
1059 if (ident_len != sizeof(iio->ident.addr.ctype3_hdr) +1059 if (ident_len != sizeof(iio->ident.addr.ctype3_hdr) +
1060 sizeof(struct in_addr))1060 sizeof(struct in_addr))
1061 goto send_mal_query;1061 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);
1063 break;1063 break;
1064#if IS_ENABLED(CONFIG_IPV6)1064#if IS_ENABLED(CONFIG_IPV6)
1065 case ICMP_AFI_IP6:1065 case ICMP_AFI_IP6: