Commit 1d10b9e99d1b4a6a880d424ec791cde45cb04614
Exists in
master
and in
55 other branches
Merge with /home/wd/git/u-boot/custodian/u-boot-net
Showing 2 changed files Side-by-side Diff
doc/README.NetConsole
... | ... | @@ -38,6 +38,11 @@ |
38 | 38 | target IP address (or host name, assuming DNS is working). The script |
39 | 39 | can be interrupted by pressing ^T (CTRL-T). |
40 | 40 | |
41 | +Be aware that in some distributives (Fedora Core 5 at least) | |
42 | +usage of nc has been changed and -l and -p options are considered | |
43 | +as mutually exclusive. If nc complains about options provided, | |
44 | +you can just remove the -p option from the script. | |
45 | + | |
41 | 46 | It turns out that 'netcat' cannot be used to listen to broadcast |
42 | 47 | packets. We developed our own tool 'ncb' (see tools directory) that |
43 | 48 | listens to broadcast packets on a given port and dumps them to the |
net/net.c
... | ... | @@ -1424,6 +1424,26 @@ |
1424 | 1424 | /* XXX point to ip packet */ |
1425 | 1425 | (*packetHandler)((uchar *)ip, 0, 0, 0); |
1426 | 1426 | return; |
1427 | + case ICMP_ECHO_REQUEST: | |
1428 | +#ifdef ET_DEBUG | |
1429 | + printf ("Got ICMP ECHO REQUEST, return %d bytes \n", | |
1430 | + ETHER_HDR_SIZE + len); | |
1431 | +#endif | |
1432 | + memcpy (&et->et_dest[0], &et->et_src[0], 6); | |
1433 | + memcpy (&et->et_src[ 0], NetOurEther, 6); | |
1434 | + | |
1435 | + ip->ip_sum = 0; | |
1436 | + ip->ip_off = 0; | |
1437 | + NetCopyIP((void*)&ip->ip_dst, &ip->ip_src); | |
1438 | + NetCopyIP((void*)&ip->ip_src, &NetOurIP); | |
1439 | + ip->ip_sum = ~NetCksum((uchar *)ip, IP_HDR_SIZE_NO_UDP >> 1); | |
1440 | + | |
1441 | + icmph->type = ICMP_ECHO_REPLY; | |
1442 | + icmph->checksum = 0; | |
1443 | + icmph->checksum = ~NetCksum((uchar *)icmph, | |
1444 | + (len - IP_HDR_SIZE_NO_UDP) >> 1); | |
1445 | + (void) eth_send((uchar *)et, ETHER_HDR_SIZE + len); | |
1446 | + return; | |
1427 | 1447 | #endif |
1428 | 1448 | default: |
1429 | 1449 | return; |