
This patch provides an ipv6 vendor hook which can be used to disable kernel auto generate the ipv6 link-local address. The reasons why the kernel does not need to automatically generate the ipv6 link-local address are as follows: (1) In the 3GPP TS 29.061, here is a description as follows: "in order to avoid any conflict between the link-local address of the MS and that of the GGSN, the Interface-Identifier used by the MS to build its link-local address shall be assigned by the GGSN. The GGSN ensures the uniqueness of this Interface- Identifier. The MT shall then enforce the use of this Interface-Identifier by the TE" In other words, in the cellular network, GGSN determines whether to reply a solicited RA message by identifying the low 64 bits of the source address of the received RS message. Therefore, cellular network device's ipv6 link-local address should be set as the format of fe80::(GGSN assigned IID). For example: When using a new kernel and ARPHRD_RAWIP, kernel will generate an EUI64 format ipv6 link-local address, and the Linux kernel will uses this link-local address to send RS message. The result is that the GGSN will not reply to the RS message with a solicited RA message. For mobile operators that don't need to support RFC7217, setting addr_gen_mode == 1 is sufficient, it can avoid the above issue, but when the addr_gen_mode is changed to the IN6_ADDR_GEN_MODE_STABLE_PRIVACY, the above problem still exist. The detail as follows: (2) For some other mobile operators that need to support RFC7217, the mobile device's addr_gen_mode will be switched to the IN6_ADDR_GEN_MODE_STABLE_PRIVACY, instead of using IN6_ADDR_GEN_MODE_NONE. The purpose is: in the IN6_ADDR_GEN_MODE_STABLE_PRIVACY mode, kernel can gererate a stable privacy global ipv6 address after receiveing RA, and network processes can use this global address to communicate with the outside network. Of course, mobile operators that need to support RFC7217 should also meet the requirement of 3GPP TS 29.061, that is, MT should use IID assigned by the GGSN to build its ipv6 link-local address and use this address to send RS. We don't want the kernel to automatically generate an ipv6 link-local address when addr_gen_mode == 2. Otherwise, using the stable privacy ipv6 link-local address automatically generated by the kernel to send RS message, GGSN will not be able to respond to the RS and reply a RA message. Therefore, after this patch, the kernel can determine whether to disable the automatic ipv6 link-local address generation by judging the net device name. Bug: 190685002 Change-Id: I93420cacd96789769edc7214fb8a2dd1455ce374 Signed-off-by: Rocco Yue <rocco.yue@mediatek.com>
23 lines
706 B
C
23 lines
706 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#undef TRACE_SYSTEM
|
|
#define TRACE_SYSTEM ipv6
|
|
#define TRACE_INCLUDE_PATH trace/hooks
|
|
|
|
#if !defined(_TRACE_HOOK_IPV6_H) || defined(TRACE_HEADER_MULTI_READ)
|
|
#define _TRACE_HOOK_IPV6_H
|
|
#include <linux/tracepoint.h>
|
|
#include <trace/hooks/vendor_hooks.h>
|
|
/*
|
|
* Following tracepoints are not exported in tracefs and provide a
|
|
* mechanism for vendor modules to hook and extend functionality
|
|
*/
|
|
DECLARE_HOOK(android_vh_ipv6_gen_linklocal_addr,
|
|
TP_PROTO(struct net_device *dev, bool *ret),
|
|
TP_ARGS(dev, ret));
|
|
|
|
/* macro versions of hooks are no longer required */
|
|
|
|
#endif /* _TRACE_HOOK_IPV6_H */
|
|
/* This part must be outside protection */
|
|
#include <trace/define_trace.h>
|