mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-06-22 05:58:55 +00:00
pbrd: Prevent possible NULL use
the pnhi data structure can receive either a interface or a nhr data structure. Ensure that we don't crash. CID -> 1500586 Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
parent
5c8ecf6e46
commit
920bb6f76a
@ -770,18 +770,20 @@ pbr_nht_individual_nexthop_gw_update(struct pbr_nexthop_cache *pnhc,
|
|||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (pnhi->nhr->prefix.family) {
|
if (pnhi->nhr) {
|
||||||
case AF_INET:
|
switch (pnhi->nhr->prefix.family) {
|
||||||
if (pnhc->nexthop.gate.ipv4.s_addr
|
case AF_INET:
|
||||||
!= pnhi->nhr->prefix.u.prefix4.s_addr)
|
if (pnhc->nexthop.gate.ipv4.s_addr
|
||||||
goto done; /* Unrelated change */
|
!= pnhi->nhr->prefix.u.prefix4.s_addr)
|
||||||
break;
|
goto done; /* Unrelated change */
|
||||||
case AF_INET6:
|
break;
|
||||||
if (memcmp(&pnhc->nexthop.gate.ipv6,
|
case AF_INET6:
|
||||||
&pnhi->nhr->prefix.u.prefix6, 16)
|
if (memcmp(&pnhc->nexthop.gate.ipv6,
|
||||||
!= 0)
|
&pnhi->nhr->prefix.u.prefix6, 16)
|
||||||
goto done; /* Unrelated change */
|
!= 0)
|
||||||
break;
|
goto done; /* Unrelated change */
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pnhi->nhr_matched = true;
|
pnhi->nhr_matched = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user