https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=278043

Mark Johnston <ma...@freebsd.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|New                         |Open
                 CC|                            |b...@freebsd.org,
                   |                            |gleb...@freebsd.org,
                   |                            |ma...@freebsd.org,
                   |                            |tue...@freebsd.org

--- Comment #2 from Mark Johnston <ma...@freebsd.org> ---
Indeed, bootpc_call() does this strange thing to ensure that the src addr of
DHCP requests has address 0.0.0.0:

 638                         /* Set netmask to 0.0.0.0 */                       
 639                         clear_sinaddr(sin);                                
 640                         error = ifioctl(bootp_so, SIOCAIFADDR,
(caddr_t)ifra,                                                                  
 641                             td);                                           
 642                         if (error != 0)                                    
 643                                 panic("%s: SIOCAIFADDR, error=%d",
__func__,                                                                       
 644                                     error);                                
 645                                                                            
 646                         error = sosend(bootp_so, (struct sockaddr *) &dst, 
 647                                        &auio, NULL, NULL, 0, td);          
 648                         if (error != 0)                                    
 649                                 printf("%s: sosend: %d state %08x\n",
__func__,                                                                       
 650                                     error, (int )bootp_so->so_state);      
 651                                                                            
 652                         /* Set netmask to 255.0.0.0 */                     
 653                         sin->sin_addr.s_addr = htonl(0xff000000);          
 654                         error = ifioctl(bootp_so, SIOCAIFADDR,
(caddr_t)ifra,                                                                  
 655                             td);                                           
 656                         if (error != 0)                                    
 657                                 panic("%s: SIOCAIFADDR, error=%d",
__func__,                                                                       
 658                                     error);

The sosend() causes udp_send() to connect the socket, resulting in an error
because the local address is 0.0.0.0.  We don't permit that since INADDR_ANY is
used as a sentinel value in the inpcb layer.  dhclient doesn't have this
problem since it uses BPF to write packets.

Any opinions on how best to fix this?

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to