diff options
| author | Donatas Abraitis <donatas.abraitis@gmail.com> | 2020-01-07 10:47:16 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-01-07 10:47:16 +0200 |
| commit | 1df967b14143d83f164efdd2f9f26a47b783795d (patch) | |
| tree | 39e724a101b693902181628160589e5c5b6e9117 | |
| parent | eada87a4abcb15aae7f42607d48161176fa40a4b (diff) | |
| parent | 454d85cf6235f83f35c9023ffaaae3676d28c0fb (diff) | |
Merge pull request #5636 from qlyoung/fix-bgp-unaligned-addpath-id-pointer
bgpd: fix unaligned access to addpath id
| -rw-r--r-- | bgpd/bgp_route.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 21d737fb32..b216f85c40 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -4515,7 +4515,8 @@ int bgp_nlri_parse_ip(struct peer *peer, struct attr *attr, if (pnt + BGP_ADDPATH_ID_LEN >= lim) return BGP_NLRI_PARSE_ERROR_PACKET_OVERFLOW; - addpath_id = ntohl(*((uint32_t *)pnt)); + memcpy(&addpath_id, pnt, 4); + addpath_id = ntohl(addpath_id); pnt += BGP_ADDPATH_ID_LEN; } |
