Ticket #19: 03_cmsg_too_large.patch

File 03_cmsg_too_large.patch, 0.9 kB (added by Sjoerd Simons <sjoerd@…>, 4 years ago)

Proposed patch. Tested on 64 bit sparc (ultra 5) and 64 bit powerpc (G5)

  • avahi-core/socket.c

     
    465465    struct iovec io; 
    466466#ifdef IP_PKTINFO 
    467467    struct cmsghdr *cmsg; 
    468     size_t cmsg_data[( CMSG_SPACE(sizeof(struct in_pktinfo)) / sizeof(size_t)) + 1]; 
     468    uint8_t cmsg_data[CMSG_SPACE(sizeof(struct in_pktinfo))]; 
    469469#elif defined(IP_SENDSRCADDR) 
    470470    struct cmsghdr *cmsg; 
    471     size_t cmsg_data[( CMSG_SPACE(sizeof(struct in_addr)) / sizeof(size_t)) + 1]; 
     471    uint8_t cmsg_data[CMSG_SPACE(sizeof(struct in_addr))]; 
    472472#endif 
    473473 
    474474    assert(fd >= 0); 
     
    551551    struct msghdr msg; 
    552552    struct iovec io; 
    553553    struct cmsghdr *cmsg; 
    554     size_t cmsg_data[(CMSG_SPACE(sizeof(struct in6_pktinfo))/sizeof(size_t)) + 1]; 
     554    size_t cmsg_data[CMSG_SPACE(sizeof(struct in6_pktinfo))]; 
    555555 
    556556    assert(fd >= 0); 
    557557    assert(p);