Skip to content

Commit 4ee6b6e

Browse files
authored
[Fixbug 18418] [Yang] MACSEC_PROFILE table does not match yang definition (#18419)
### Why I did it Fix the issue [18418](#18418), The YANG model to MACsec fallback cak/ckn is wrong. We should allow the fallback option is empty. ### How I did it Add a condition to check whether the fallback is providered #### How to verify it Check Azp
1 parent 0688aa3 commit 4ee6b6e

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

src/sonic-yang-models/tests/yang_model_tests/tests_config/macsec.json

+12
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,18 @@
3030
"replay_window": 64,
3131
"send_sci": "true",
3232
"rekey_period": 3600
33+
},
34+
{
35+
"name": "test_nofallback",
36+
"priority": 64,
37+
"cipher_suite": "GCM-AES-XPN-256",
38+
"primary_cak": "5207554155500e5d5157786d6c2a3d2031425a5e577e7e727f6b6c03312432262706080a00005b554f4e007975707670725b0a54540c0252445e5d7a29252b046a",
39+
"primary_ckn": "6162636465666768696A6B6C6D6E6F706162636465666768696A6B6C6D6E6F70",
40+
"policy": "security",
41+
"enable_replay_protect": "true",
42+
"replay_window": 64,
43+
"send_sci": "true",
44+
"rekey_period": 3600
3345
}
3446
]
3547
}

src/sonic-yang-models/yang-models/sonic-macsec.yang

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ module sonic-macsec {
7070
}
7171
}
7272

73-
must "string-length(fallback_cak) = string-length(primary_cak)";
73+
must "string-length(fallback_cak) = 0 or string-length(fallback_cak) = string-length(primary_cak)";
7474

75-
must "primary_ckn != fallback_ckn";
75+
must "string-length(fallback_ckn) = 0 or primary_ckn != fallback_ckn";
7676

7777
leaf policy {
7878
type string {

0 commit comments

Comments
 (0)