diff options
| author | Russ White <russ@riw.us> | 2019-01-02 21:42:50 -0500 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-01-02 21:42:50 -0500 | 
| commit | e7db973e6e93ba08b120b269bd6d7bd3c5426590 (patch) | |
| tree | 24e70888d947dadede3e0fb1163f56980eab30b6 /bgpd | |
| parent | 7d4465cf35c142862422b99a9e022a7df1db8e3e (diff) | |
| parent | 79bc257a1d750789ff9116b03812375bc8abcb5d (diff) | |
Merge pull request #3560 from opensourcerouting/fix-sh-bgp-community
bgpd: fix parsing of community number in the "show bgp community" command
Diffstat (limited to 'bgpd')
| -rw-r--r-- | bgpd/bgp_route.c | 9 | 
1 files changed, 8 insertions, 1 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 2c361bef4d..31cd3d1f05 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -9529,9 +9529,16 @@ DEFUN (show_ip_bgp_json,  	}  	if (argv_find(argv, argc, "community", &idx)) { -		char *maybecomm = idx + 1 < argc ? argv[idx + 1]->text : NULL; +		char *maybecomm = NULL;  		char *community = NULL; +		if (idx + 1 < argc) { +			if (argv[idx + 1]->type == VARIABLE_TKN) +				maybecomm = argv[idx + 1]->arg; +			else +				maybecomm = argv[idx + 1]->text; +		} +  		if (maybecomm && !strmatch(maybecomm, "json")  		    && !strmatch(maybecomm, "exact-match"))  			community = maybecomm;  | 
