X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=net%2Fnet.c;h=506203761f43bb54d4115f3715b50b807a35b423;hb=795bee849603c7c2994ba20fcd96f3f9835ffd96;hp=d1a15e2a096d81a07a2e5c8fcb6d8f9240713784;hpb=84bd92bdda05e6aaae3150ed6ef957b3a67398b7;p=oweals%2Fu-boot.git diff --git a/net/net.c b/net/net.c index d1a15e2a09..506203761f 100644 --- a/net/net.c +++ b/net/net.c @@ -222,8 +222,10 @@ void ArpRequest (void) (NetOurIP & NetOurSubnetMask)) { if (NetOurGatewayIP == 0) { puts ("## Warning: gatewayip needed but not set\n"); + NetArpWaitReplyIP = NetArpWaitPacketIP; + } else { + NetArpWaitReplyIP = NetOurGatewayIP; } - NetArpWaitReplyIP = NetOurGatewayIP; } else { NetArpWaitReplyIP = NetArpWaitPacketIP; } @@ -461,7 +463,7 @@ restart: /* * Echo the inverted link state to the fault LED. */ - if(miiphy_link(CFG_FAULT_MII_ADDR)) { + if(miiphy_link(eth_get_dev()->name, CFG_FAULT_MII_ADDR)) { status_led_set (STATUS_LED_RED, STATUS_LED_OFF); } else { status_led_set (STATUS_LED_RED, STATUS_LED_ON); @@ -512,7 +514,7 @@ restart: /* * Echo the inverted link state to the fault LED. */ - if(miiphy_link(CFG_FAULT_MII_ADDR)) { + if(miiphy_link(eth_get_dev()->name, CFG_FAULT_MII_ADDR)) { status_led_set (STATUS_LED_RED, STATUS_LED_OFF); } else { status_led_set (STATUS_LED_RED, STATUS_LED_ON); @@ -829,7 +831,10 @@ static ushort CDP_compute_csum(const uchar *buff, ushort len) } if (len) { leftover = (signed short)(*(const signed char *)buff); - /* * XXX CISCO SUCKS big time! (and blows too) */ + /* CISCO SUCKS big time! (and blows too): + * CDP uses the IP checksum algorithm with a twist; + * for the last byte it *sign* extends and sums. + */ result = (result & 0xffff0000) | ((result + leftover) & 0x0000ffff); } while (result >> 16)