NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/56995: dhcrelay dumps core when sending DHCP response packets



The following reply was made to PR bin/56995; it has been noted by GNATS.

From: mlelstv%serpens.de@localhost (Michael van Elst)
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: bin/56995: dhcrelay dumps core when sending DHCP response packets
Date: Mon, 5 Sep 2022 06:43:36 -0000 (UTC)

 lloyd%must-have-coffee.gen.nz@localhost writes:
 
 >#0  0x000000000b421b7d in assemble_udp_ip_header (interface=<optimized out>, 
 >    buf=0x77712edeeb70 "E\020\001S", bufix=0x77712edeeb1c, 
 >    from=<optimized out>, to=<optimized out>, port=17408, 
 >    data=0xb66c3a0 <fallback_interface> "", len=1392578629)
 >    at /home/lloyd/NetBSD/src/external/mpl/dhcp/lib/common/../../dist/common/packet.c:167
 
 >The line in question is
 >    udp.uh_sport = *libdhcp_callbacks.local_port /* XXX */
 
 There are other lines where local_port isn't assumed to be
 initialized correctly.
 
 
 >The problem is that the struct libdhcp_callbacks contains only null
 >pointers.
 
 Callbacks are initialized from a global variable:
 
 extern u_int16_t local_port;
 
 libdhcp_callbacks_t dhcrelay_callbacks = {
         &local_port,
         &remote_port,
         classify,
         check_collection,
         dhcp,
 #ifdef DHCPv6
         dhcpv6,
 #endif /* DHCPv6 */
         bootp,
         find_class,
         parse_allow_deny,
         dhcp_set_control_state,
 };
 
 and are supposed to be registered (copied to the global libdhcp_callbacks)
 at the very beginning of main()......
 
 except that in the netbsd-9.3 sources that line is missing. Looks like
 a mistake when merging with upstream sources in 2018..
 
 


Home | Main Index | Thread Index | Old Index