[packages] nprobe: fix autoreconf
[openwrt/svn-archive/archive.git] / net / nprobe / patches / 003-ipv6_fix.patch
1 --- a/nprobe.c
2 +++ b/nprobe.c
3 @@ -241,8 +241,10 @@ void processPacket(u_char *_deviceId,
4 u_short eth_type, off=0, numPkts = 1;
5 u_int8_t flags = 0, proto = 0;
6 struct ip ip;
7 + #ifndef IPV4_ONLY
8 struct ip6_hdr ipv6;
9 struct ip6_ext ipv6ext;
10 + #endif
11 struct tcphdr tp;
12 struct udphdr up;
13 struct icmp icmpPkt;
14 @@ -362,7 +364,9 @@ void processPacket(u_char *_deviceId,
15 isFragment = (ntohs(ip.ip_off) & 0x3fff) ? 1 : 0;
16
17 off = ntohs(ip.ip_off);
18 - } else if(eth_type == ETHERTYPE_IPV6) {
19 + }
20 + #ifndef IPV4_ONLY
21 + else if(eth_type == ETHERTYPE_IPV6) {
22 memcpy(&ipv6, p+ehshift, sizeof(struct ip6_hdr));
23 if(((ipv6.ip6_vfc >> 4) & 0x0f) != 6) return; /* IP v6 only */
24 estimatedLen = sizeof(struct ip6_hdr)+ehshift+htons(ipv6.ip6_plen);
25 @@ -392,7 +396,9 @@ void processPacket(u_char *_deviceId,
26 hlen += (ipv6ext.ip6e_len+1)*8;
27 proto = ipv6ext.ip6e_nxt;
28 }
29 - } else
30 + }
31 + #endif //IPV4_ONLY
32 + else
33 return; /* Anything else that's not IPv4/v6 */
34
35 plen = length-ehshift;