[carl9170] carl9170 depends on usb
[10.03/openwrt.git] / package / dnsmasq / patches / 103-ipv6_fix.patch
1 Index: dnsmasq-2.51/src/netlink.c
2 ===================================================================
3 --- dnsmasq-2.51.orig/src/netlink.c
4 +++ dnsmasq-2.51/src/netlink.c
5 @@ -129,6 +129,7 @@ int iface_enumerate(void *parm, int (*ip
6    ssize_t len;
7    static unsigned int seq = 0;
8    int family = AF_INET;
9 +  int ipv4_done = 0;
10  
11    struct {
12      struct nlmsghdr nlh;
13 @@ -207,9 +208,12 @@ int iface_enumerate(void *parm, int (*ip
14                     rta = RTA_NEXT(rta, len1);
15                   }
16                 
17 -               if (addr.s_addr && ipv4_callback)
18 +               if (addr.s_addr && ipv4_callback) {
19                   if (!((*ipv4_callback)(addr, ifa->ifa_index, netmask, broadcast, parm)))
20                     return 0;
21 +                 else
22 +                   ipv4_done = 1;
23 +               }
24               }
25  #ifdef HAVE_IPV6
26             else if (ifa->ifa_family == AF_INET6)
27 @@ -225,7 +229,7 @@ int iface_enumerate(void *parm, int (*ip
28                 
29                 if (addrp && ipv6_callback)
30                   if (!((*ipv6_callback)(addrp, ifa->ifa_index, ifa->ifa_index, parm)))
31 -                   return 0;
32 +                   return ipv4_done;
33               }
34  #endif
35           }
36 Index: dnsmasq-2.51/src/network.c
37 ===================================================================
38 --- dnsmasq-2.51.orig/src/network.c
39 +++ dnsmasq-2.51/src/network.c
40 @@ -302,7 +302,7 @@ static int create_ipv6_listener(struct l
41        bind(tcpfd, (struct sockaddr *)&addr, sa_len(&addr)) == -1 ||
42        listen(tcpfd, 5) == -1 ||
43        bind(fd, (struct sockaddr *)&addr, sa_len(&addr)) == -1) 
44 -    return 0;
45 +    return 1;
46        
47    l = safe_malloc(sizeof(struct listener));
48    l->fd = fd;