- Timestamp:
- Nov 21, 2013 1:39:07 AM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 90797
- Location:
- trunk/src/VBox/Devices/Network/lwip-new/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/lwip-new/src/core/ipv6/icmp6.c
r47886 r49592 66 66 /* Forward declarations */ 67 67 static void icmp6_send_response(struct pbuf *p, u8_t code, u32_t data, u8_t type); 68 69 #if LWIP_CONNECTION_PROXY 70 static ping6_proxy_fn ping6_proxy_accept_callback; 71 static void *ping6_proxy_accept_arg; 72 #endif 68 73 69 74 … … 199 204 } 200 205 206 207 #if LWIP_CONNECTION_PROXY 208 209 void 210 ping6_proxy_accept(ping6_proxy_fn callback, void *arg) 211 { 212 ping6_proxy_accept_callback = callback; 213 ping6_proxy_accept_arg = arg; 214 } 215 216 217 void 218 icmp6_proxy_input(struct pbuf *p, struct netif *inp) 219 { 220 struct icmp6_hdr *icmp6hdr; 221 struct pbuf * r; 222 ip6_addr_t * reply_src; 223 224 ICMP6_STATS_INC(icmp6.recv); 225 226 /* Check that ICMPv6 header fits in payload */ 227 if (p->len < sizeof(struct icmp6_hdr)) { 228 /* drop short packets */ 229 pbuf_free(p); 230 ICMP6_STATS_INC(icmp6.lenerr); 231 ICMP6_STATS_INC(icmp6.drop); 232 return; 233 } 234 235 icmp6hdr = (struct icmp6_hdr *)p->payload; 236 if (ip6_chksum_pseudo(p, IP6_NEXTH_ICMP6, p->tot_len, ip6_current_src_addr(), 237 ip6_current_dest_addr()) != 0) { 238 /* Checksum failed */ 239 pbuf_free(p); 240 ICMP6_STATS_INC(icmp6.chkerr); 241 ICMP6_STATS_INC(icmp6.drop); 242 return; 243 } 244 245 switch (icmp6hdr->type) { 246 247 case ICMP6_TYPE_EREQ: 248 if (ping6_proxy_accept_callback != NULL) { 249 (*ping6_proxy_accept_callback)(ping6_proxy_accept_arg, p); 250 return; 251 } 252 ICMP6_STATS_INC(icmp6.drop); 253 break; 254 255 case ICMP6_TYPE_EREP: 256 /* ignore silently */ 257 ICMP6_STATS_INC(icmp6.drop); 258 break; 259 260 default: 261 ICMP6_STATS_INC(icmp6.drop); 262 break; 263 } 264 265 pbuf_free(p); 266 } 267 #endif /* LWIP_CONNECTION_PROXY */ 201 268 202 269 /** -
trunk/src/VBox/Devices/Network/lwip-new/src/core/ipv6/ip6.c
r49041 r49592 779 779 break; 780 780 #endif /* LWIP_TCP */ 781 782 #if LWIP_ICMP6 783 case IP6_NEXTH_ICMP6: 784 /* Point to payload. */ 785 pbuf_header(p, -ip_data.current_ip_header_tot_len); 786 icmp6_proxy_input(p, inp); 787 break; 788 #endif /* LWIP_ICMP */ 781 789 782 790 default: -
trunk/src/VBox/Devices/Network/lwip-new/src/include/ipv6/lwip/icmp6.h
r47886 r49592 137 137 138 138 void icmp6_input(struct pbuf *p, struct netif *inp); 139 #if LWIP_CONNECTION_PROXY 140 void icmp6_proxy_input(struct pbuf *p, struct netif *inp); 141 #endif 139 142 void icmp6_dest_unreach(struct pbuf *p, enum icmp6_dur_code c); 140 143 void icmp6_packet_too_big(struct pbuf *p, u32_t mtu); 141 144 void icmp6_time_exceeded(struct pbuf *p, enum icmp6_te_code c); 142 145 void icmp6_param_problem(struct pbuf *p, enum icmp6_pp_code c, u32_t pointer); 146 147 #if LWIP_CONNECTION_PROXY 148 typedef void (*ping6_proxy_fn)(void *arg, struct pbuf *p); 149 void ping6_proxy_accept(ping6_proxy_fn callback, void *arg); 150 #endif 143 151 144 152 #endif /* LWIP_ICMP6 && LWIP_IPV6 */
Note:
See TracChangeset
for help on using the changeset viewer.