diff options
| author | Russ White <russ@riw.us> | 2018-09-11 11:33:27 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-09-11 11:33:27 -0400 |
| commit | 88f47ef36536a040b30652bc22c253e7c5bc1c2e (patch) | |
| tree | 272285fef5319101109e4148f7784155bebe5fdc /lib/vrf.c | |
| parent | 5297438f5976b9a4460b07866413dfb990957af2 (diff) | |
| parent | c3568c4d1a080bc0510894374e16c157be28e8e4 (diff) | |
Merge pull request #2944 from thbtcllt/master
fix zebra crash when a vrf interface changes with netns implementation for vrf
Diffstat (limited to 'lib/vrf.c')
| -rw-r--r-- | lib/vrf.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -493,9 +493,15 @@ void vrf_init(int (*create)(struct vrf *), int (*enable)(struct vrf *), "vrf_init: failed to create the default VRF!"); exit(1); } - if (vrf_is_backend_netns()) + if (vrf_is_backend_netns()) { + struct ns *ns; + strlcpy(default_vrf->data.l.netns_name, VRF_DEFAULT_NAME, NS_NAMSIZ); + ns = ns_lookup(ns_get_default_id()); + ns->vrf_ctxt = default_vrf; + default_vrf->ns_ctxt = ns; + } /* Enable the default VRF. */ if (!vrf_enable(default_vrf)) { @@ -711,8 +717,6 @@ int vrf_is_mapped_on_netns(struct vrf *vrf) { if (!vrf || vrf->data.l.netns_name[0] == '\0') return 0; - if (vrf->vrf_id == VRF_DEFAULT) - return 0; return 1; } |
