diff options
| author | anlan_cs <vic.lan@pica8.com> | 2023-06-28 12:31:52 +0800 | 
|---|---|---|
| committer | anlan_cs <vic.lan@pica8.com> | 2023-06-28 21:46:47 +0800 | 
| commit | 4e313ee450cb95cbc49cfe0b5bb9eb2e31549554 (patch) | |
| tree | 94b6959ad9a6db6910fb618543f242cd017d9ba6 /pbrd/pbr_vty.c | |
| parent | 4199f032e594984e08dddf079e4b4e8755f20c85 (diff) | |
pbrd: fix crash with match command
Crash with empty `ip-protocol`:
```
anlan(config-pbr-map)# match ip-protocol
vtysh: error reading from pbrd: Resource temporarily unavailable (11)Warning: closing connection to pbrd because of an I/O error!
```
So, give warning for empty `ip-protocol`.
Signed-off-by: anlan_cs <vic.lan@pica8.com>
Diffstat (limited to 'pbrd/pbr_vty.c')
| -rw-r--r-- | pbrd/pbr_vty.c | 5 | 
1 files changed, 5 insertions, 0 deletions
diff --git a/pbrd/pbr_vty.c b/pbrd/pbr_vty.c index c4e36ebd46..ee9ee32f8b 100644 --- a/pbrd/pbr_vty.c +++ b/pbrd/pbr_vty.c @@ -199,6 +199,11 @@ DEFPY(pbr_map_match_ip_proto, pbr_map_match_ip_proto_cmd,  		return CMD_WARNING_CONFIG_FAILED;  	if (!no) { +		if (!ip_proto) { +			vty_out(vty, "Unable to convert (null) to proto id\n"); +			return CMD_WARNING; +		} +  		p = getprotobyname(ip_proto);  		if (!p) {  			vty_out(vty, "Unable to convert %s to proto id\n",  | 
