diff options
author | Harald Welte <laforge@gnumonks.org> | 2017-09-24 20:00:34 +0800 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2017-09-24 20:51:47 +0800 |
commit | f85fe9720be14acc1038ed400654d8ce336274a7 (patch) | |
tree | e12f5279f153547a1d5b433bfbd62c9ef7868831 /ggsn/icmpv6.c | |
parent | fed598f41d85cef578925a4be6ce96a2c6afd3b3 (diff) |
ICMPv6: Send router advertisement from own link-local address
I'm not quite sure how I ended up doing this, but for some strange
reason the code before this commit is sending the ICMPv6 Router
Advertisements from some weird non-standard source address. This is
a violation of RFC4861 which clearly states that the source address
of router advertisements "MUST be the link-local address assigned to the
interface from which this message is sent."
Change-Id: Ib444af70fc8f0b433d371281601fd5a37b29039e
Diffstat (limited to 'ggsn/icmpv6.c')
-rw-r--r-- | ggsn/icmpv6.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/ggsn/icmpv6.c b/ggsn/icmpv6.c index ac51bb1..11ced24 100644 --- a/ggsn/icmpv6.c +++ b/ggsn/icmpv6.c @@ -179,13 +179,9 @@ static bool icmpv6_validate_router_solicit(const uint8_t *pack, unsigned len) return true; } -/* RFC3307 link-local scope multicast address */ -static const struct in6_addr my_local_addr = { - .s6_addr = { 0x01,0x02,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0xff } -}; - /* handle incoming packets to the all-routers multicast address */ -int handle_router_mcast(struct gsn_t *gsn, struct pdp_t *pdp, const uint8_t *pack, unsigned len) +int handle_router_mcast(struct gsn_t *gsn, struct pdp_t *pdp, const struct in6_addr *own_ll_addr, + const uint8_t *pack, unsigned len) { struct ippoolm_t *member = pdp->peer; const struct ip6_hdr *ip6h = (struct ip6_hdr *)pack; @@ -222,10 +218,10 @@ int handle_router_mcast(struct gsn_t *gsn, struct pdp_t *pdp, const uint8_t *pac osmo_hexdump(pack, len)); return -1; } - /* FIXME: Send router advertisement from GGSN link-local + /* Send router advertisement from GGSN link-local * address to MS link-local address, including prefix * allocated to this PDP context */ - msg = icmpv6_construct_ra(&my_local_addr, &ip6h->ip6_src, &member->addr.v6); + msg = icmpv6_construct_ra(own_ll_addr, &ip6h->ip6_src, &member->addr.v6); /* Send the constructed RA to the MS */ gtp_data_req(gsn, pdp, msgb_data(msg), msgb_length(msg)); msgb_free(msg); |