Changeset 50185 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Jan 23, 2014 4:19:13 PM (11 years ago)
- Location:
- trunk/src/VBox/Devices/Network/lwip-new
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/lwip-new/CHANGELOG
r50173 r50185 80 80 81 81 ++ Bugfixes: 82 83 2014-01-17: Grant Erickson, Jay Logue, Simon Goldschmidt 84 * ipv6.c, netif.c: patch #7913 Enable Support for IPv6 Loopback 85 86 2014-01-16: Stathis Voukelatos 87 * netif.c: patch #7902 Fixed netif_poll() operation when LWIP_LOOPBACK_MAX_PBUFS > 0 82 88 83 89 2014-01-14: "Freddie Chopin" -
trunk/src/VBox/Devices/Network/lwip-new/src/core/ipv4/ip4.c
r49854 r50185 880 880 /* Packet to self, enqueue it for loopback */ 881 881 LWIP_DEBUGF(IP_DEBUG, ("netif_loop_output()")); 882 return netif_loop_output(netif, p , dest);882 return netif_loop_output(netif, p); 883 883 } 884 884 #if LWIP_IGMP 885 885 if ((p->flags & PBUF_FLAG_MCASTLOOP) != 0) { 886 netif_loop_output(netif, p , dest);886 netif_loop_output(netif, p); 887 887 } 888 888 #endif /* LWIP_IGMP */ -
trunk/src/VBox/Devices/Network/lwip-new/src/core/ipv6/ip6.c
r50020 r50185 948 948 949 949 #if ENABLE_LOOPBACK 950 /* TODO implement loopback for v6 951 if (ip6_addr_cmp(dest, netif_ip6_addr(0))) { 952 return netif_loop_output(netif, p, dest); 953 }*/ 950 { 951 int i; 952 for (i = 0; i < LWIP_IPV6_NUM_ADDRESSES; i++) { 953 if (ip6_addr_isvalid(netif_ip6_addr_state(netif, i)) && 954 ip6_addr_cmp(dest, netif_ip6_addr(netif, i))) { 955 /* Packet to self, enqueue it for loopback */ 956 LWIP_DEBUGF(IP6_DEBUG, ("netif_loop_output()\n")); 957 return netif_loop_output(netif, p); 958 } 959 } 960 } 954 961 #endif /* ENABLE_LOOPBACK */ 955 962 #if LWIP_IPV6_FRAG … … 960 967 #endif /* LWIP_IPV6_FRAG */ 961 968 962 LWIP_DEBUGF(IP6_DEBUG, ("netif->output_ip6() "));969 LWIP_DEBUGF(IP6_DEBUG, ("netif->output_ip6()\n")); 963 970 return netif->output_ip6(netif, p, dest); 964 971 } -
trunk/src/VBox/Devices/Network/lwip-new/src/core/netif.c
r48287 r50185 89 89 #endif /* LWIP_IPV6 */ 90 90 91 #if LWIP_IPV6 92 #define ipX_input(in, netif) (IP6H_V((const struct ip6_hdr *)in->payload) == 6) ? ip6_input(in, netif) : ip_input(in, netif) 93 #else 94 #define ipX_input(in, netif) ip_input(in, netif) 95 #endif 96 91 97 #if LWIP_HAVE_LOOPIF 98 static err_t netif_loop_output_ipv4(struct netif *netif, struct pbuf *p, ip_addr_t* addr); 99 #if LWIP_IPV6 100 static err_t netif_loop_output_ipv6(struct netif *netif, struct pbuf *p, ip6_addr_t* addr); 101 #endif 102 103 92 104 static struct netif loop_netif; 93 105 … … 109 121 netif->name[0] = 'l'; 110 122 netif->name[1] = 'o'; 111 netif->output = netif_loop_output; 123 netif->output = netif_loop_output_ipv4; 124 #if LWIP_IPV6 125 netif->output_ip6 = netif_loop_output_ipv6; 126 #endif 112 127 return ERR_OK; 113 128 } … … 128 143 netif_add(&loop_netif, &loop_ipaddr, &loop_netmask, &loop_gw, NULL, netif_loopif_init, tcpip_input); 129 144 #endif /* NO_SYS */ 145 146 #if LWIP_IPV6 147 loop_netif.ip6_addr[0].addr[0] = 0; 148 loop_netif.ip6_addr[0].addr[1] = 0; 149 loop_netif.ip6_addr[0].addr[2] = 0; 150 loop_netif.ip6_addr[0].addr[3] = PP_HTONL(0x00000001UL); 151 loop_netif.ip6_addr_state[0] = IP6_ADDR_VALID; 152 #endif /* LWIP_IPV6 */ 153 130 154 netif_set_up(&loop_netif); 131 155 … … 656 680 * @param netif the lwip network interface structure 657 681 * @param p the (IP) packet to 'send' 658 * @param ipaddr the ip address to send the packet to (not used)659 682 * @return ERR_OK if the packet has been sent 660 683 * ERR_MEM if the pbuf used to copy the packet couldn't be allocated 661 684 */ 662 685 err_t 663 netif_loop_output(struct netif *netif, struct pbuf *p, 664 ip_addr_t *ipaddr) 686 netif_loop_output(struct netif *netif, struct pbuf *p) 665 687 { 666 688 struct pbuf *r; … … 680 702 #endif /* LWIP_SNMP */ 681 703 SYS_ARCH_DECL_PROTECT(lev); 682 LWIP_UNUSED_ARG(ipaddr);683 704 684 705 /* Allocate a new pbuf */ … … 741 762 return ERR_OK; 742 763 } 764 765 static err_t 766 netif_loop_output_ipv4(struct netif *netif, struct pbuf *p, ip_addr_t* addr) 767 { 768 LWIP_UNUSED_ARG(addr); 769 return netif_loop_output(netif, p); 770 } 771 772 #if LWIP_IPV6 773 static err_t 774 netif_loop_output_ipv6(struct netif *netif, struct pbuf *p, ip6_addr_t* addr) 775 { 776 LWIP_UNUSED_ARG(addr); 777 return netif_loop_output(netif, p); 778 } 779 #endif 780 743 781 744 782 /** … … 770 808 struct pbuf *in_end = in; 771 809 #if LWIP_LOOPBACK_MAX_PBUFS 772 u8_t clen = pbuf_clen(in); 810 u8_t clen = 1; 811 #endif /* LWIP_LOOPBACK_MAX_PBUFS */ 812 while (in_end->len != in_end->tot_len) { 813 LWIP_ASSERT("bogus pbuf: len != tot_len but next == NULL!", in_end->next != NULL); 814 in_end = in_end->next; 815 #if LWIP_LOOPBACK_MAX_PBUFS 816 clen++; 817 #endif /* LWIP_LOOPBACK_MAX_PBUFS */ 818 } 819 #if LWIP_LOOPBACK_MAX_PBUFS 773 820 /* adjust the number of pbufs on queue */ 774 821 LWIP_ASSERT("netif->loop_cnt_current underflow", … … 776 823 netif->loop_cnt_current -= clen; 777 824 #endif /* LWIP_LOOPBACK_MAX_PBUFS */ 778 while (in_end->len != in_end->tot_len) { 779 LWIP_ASSERT("bogus pbuf: len != tot_len but next == NULL!", in_end->next != NULL); 780 in_end = in_end->next; 781 } 825 782 826 /* 'in_end' now points to the last pbuf from 'in' */ 783 827 if (in_end == netif->loop_last) { … … 799 843 snmp_inc_ifinucastpkts(stats_if); 800 844 /* loopback packets are always IP packets! */ 801 if (ip _input(in, netif) != ERR_OK) {845 if (ipX_input(in, netif) != ERR_OK) { 802 846 pbuf_free(in); 803 847 } -
trunk/src/VBox/Devices/Network/lwip-new/src/include/ipv6/lwip/ip6_addr.h
r49586 r50185 171 171 ((ip6addr)->addr[3] == 0))) 172 172 173 #define ip6_addr_isloopback(ip6addr) (((ip6addr)->addr[0] == 0UL) && \ 174 ((ip6addr)->addr[1] == 0UL) && \ 175 ((ip6addr)->addr[2] == 0UL) && \ 176 ((ip6addr)->addr[3] == PP_HTONL(0x00000001UL))) 173 177 174 178 #define ip6_addr_isglobal(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xe0000000UL)) == PP_HTONL(0x20000000UL)) -
trunk/src/VBox/Devices/Network/lwip-new/src/include/lwip/netif.h
r47886 r50185 360 360 361 361 #if ENABLE_LOOPBACK 362 err_t netif_loop_output(struct netif *netif, struct pbuf *p , ip_addr_t *dest_ip);362 err_t netif_loop_output(struct netif *netif, struct pbuf *p); 363 363 void netif_poll(struct netif *netif); 364 364 #if !LWIP_NETIF_LOOPBACK_MULTITHREADING
Note:
See TracChangeset
for help on using the changeset viewer.