1
10
13
14
20
21
22
23
24
25
26
27
28
29
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
119
120
121
122
123
124
125
126
127
128
129
131
132
133
134
135
136
137
138
140
141
142
143
144
145
146
147
148
149
150
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
199
200
201
202
203
205
206
211
215
216
217
218
219
224
225
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
277
278
281
282
287
288
295
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
332
333
338
339
340
341
342
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
369
370
374
375
376
377
378
379
380
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
421
422
423
424
425
426
427
437
443
444
445
446
447
457
458
459
460
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
534
535
536
537
538
539
540
541
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
596
597
598
604
605
606
614
615
616
617
621
622
623
624
625
626
627
628
629
630
632
633
634
635
636
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
667
674
675
676
677
678
679
680
681
682
683
684
685
686
691
692
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
...
...
...
#define NX_SOURCE_CODE
#include "nx_api.h"
#include "nx_ip.h"
#include "nx_ipv6.h"
#include "nx_icmp.h"
#include "nx_packet.h"
5 includes
#ifdef NX_IPSEC_ENABLE
#include "nx_ipsec.h"
#endif
...
...
UINT _nx_ip_dispatch_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT protocol)
{
UINT drop_packet;
#ifdef FEATURE_NX_IPV6
NXD_IPV6_ADDRESS *incoming_addr;
UINT next_option_offset;
#ifndef NX_DISABLE_ICMPV6_ERROR_MESSAGE
UINT nx_packet_option_offset;
#endif /* ... */
#endif
#ifdef NX_IPSEC_ENABLE
UINT ret;
ULONG next_protocol = 0;
NXD_ADDRESS src_addr, dest_addr;
#ifndef NX_DISABLE_IPV4
NX_IPV4_HEADER *ipv4_header;
#endif
#ifdef FEATURE_NX_IPV6
NX_IPV6_HEADER *ipv6_header;
NX_ICMPV6_HEADER *icmp_header_ptr;/* ... */
#endif /* ... */
#endif
drop_packet = 0;
#ifdef FEATURE_NX_IPV6
next_option_offset = (UINT)sizeof(NX_IPV6_HEADER);
incoming_addr = packet_ptr -> nx_packet_address.nx_packet_ipv6_address_ptr;/* ... */
#endif
while (!drop_packet)
{
NX_PACKET_DEBUG(__FILE__, __LINE__, packet_ptr);
#if defined(FEATURE_NX_IPV6) && !defined(NX_DISABLE_ICMPV6_ERROR_MESSAGE)
nx_packet_option_offset = packet_ptr -> nx_packet_option_offset;/* ... */
#endif
switch (protocol)
{
#ifdef FEATURE_NX_IPV6
case NX_PROTOCOL_NEXT_HEADER_HOP_BY_HOP:
if (packet_ptr -> nx_packet_option_state >= (UCHAR)HOP_BY_HOP_HEADER)
{
drop_packet = 1;
#ifndef NX_DISABLE_ICMPV6_ERROR_MESSAGE
NX_ICMPV6_SEND_PARAMETER_PROBLEM(ip_ptr, packet_ptr, 1, nx_packet_option_offset);
#endif
}if (packet_ptr -> nx_packet_option_state >= (UCHAR)HOP_BY_HOP_HEADER) { ... }
else
{
packet_ptr -> nx_packet_option_state = (UCHAR)HOP_BY_HOP_HEADER;
drop_packet = _nx_ipv6_process_hop_by_hop_option(ip_ptr, packet_ptr);
}else { ... }
break;
case NX_PROTOCOL_NEXT_HEADER_HOP_BY_HOP:
case NX_PROTOCOL_NEXT_HEADER_DESTINATION:
if (packet_ptr -> nx_packet_destination_header >= 1)
{
/* ... */
if ((packet_ptr -> nx_packet_option_state < (UCHAR)DESTINATION_HEADER_1) ||
(packet_ptr -> nx_packet_destination_header > 1))
{
drop_packet = 1;
}if ((packet_ptr -> nx_packet_option_state < (UCHAR)DESTINATION_HEADER_1) || (packet_ptr -> nx_packet_destination_header > 1)) { ... }
else
{
packet_ptr -> nx_packet_option_state = (UCHAR)DESTINATION_HEADER_2;
}else { ... }
}if (packet_ptr -> nx_packet_destination_header >= 1) { ... }
else
{
/* ... */
if (packet_ptr -> nx_packet_option_state < (UCHAR)ROUTING_HEADER)
{
packet_ptr -> nx_packet_option_state = (UCHAR)DESTINATION_HEADER_1;
}if (packet_ptr -> nx_packet_option_state < (UCHAR)ROUTING_HEADER) { ... }
else
{
packet_ptr -> nx_packet_option_state = (UCHAR)DESTINATION_HEADER_2;
}else { ... }
}else { ... }
packet_ptr -> nx_packet_destination_header++;
if (!drop_packet)
{
drop_packet = _nx_ipv6_process_hop_by_hop_option(ip_ptr, packet_ptr);
}if (!drop_packet) { ... }
#ifndef NX_DISABLE_ICMPV6_ERROR_MESSAGE
else
{
NX_ICMPV6_SEND_PARAMETER_PROBLEM(ip_ptr, packet_ptr, 1, nx_packet_option_offset);
}else { ... }
/* ... */#endif
break;
case NX_PROTOCOL_NEXT_HEADER_DESTINATION:
case NX_PROTOCOL_NEXT_HEADER_ROUTING:
if (packet_ptr -> nx_packet_option_state >= (UCHAR)ROUTING_HEADER)
{
#ifndef NX_DISABLE_ICMPV6_ERROR_MESSAGE
NX_ICMPV6_SEND_PARAMETER_PROBLEM(ip_ptr, packet_ptr, 1, nx_packet_option_offset);
#endif
drop_packet = 1;
}if (packet_ptr -> nx_packet_option_state >= (UCHAR)ROUTING_HEADER) { ... }
else
{
packet_ptr -> nx_packet_option_state = (UCHAR)ROUTING_HEADER;
drop_packet = _nx_ipv6_process_routing_option(ip_ptr, packet_ptr);
}else { ... }
break;
case NX_PROTOCOL_NEXT_HEADER_ROUTING:
case NX_PROTOCOL_NEXT_HEADER_FRAGMENT:
#ifndef NX_DISABLE_FRAGMENTATION
if (packet_ptr -> nx_packet_option_state >= (UCHAR)FRAGMENT_HEADER)
{
#endif
#ifndef NX_DISABLE_ICMPV6_ERROR_MESSAGE
NX_ICMPV6_SEND_PARAMETER_PROBLEM(ip_ptr, packet_ptr, 1, nx_packet_option_offset);
#endif
drop_packet = 1;
#ifndef NX_DISABLE_FRAGMENTATION
}if (packet_ptr -> nx_packet_option_state >= (UCHAR)FRAGMENT_HEADER) { ... }
else
{
packet_ptr -> nx_packet_option_state = (UCHAR)FRAGMENT_HEADER;
#ifdef NX_ENABLE_LOW_WATERMARK
if (packet_ptr -> nx_packet_pool_owner -> nx_packet_pool_available >=
packet_ptr -> nx_packet_pool_owner -> nx_packet_pool_low_watermark)/* ... */
#endif
{
drop_packet = _nx_ipv6_process_fragment_option(ip_ptr, packet_ptr);
...}
#ifdef NX_ENABLE_LOW_WATERMARK
else
{
drop_packet = NX_POOL_ERROR;
}else { ... }
/* ... */#endif
if (drop_packet != NX_CONTINUE)
{
/* ... */
return(drop_packet);
}if (drop_packet != NX_CONTINUE) { ... }
else
{
drop_packet = 0;
}else { ... }
}else { ... }
#endif
break;
case NX_PROTOCOL_NEXT_HEADER_FRAGMENT:
case NX_PROTOCOL_NO_NEXT_HEADER:
drop_packet = 1;
break;
/* ... */
#endif
case NX_PROTOCOL_NEXT_HEADER_AUTHENTICATION:
#ifdef NX_IPSEC_ENABLE
if (ip_ptr -> nx_ip_ipsec_authentication_header_receive == NX_NULL)
{
return(1);
}if (ip_ptr -> nx_ip_ipsec_authentication_header_receive == NX_NULL) { ... }
else
{
ret = ip_ptr -> nx_ip_ipsec_authentication_header_receive(ip_ptr, packet_ptr, &next_protocol, &packet_ptr);
if (ret == NX_SUCCESS)
{
return(0);
}if (ret == NX_SUCCESS) { ... }
if (ret != NX_IPSEC_PKT_CONT)
{
return(1);
}if (ret != NX_IPSEC_PKT_CONT) { ... }
}else { ... }
/* ... */#else
drop_packet = 1;/* ... */
#endif
break;
case NX_PROTOCOL_NEXT_HEADER_AUTHENTICATION:
case NX_PROTOCOL_NEXT_HEADER_ENCAP_SECURITY:
#ifdef NX_IPSEC_ENABLE
if (ip_ptr -> nx_ip_ipsec_encapsulating_security_payload_receive == NX_NULL)
{
return(1);
}if (ip_ptr -> nx_ip_ipsec_encapsulating_security_payload_receive == NX_NULL) { ... }
else
{
ret = ip_ptr -> nx_ip_ipsec_encapsulating_security_payload_receive(ip_ptr, packet_ptr, &next_protocol, &packet_ptr);
if (ret == NX_SUCCESS)
{
return(0);
}if (ret == NX_SUCCESS) { ... }
if (ret != NX_IPSEC_PKT_CONT)
{
return(1);
}if (ret != NX_IPSEC_PKT_CONT) { ... }
}else { ... }
break;
/* ... */
#else
return(1);/* ... */
#endif
case NX_PROTOCOL_NEXT_HEADER_ENCAP_SECURITY:
default:
#ifdef NX_IPSEC_ENABLE
if (packet_ptr -> nx_packet_ipsec_sa_ptr == NX_NULL)
{
#ifdef FEATURE_NX_IPV6
if (packet_ptr -> nx_packet_ip_version == NX_IP_VERSION_V6)
{
ipv6_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header);
src_addr.nxd_ip_version = NX_IP_VERSION_V6;
dest_addr.nxd_ip_version = NX_IP_VERSION_V6;
COPY_IPV6_ADDRESS(ipv6_header -> nx_ip_header_source_ip,
src_addr.nxd_ip_address.v6);
COPY_IPV6_ADDRESS(ipv6_header -> nx_ip_header_destination_ip,
dest_addr.nxd_ip_address.v6);
}if (packet_ptr -> nx_packet_ip_version == NX_IP_VERSION_V6) { ... }
else
#endif
{
#ifndef NX_DISABLE_IPV4
ipv4_header = (NX_IPV4_HEADER *)(packet_ptr -> nx_packet_ip_header);
src_addr.nxd_ip_version = NX_IP_VERSION_V4;
dest_addr.nxd_ip_version = NX_IP_VERSION_V4;
src_addr.nxd_ip_address.v4 = ipv4_header -> nx_ip_header_source_ip;
dest_addr.nxd_ip_address.v4 = ipv4_header -> nx_ip_header_destination_ip;/* ... */
#endif
}else { ... }
if (_nx_ipsec_sa_ingress_lookup(ip_ptr, &src_addr, &dest_addr, 0, (UCHAR)protocol,
NX_NULL, packet_ptr -> nx_packet_prepend_ptr) != NX_IPSEC_TRAFFIC_BYPASS)
{
#ifdef FEATURE_NX_IPV6
if (protocol == NX_PROTOCOL_ICMPV6)
{
icmp_header_ptr = (NX_ICMPV6_HEADER *)packet_ptr -> nx_packet_prepend_ptr;
if (icmp_header_ptr -> nx_icmpv6_header_type != NX_ICMPV6_NEIGHBOR_ADVERTISEMENT_TYPE)
{
return(NX_INVALID_PACKET);
}if (icmp_header_ptr -> nx_icmpv6_header_type != NX_ICMPV6_NEIGHBOR_ADVERTISEMENT_TYPE) { ... }
}if (protocol == NX_PROTOCOL_ICMPV6) { ... }
else
{
#endif
return(NX_INVALID_PACKET);
#ifdef FEATURE_NX_IPV6
}else { ... }
#endif
}if (_nx_ipsec_sa_ingress_lookup(ip_ptr, &src_addr, &dest_addr, 0, (UCHAR)protocol, NX_NULL, packet_ptr -> nx_packet_prepend_ptr) != NX_IPSEC_TRAFFIC_BYPASS) { ... }
}if (packet_ptr -> nx_packet_ipsec_sa_ptr == NX_NULL) { ... }
else if (((NX_IPSEC_SA *)(packet_ptr -> nx_packet_ipsec_sa_ptr)) -> nx_ipsec_sa_mode == NX_IPSEC_TUNNEL_MODE)
{
if (_nx_ipsec_sa_ingress_selector_check(packet_ptr -> nx_packet_prepend_ptr,
(UCHAR)protocol,
((NX_IPSEC_SA *)(packet_ptr -> nx_packet_ipsec_sa_ptr)) -> nx_ipsec_selector_ptr) == NX_IPSEC_TRAFFIC_DROP)
{
_nx_packet_release(packet_ptr);
return(NX_INVALID_PACKET);
}if (_nx_ipsec_sa_ingress_selector_check(packet_ptr -> nx_packet_prepend_ptr, (UCHAR)protocol, ((NX_IPSEC_SA *)(packet_ptr -> nx_packet_ipsec_sa_ptr)) -> nx_ipsec_selector_ptr) == NX_IPSEC_TRAFFIC_DROP) { ... }
}else if (((NX_IPSEC_SA *)(packet_ptr -> nx_packet_ipsec_sa_ptr)) -> nx_ipsec_sa_mode == NX_IPSEC_TUNNEL_MODE) { ... }
/* ... */#endif
#if defined(NX_ENABLE_IP_RAW_PACKET_ALL_STACK) && defined(NX_ENABLE_IP_RAW_PACKET_FILTER)
if ((ip_ptr -> nx_ip_raw_ip_processing) && (ip_ptr -> nx_ip_raw_packet_filter))
{
if ((ip_ptr -> nx_ip_raw_ip_processing)(ip_ptr, protocol << 16, packet_ptr) == NX_SUCCESS)
{
return(0);
}if ((ip_ptr -> nx_ip_raw_ip_processing)(ip_ptr, protocol << 16, packet_ptr) == NX_SUCCESS) { ... }
}if ((ip_ptr -> nx_ip_raw_ip_processing) && (ip_ptr -> nx_ip_raw_packet_filter)) { ... }
/* ... */#endif
if (protocol == NX_PROTOCOL_TCP)
{
#ifdef FEATURE_NX_IPV6
if ((packet_ptr -> nx_packet_ip_version == NX_IP_VERSION_V4) ||
((packet_ptr -> nx_packet_ip_version == NX_IP_VERSION_V6) &&
(incoming_addr -> nxd_ipv6_address_state == NX_IPV6_ADDR_STATE_VALID)))
{
#endif
if (ip_ptr -> nx_ip_tcp_packet_receive)
{
(ip_ptr -> nx_ip_tcp_packet_receive)(ip_ptr, packet_ptr);
return(0);
}if (ip_ptr -> nx_ip_tcp_packet_receive) { ... }
#ifdef FEATURE_NX_IPV6
}if ((packet_ptr -> nx_packet_ip_version == NX_IP_VERSION_V4) || ((packet_ptr -> nx_packet_ip_version == NX_IP_VERSION_V6) && (incoming_addr -> nxd_ipv6_address_state == NX_IPV6_ADDR_STATE_VALID))) { ... }
#endif
drop_packet = 1;
}if (protocol == NX_PROTOCOL_TCP) { ... }
#ifdef FEATURE_NX_IPV6
else if ((packet_ptr -> nx_packet_ip_version == NX_IP_VERSION_V6) &&
(protocol == NX_PROTOCOL_ICMPV6))
{
if (ip_ptr -> nx_ip_icmpv6_packet_process != NX_NULL)
{
ip_ptr -> nx_ip_icmpv6_packet_process(ip_ptr, packet_ptr);
return(0);
}if (ip_ptr -> nx_ip_icmpv6_packet_process != NX_NULL) { ... }
drop_packet = 1;
}else if ((packet_ptr -> nx_packet_ip_version == NX_IP_VERSION_V6) && (protocol == NX_PROTOCOL_ICMPV6)) { ... }
/* ... */#endif
#ifndef NX_DISABLE_IPV4
else if ((packet_ptr -> nx_packet_ip_version == NX_IP_VERSION_V4) &&
(protocol == NX_PROTOCOL_ICMP))
{
if (ip_ptr -> nx_ip_icmp_packet_receive != NX_NULL)
{
/* ... */
ip_ptr -> nx_ip_icmp_packet_receive(ip_ptr, packet_ptr);
return(0);
}if (ip_ptr -> nx_ip_icmp_packet_receive != NX_NULL) { ... }
drop_packet = 1;
}else if ((packet_ptr -> nx_packet_ip_version == NX_IP_VERSION_V4) && (protocol == NX_PROTOCOL_ICMP)) { ... }
else if ((packet_ptr -> nx_packet_ip_version == NX_IP_VERSION_V4) &&
(protocol == NX_PROTOCOL_IGMP))
{
if (ip_ptr -> nx_ip_igmp_packet_receive != NX_NULL)
{
/* ... */
ip_ptr -> nx_ip_igmp_packet_receive(ip_ptr, packet_ptr);
return(0);
}if (ip_ptr -> nx_ip_igmp_packet_receive != NX_NULL) { ... }
drop_packet = 1;
}else if ((packet_ptr -> nx_packet_ip_version == NX_IP_VERSION_V4) && (protocol == NX_PROTOCOL_IGMP)) { ... }
/* ... */#endif
else if (protocol == NX_PROTOCOL_UDP)
{
#ifdef FEATURE_NX_IPV6
if ((packet_ptr -> nx_packet_ip_version == NX_IP_VERSION_V4) ||
((packet_ptr -> nx_packet_ip_version == NX_IP_VERSION_V6) &&
(incoming_addr -> nxd_ipv6_address_state == NX_IPV6_ADDR_STATE_VALID)))
{
#endif
if (ip_ptr -> nx_ip_udp_packet_receive)
{
(ip_ptr -> nx_ip_udp_packet_receive)(ip_ptr, packet_ptr);
return(0);
}if (ip_ptr -> nx_ip_udp_packet_receive) { ... }
#ifdef FEATURE_NX_IPV6
}if ((packet_ptr -> nx_packet_ip_version == NX_IP_VERSION_V4) || ((packet_ptr -> nx_packet_ip_version == NX_IP_VERSION_V6) && (incoming_addr -> nxd_ipv6_address_state == NX_IPV6_ADDR_STATE_VALID))) { ... }
#endif
drop_packet = 1;
}else if (protocol == NX_PROTOCOL_UDP) { ... }
else
{
if (ip_ptr -> nx_ip_raw_ip_processing)
{
#if defined(NX_ENABLE_IP_RAW_PACKET_ALL_STACK) && defined(NX_ENABLE_IP_RAW_PACKET_FILTER)
if (ip_ptr -> nx_ip_raw_packet_filter == NX_NULL)
#endif
{
if ((ip_ptr -> nx_ip_raw_ip_processing)(ip_ptr, protocol << 16, packet_ptr) == NX_SUCCESS)
{
return(0);
}if ((ip_ptr -> nx_ip_raw_ip_processing)(ip_ptr, protocol << 16, packet_ptr) == NX_SUCCESS) { ... }
...}
}if (ip_ptr -> nx_ip_raw_ip_processing) { ... }
#if !defined(NX_DISABLE_IPV4) && !defined(NX_DISABLE_ICMPV4_ERROR_MESSAGE)
if (packet_ptr -> nx_packet_ip_version == NX_IP_VERSION_V4)
{
NX_ICMPV4_SEND_DEST_UNREACHABLE(ip_ptr, packet_ptr, NX_ICMP_PROTOCOL_UNREACH_CODE);
}if (packet_ptr -> nx_packet_ip_version == NX_IP_VERSION_V4) { ... }
/* ... */#endif
#ifdef FEATURE_NX_IPV6
#ifndef NX_DISABLE_ICMPV6_ERROR_MESSAGE
if (packet_ptr -> nx_packet_ip_version == NX_IP_VERSION_V6)
{
NX_ICMPV6_SEND_PARAMETER_PROBLEM(ip_ptr, packet_ptr, 1, nx_packet_option_offset);
}if (packet_ptr -> nx_packet_ip_version == NX_IP_VERSION_V6) { ... }
/* ... */#endif /* ... */
#endif
#ifndef NX_DISABLE_IP_INFO
ip_ptr -> nx_ip_unknown_protocols_received++;
/* ... */
#endif
drop_packet = 1;
}else { ... }
break;default
}switch (protocol) { ... }
/* ... */
if (!drop_packet)
{
#ifdef FEATURE_NX_IPV6
NX_IPV6_HEADER_OPTION *option;
ULONG option_hdr_len;/* ... */
#endif
#ifdef NX_IPSEC_ENABLE
if (protocol == NX_PROTOCOL_NEXT_HEADER_ENCAP_SECURITY ||
protocol == NX_PROTOCOL_NEXT_HEADER_AUTHENTICATION)
{
protocol = next_protocol;
continue;
}if (protocol == NX_PROTOCOL_NEXT_HEADER_ENCAP_SECURITY || protocol == NX_PROTOCOL_NEXT_HEADER_AUTHENTICATION) { ... }
/* ... */#endif
#ifdef FEATURE_NX_IPV6
if (packet_ptr -> nx_packet_ip_version == NX_IP_VERSION_V6)
{
option = (NX_IPV6_HEADER_OPTION *)packet_ptr -> nx_packet_prepend_ptr;
if (protocol == NX_PROTOCOL_NEXT_HEADER_FRAGMENT)
{
option_hdr_len = sizeof(NX_IPV6_HEADER_FRAGMENT_OPTION);
}if (protocol == NX_PROTOCOL_NEXT_HEADER_FRAGMENT) { ... }
else
{
option_hdr_len = (ULONG)((option -> nx_ipv6_header_option_ext_length + 1) << 3);
}else { ... }
protocol = option -> nx_ipv6_header_option_next_header;
if (((ALIGN_TYPE)(packet_ptr -> nx_packet_prepend_ptr) + option_hdr_len) <
(ALIGN_TYPE)(packet_ptr -> nx_packet_append_ptr))
{
packet_ptr -> nx_packet_prepend_ptr += option_hdr_len;
packet_ptr -> nx_packet_length -= option_hdr_len;
}if (((ALIGN_TYPE)(packet_ptr -> nx_packet_prepend_ptr) + option_hdr_len) < (ALIGN_TYPE)(packet_ptr -> nx_packet_append_ptr)) { ... }
else
{
drop_packet = 1;
}else { ... }
/* ... */
packet_ptr -> nx_packet_option_offset = (USHORT)next_option_offset;
next_option_offset = (UINT)(packet_ptr -> nx_packet_prepend_ptr - packet_ptr -> nx_packet_ip_header);
}if (packet_ptr -> nx_packet_ip_version == NX_IP_VERSION_V6) { ... }
/* ... */#endif
}if (!drop_packet) { ... }
else
{
#ifndef NX_DISABLE_IP_INFO
ip_ptr -> nx_ip_total_packets_delivered--;
ip_ptr -> nx_ip_total_bytes_received -= packet_ptr -> nx_packet_length;
ip_ptr -> nx_ip_receive_packets_dropped++;/* ... */
#endif
}else { ... }
}while (!drop_packet) { ... }
return(drop_packet);
}{ ... }