Parcourir la source

Set DHCP_MESSAGE_TYPE option within the main options block. This

doesn't seem to be required by the RFCs, but at least ISC dhcpd and
ethereal refuse to recognise it otherwise.
tags/v0.9.3
Michael Brown il y a 18 ans
Parent
révision
9ad5cede96
1 fichiers modifiés avec 8 ajouts et 6 suppressions
  1. 8
    6
      src/net/udp/dhcp.c

+ 8
- 6
src/net/udp/dhcp.c Voir le fichier

232
 	struct dhcphdr *dhcphdr = data;
232
 	struct dhcphdr *dhcphdr = data;
233
 	static const uint8_t overloading = ( DHCP_OPTION_OVERLOAD_FILE |
233
 	static const uint8_t overloading = ( DHCP_OPTION_OVERLOAD_FILE |
234
 					     DHCP_OPTION_OVERLOAD_SNAME );
234
 					     DHCP_OPTION_OVERLOAD_SNAME );
235
-	int rc;
236
 
235
 
237
 	/* Sanity check */
236
 	/* Sanity check */
238
 	if ( max_len < sizeof ( *dhcphdr ) )
237
 	if ( max_len < sizeof ( *dhcphdr ) )
264
 			       sizeof ( overloading ) ) == NULL )
263
 			       sizeof ( overloading ) ) == NULL )
265
 		return -ENOSPC;
264
 		return -ENOSPC;
266
 
265
 
267
-	/* Set DHCP_MESSAGE_TYPE option */
268
-	if ( ( rc = set_dhcp_packet_option ( dhcppkt, DHCP_MESSAGE_TYPE,
269
-					     &msgtype,
270
-					     sizeof ( msgtype ) ) ) != 0 )
271
-		return rc;
266
+	/* Set DHCP_MESSAGE_TYPE option within the main options block.
267
+	 * This doesn't seem to be required by the RFCs, but at least
268
+	 * ISC dhcpd and ethereal refuse to recognise it otherwise.
269
+	 */
270
+	if ( set_dhcp_option ( &dhcppkt->options[OPTS_MAIN],
271
+			       DHCP_MESSAGE_TYPE, &msgtype,
272
+			       sizeof ( msgtype ) ) == NULL )
273
+		return -ENOSPC;
272
 
274
 
273
 	return 0;
275
 	return 0;
274
 }
276
 }

Chargement…
Annuler
Enregistrer