[ipxe-devel] [ipxe/ipxe] [dhcp/ipv4] Support for DHCP option 121: Classless static route option (#67)

multun notifications at github.com
Mon Apr 30 23:34:35 UTC 2018


multun commented on this pull request.



> +			/* Extract routes and add them to routing table */
+			while ( i < option_len ) {
+				uint8_t c = raw_data[i];
+				i++;
+
+				/* Netmask */
+				addr_octets_len = cidr_to_mask ( c, buf );
+				inet_aton( buf, &netmask );
+
+				/* Address */
+				memset ( uaddr, 0, 4 * sizeof ( uint8_t ) );
+				for ( j = 0; j < addr_octets_len; j++ )
+					uaddr[j] = raw_data[i + j];
+
+				sprintf( buf, "%d.%d.%d.%d", uaddr[0], uaddr[1], uaddr[2], uaddr[3] );
+				inet_aton( buf, &address );

why don't you fill out the in_addr directly, using an union for example ?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/ipxe/ipxe/pull/67#pullrequestreview-116470963
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ipxe.org/pipermail/ipxe-devel/attachments/20180430/47d99345/attachment.htm>


More information about the ipxe-devel mailing list