Browse Source

[IPv4] Fix multicast address checking

From: Viswanath Krishnamurthy <viswa.krish@gmail.com>

The current ipv4 incorrectly checks the IP address for multicast address.
This causes valid IPv4 unicast address to be trated as multicast address

For e.g if the PXE/tftp server IP address is 192.168.4.XXX where XXX is
224 or greater, it gets treated as multicast address and a ethernet
multicast address is sent out on the wire causing timeouts
tags/v0.9.4
Michael Brown 16 years ago
parent
commit
1dcc60e5ad
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      src/net/ipv4.c

+ 1
- 1
src/net/ipv4.c View File

273
 		memcpy ( ll_dest, ll_protocol->ll_broadcast,
273
 		memcpy ( ll_dest, ll_protocol->ll_broadcast,
274
 			 ll_protocol->ll_addr_len );
274
 			 ll_protocol->ll_addr_len );
275
 		return 0;
275
 		return 0;
276
-	} else if ( IN_MULTICAST ( dest.s_addr ) ) {
276
+	} else if ( IN_MULTICAST ( ntohl ( dest.s_addr ) ) ) {
277
 		/* Special case: IPv4 multicast over Ethernet.	This
277
 		/* Special case: IPv4 multicast over Ethernet.	This
278
 		 * code may need to be generalised once we find out
278
 		 * code may need to be generalised once we find out
279
 		 * what happens for other link layers.
279
 		 * what happens for other link layers.

Loading…
Cancel
Save