Skip to content
This repository was archived by the owner on Jan 6, 2023. It is now read-only.

Commit b8d55ef

Browse files
committed
Parse iptable rules for pod.
Iptable rules are passed to the pod, which are meant to be restored within the VM. This is because the rules may be set in the network namespace which are not visible to the VM. Signed-off-by: Archana Shinde <[email protected]>
1 parent e1a9d8c commit b8d55ef

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/hyper.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ struct hyper_pod {
3535
uint32_t remains;
3636
int req_destroy;
3737
int efd;
38+
char *iptable_rules;
3839
};
3940

4041
struct portmapping_white_list {

src/parse.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1283,6 +1283,10 @@ int hyper_parse_pod(struct hyper_pod *pod, char *json, int length)
12831283
goto out;
12841284

12851285
i += next;
1286+
} else if (json_token_streq(json, t, "iptableRules") && t->size == 1) {
1287+
pod->iptable_rules= (json_token_str(json, &toks[++i]));
1288+
fprintf(stdout, "iptable rules provided:%s\n", pod->iptable_rules);
1289+
i++;
12861290
} else {
12871291
fprintf(stdout, "get unknown section %s in pod\n",
12881292
json_token_str(json, &toks[i]));

0 commit comments

Comments
 (0)