Skip to content

Commit 8fa8f9d

Browse files
committed
Fix sonic-bgp-neighbor yang model to use backreference for vlan interface validation instead of regex and add subinterface support.
Signed-off-by: Julius <[email protected]>
1 parent 333b591 commit 8fa8f9d

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

src/sonic-yang-models/yang-models/sonic-bgp-neighbor.yang

+12-10
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,13 @@ module sonic-bgp-neighbor {
2323
prefix lag;
2424
}
2525

26-
// Comment sonic-vlan import here until libyang back-links issue is resolved for VLAN leaf reference.
27-
//import sonic-vlan {
28-
// prefix vlan;
29-
//}
26+
import sonic-vlan-sub-interface {
27+
prefix vlan-sub-interface;
28+
}
29+
30+
import sonic-vlan {
31+
prefix vlan;
32+
}
3033

3134
import sonic-bgp-global {
3235
prefix bgpg;
@@ -91,12 +94,11 @@ module sonic-bgp-neighbor {
9194
type leafref {
9295
path "/lag:sonic-portchannel/lag:PORTCHANNEL/lag:PORTCHANNEL_LIST/lag:name";
9396
}
94-
// Comment VLAN leaf reference here until libyang back-links issue is resolved and use VLAN string pattern
95-
// type leafref {
96-
// path "/vlan:sonic-vlan/vlan:VLAN/vlan:VLAN_LIST/vlan:name";
97-
// }
98-
type string {
99-
pattern 'Vlan([0-9]{1,3}|[1-3][0-9]{3}|[4][0][0-8][0-9]|[4][0][9][0-4])';
97+
type leafref {
98+
path "/vlan-sub-interface:sonic-vlan-sub-interface/vlan-sub-interface:VLAN_SUB_INTERFACE/vlan-sub-interface:VLAN_SUB_INTERFACE_LIST/vlan-sub-interface:name";
99+
}
100+
type leafref {
101+
path "/vlan:sonic-vlan/vlan:VLAN/vlan:VLAN_LIST/vlan:name";
100102
}
101103
}
102104
description "BGP Neighbor, it will be neighbor address or interface name";

0 commit comments

Comments
 (0)