Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
LiorBenYamin committed Apr 5, 2020
1 parent f0ca5e9 commit 68896c9
Show file tree
Hide file tree
Showing 9 changed files with 843 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions .idea/tcpdump.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

815 changes: 815 additions & 0 deletions cmake-build-debug/tcpdump.cbp

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions print-bgp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2703,7 +2703,7 @@ bgp_update_print(netdissect_options *ndo,
const u_char *dat, u_int length)
{
const u_char *p;
u_int withdrawn_routes_len;
u_int withdrawn_routes_len, withdrawn_routes_len_orig;
char buf[MAXHOSTNAMELEN + 100];
int wpfx;
u_int len;
Expand All @@ -2722,6 +2722,7 @@ bgp_update_print(netdissect_options *ndo,
if (length < 2)
goto trunc;
withdrawn_routes_len = GET_BE_U_2(p);
withdrawn_routes_len_orig = withdrawn_routes_len;
p += 2;
length -= 2;
if (withdrawn_routes_len > 1) {
Expand Down Expand Up @@ -2780,7 +2781,7 @@ bgp_update_print(netdissect_options *ndo,
p += 2;
length -= 2;

if (withdrawn_routes_len == 0 && len == 0 && length == 0) {
if (withdrawn_routes_len_orig == 0 && len == 0 && length == 0) {
/* No withdrawn routes, no path attributes, no NLRI */
ND_PRINT("\n\t End-of-Rib Marker (empty NLRI)");
return;
Expand Down
3 changes: 0 additions & 3 deletions tests/bgp-4byte-asdot.out
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@
2.2.2.2/32
3.3.3.3/32
4.4.4.4/32
End-of-Rib Marker (empty NLRI)
57 17:16:48.787130 IP (tos 0xc0, ttl 1, id 7408, offset 0, flags [DF], proto TCP (6), length 52)
1.0.2.2.42741 > 1.0.2.1.179: Flags [.], cksum 0x7b52 (correct), ack 225, win 58, options [nop,nop,TS val 667580847 ecr 667580847], length 0
58 17:16:48.787715 IP (tos 0xc0, ttl 1, id 31533, offset 0, flags [DF], proto TCP (6), length 100)
Expand All @@ -230,7 +229,6 @@
1.1.1.1/32
2.2.2.2/32
3.3.3.3/32
End-of-Rib Marker (empty NLRI)
59 17:16:48.787775 IP (tos 0xc0, ttl 1, id 20412, offset 0, flags [DF], proto TCP (6), length 52)
1.0.3.2.179 > 1.0.3.1.35169: Flags [.], cksum 0xf941 (correct), ack 230, win 57, options [nop,nop,TS val 667580847 ecr 667580847], length 0
60 17:16:48.787882 IP (tos 0xc0, ttl 1, id 32536, offset 0, flags [DF], proto TCP (6), length 100)
Expand All @@ -242,7 +240,6 @@
1.1.1.1/32
2.2.2.2/32
3.3.3.3/32
End-of-Rib Marker (empty NLRI)
61 17:16:48.787979 IP (tos 0xc0, ttl 1, id 35917, offset 0, flags [DF], proto TCP (6), length 52)
1.0.4.2.179 > 1.0.4.1.34883: Flags [.], cksum 0x90ff (correct), ack 247, win 57, options [nop,nop,TS val 667580847 ecr 667580847], length 0
62 17:16:50.013864 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 1.0.0.2 tell 1.0.0.1, length 28
Expand Down
3 changes: 0 additions & 3 deletions tests/bgp-4byte-asn.out
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@
2.2.2.2/32
3.3.3.3/32
4.4.4.4/32
End-of-Rib Marker (empty NLRI)
57 17:16:48.787130 IP (tos 0xc0, ttl 1, id 7408, offset 0, flags [DF], proto TCP (6), length 52)
1.0.2.2.42741 > 1.0.2.1.179: Flags [.], cksum 0x7b52 (correct), ack 225, win 58, options [nop,nop,TS val 667580847 ecr 667580847], length 0
58 17:16:48.787715 IP (tos 0xc0, ttl 1, id 31533, offset 0, flags [DF], proto TCP (6), length 100)
Expand All @@ -230,7 +229,6 @@
1.1.1.1/32
2.2.2.2/32
3.3.3.3/32
End-of-Rib Marker (empty NLRI)
59 17:16:48.787775 IP (tos 0xc0, ttl 1, id 20412, offset 0, flags [DF], proto TCP (6), length 52)
1.0.3.2.179 > 1.0.3.1.35169: Flags [.], cksum 0xf941 (correct), ack 230, win 57, options [nop,nop,TS val 667580847 ecr 667580847], length 0
60 17:16:48.787882 IP (tos 0xc0, ttl 1, id 32536, offset 0, flags [DF], proto TCP (6), length 100)
Expand All @@ -242,7 +240,6 @@
1.1.1.1/32
2.2.2.2/32
3.3.3.3/32
End-of-Rib Marker (empty NLRI)
61 17:16:48.787979 IP (tos 0xc0, ttl 1, id 35917, offset 0, flags [DF], proto TCP (6), length 52)
1.0.4.2.179 > 1.0.4.1.34883: Flags [.], cksum 0x90ff (correct), ack 247, win 57, options [nop,nop,TS val 667580847 ecr 667580847], length 0
62 17:16:50.013864 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 1.0.0.2 tell 1.0.0.1, length 28
Expand Down

0 comments on commit 68896c9

Please sign in to comment.