Skip to content

Commit

Permalink
[Fixbug 18418] [Yang] MACSEC_PROFILE table does not match yang defini…
Browse files Browse the repository at this point in the history
…tion (sonic-net#18419)

### Why I did it
Fix the issue [18418](sonic-net#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
  • Loading branch information
Pterosaur authored and mssonicbld committed May 9, 2024
1 parent 0e93897 commit 5a67757
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,18 @@
"replay_window": 64,
"send_sci": "true",
"rekey_period": 3600
},
{
"name": "test_nofallback",
"priority": 64,
"cipher_suite": "GCM-AES-XPN-256",
"primary_cak": "5207554155500e5d5157786d6c2a3d2031425a5e577e7e727f6b6c03312432262706080a00005b554f4e007975707670725b0a54540c0252445e5d7a29252b046a",
"primary_ckn": "6162636465666768696A6B6C6D6E6F706162636465666768696A6B6C6D6E6F70",
"policy": "security",
"enable_replay_protect": "true",
"replay_window": 64,
"send_sci": "true",
"rekey_period": 3600
}
]
}
Expand Down
4 changes: 2 additions & 2 deletions src/sonic-yang-models/yang-models/sonic-macsec.yang
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ module sonic-macsec {
}
}

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

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

leaf policy {
type string {
Expand Down

0 comments on commit 5a67757

Please sign in to comment.