Ticket #9: avahi-0.6.5-bz179448.3.patch

File avahi-0.6.5-bz179448.3.patch, 1.3 kB (added by Jason Vas Dias<jvdias@…>, 6 years ago)

Updated patch using size_t instead of 'struct cmsghdr' for buffers

  • avahi-0.6.6/avahi-core/socket.c

    old new  
    456456    struct iovec io; 
    457457#ifdef IP_PKTINFO 
    458458    struct cmsghdr *cmsg; 
    459     uint8_t cmsg_data[CMSG_SPACE(sizeof(struct in_pktinfo))]; 
     459    size_t cmsg_data[( CMSG_SPACE(sizeof(struct in_pktinfo)) / sizeof(size_t)) + 1]; 
    460460#elif defined(IP_SENDSRCADDR) 
    461461    struct cmsghdr *cmsg; 
    462     uint8_t cmsg_data[CMSG_SPACE(sizeof(struct in_addr))]; 
     462    size_t cmsg_data[( CMSG_SPACE(sizeof(struct in_addr)) / sizeof(size_t)) + 1]; 
    463463#endif 
    464464 
    465465    assert(fd >= 0); 
     
    542542    struct msghdr msg; 
    543543    struct iovec io; 
    544544    struct cmsghdr *cmsg; 
    545     uint8_t cmsg_data[CMSG_SPACE(sizeof(struct in6_pktinfo))]; 
     545    size_t cmsg_data[(CMSG_SPACE(sizeof(struct in6_pktinfo))/sizeof(size_t)) + 1]; 
    546546 
    547547    assert(fd >= 0); 
    548548    assert(p); 
     
    596596    AvahiDnsPacket *p= NULL; 
    597597    struct msghdr msg; 
    598598    struct iovec io; 
    599     uint8_t aux[1024]; 
     599    size_t aux[1024 / sizeof(size_t)]; /* for alignment on ia64 ! */ 
    600600    ssize_t l; 
    601601    struct cmsghdr *cmsg; 
    602602    int found_addr = 0; 
     
    726726    AvahiDnsPacket *p = NULL; 
    727727    struct msghdr msg; 
    728728    struct iovec io; 
    729     uint8_t aux[64]; 
     729    size_t aux[1024 / sizeof(size_t)]; 
    730730    ssize_t l; 
    731731    int ms; 
    732732    struct cmsghdr *cmsg;