Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
7e08be7c
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
7e08be7c
编写于
10月 30, 2013
作者:
C
chegar
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8026880: NetworkInterface native initializing code should check fieldID values
Reviewed-by: alanb
上级
24eba4bc
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
46 addition
and
1 deletion
+46
-1
src/solaris/native/java/net/NetworkInterface.c
src/solaris/native/java/net/NetworkInterface.c
+25
-0
src/windows/native/java/net/NetworkInterface.c
src/windows/native/java/net/NetworkInterface.c
+21
-1
未找到文件。
src/solaris/native/java/net/NetworkInterface.c
浏览文件 @
7e08be7c
...
...
@@ -170,31 +170,56 @@ static int getMacFromDevice(JNIEnv *env, const char* ifname, unsigned char* r
JNIEXPORT
void
JNICALL
Java_java_net_NetworkInterface_init
(
JNIEnv
*
env
,
jclass
cls
)
{
ni_class
=
(
*
env
)
->
FindClass
(
env
,
"java/net/NetworkInterface"
);
CHECK_NULL
(
ni_class
);
ni_class
=
(
*
env
)
->
NewGlobalRef
(
env
,
ni_class
);
CHECK_NULL
(
ni_class
);
ni_nameID
=
(
*
env
)
->
GetFieldID
(
env
,
ni_class
,
"name"
,
"Ljava/lang/String;"
);
CHECK_NULL
(
ni_nameID
);
ni_indexID
=
(
*
env
)
->
GetFieldID
(
env
,
ni_class
,
"index"
,
"I"
);
CHECK_NULL
(
ni_indexID
);
ni_addrsID
=
(
*
env
)
->
GetFieldID
(
env
,
ni_class
,
"addrs"
,
"[Ljava/net/InetAddress;"
);
CHECK_NULL
(
ni_addrsID
);
ni_bindsID
=
(
*
env
)
->
GetFieldID
(
env
,
ni_class
,
"bindings"
,
"[Ljava/net/InterfaceAddress;"
);
CHECK_NULL
(
ni_bindsID
);
ni_descID
=
(
*
env
)
->
GetFieldID
(
env
,
ni_class
,
"displayName"
,
"Ljava/lang/String;"
);
CHECK_NULL
(
ni_descID
);
ni_virutalID
=
(
*
env
)
->
GetFieldID
(
env
,
ni_class
,
"virtual"
,
"Z"
);
CHECK_NULL
(
ni_virutalID
);
ni_childsID
=
(
*
env
)
->
GetFieldID
(
env
,
ni_class
,
"childs"
,
"[Ljava/net/NetworkInterface;"
);
CHECK_NULL
(
ni_childsID
);
ni_parentID
=
(
*
env
)
->
GetFieldID
(
env
,
ni_class
,
"parent"
,
"Ljava/net/NetworkInterface;"
);
CHECK_NULL
(
ni_parentID
);
ni_ctrID
=
(
*
env
)
->
GetMethodID
(
env
,
ni_class
,
"<init>"
,
"()V"
);
CHECK_NULL
(
ni_ctrID
);
ni_iacls
=
(
*
env
)
->
FindClass
(
env
,
"java/net/InetAddress"
);
CHECK_NULL
(
ni_iacls
);
ni_iacls
=
(
*
env
)
->
NewGlobalRef
(
env
,
ni_iacls
);
CHECK_NULL
(
ni_iacls
);
ni_ia4cls
=
(
*
env
)
->
FindClass
(
env
,
"java/net/Inet4Address"
);
CHECK_NULL
(
ni_ia4cls
);
ni_ia4cls
=
(
*
env
)
->
NewGlobalRef
(
env
,
ni_ia4cls
);
CHECK_NULL
(
ni_ia4cls
);
ni_ia6cls
=
(
*
env
)
->
FindClass
(
env
,
"java/net/Inet6Address"
);
CHECK_NULL
(
ni_ia6cls
);
ni_ia6cls
=
(
*
env
)
->
NewGlobalRef
(
env
,
ni_ia6cls
);
CHECK_NULL
(
ni_ia6cls
);
ni_ibcls
=
(
*
env
)
->
FindClass
(
env
,
"java/net/InterfaceAddress"
);
CHECK_NULL
(
ni_ibcls
);
ni_ibcls
=
(
*
env
)
->
NewGlobalRef
(
env
,
ni_ibcls
);
CHECK_NULL
(
ni_ibcls
);
ni_ia4ctrID
=
(
*
env
)
->
GetMethodID
(
env
,
ni_ia4cls
,
"<init>"
,
"()V"
);
CHECK_NULL
(
ni_ia4ctrID
);
ni_ia6ctrID
=
(
*
env
)
->
GetMethodID
(
env
,
ni_ia6cls
,
"<init>"
,
"()V"
);
CHECK_NULL
(
ni_ia6ctrID
);
ni_ibctrID
=
(
*
env
)
->
GetMethodID
(
env
,
ni_ibcls
,
"<init>"
,
"()V"
);
CHECK_NULL
(
ni_ibctrID
);
ni_ibaddressID
=
(
*
env
)
->
GetFieldID
(
env
,
ni_ibcls
,
"address"
,
"Ljava/net/InetAddress;"
);
CHECK_NULL
(
ni_ibaddressID
);
ni_ib4broadcastID
=
(
*
env
)
->
GetFieldID
(
env
,
ni_ibcls
,
"broadcast"
,
"Ljava/net/Inet4Address;"
);
CHECK_NULL
(
ni_ib4broadcastID
);
ni_ib4maskID
=
(
*
env
)
->
GetFieldID
(
env
,
ni_ibcls
,
"maskLength"
,
"S"
);
CHECK_NULL
(
ni_ib4maskID
);
ni_defaultIndexID
=
(
*
env
)
->
GetStaticFieldID
(
env
,
ni_class
,
"defaultIndex"
,
"I"
);
}
...
...
src/windows/native/java/net/NetworkInterface.c
浏览文件 @
7e08be7c
...
...
@@ -500,32 +500,52 @@ Java_java_net_NetworkInterface_init(JNIEnv *env, jclass cls)
* Get the various JNI ids that we require
*/
ni_class
=
(
*
env
)
->
NewGlobalRef
(
env
,
cls
);
CHECK_NULL
(
ni_class
);
ni_nameID
=
(
*
env
)
->
GetFieldID
(
env
,
ni_class
,
"name"
,
"Ljava/lang/String;"
);
CHECK_NULL
(
ni_nameID
);
ni_displayNameID
=
(
*
env
)
->
GetFieldID
(
env
,
ni_class
,
"displayName"
,
"Ljava/lang/String;"
);
CHECK_NULL
(
ni_displayNameID
);
ni_indexID
=
(
*
env
)
->
GetFieldID
(
env
,
ni_class
,
"index"
,
"I"
);
CHECK_NULL
(
ni_indexID
);
ni_addrsID
=
(
*
env
)
->
GetFieldID
(
env
,
ni_class
,
"addrs"
,
"[Ljava/net/InetAddress;"
);
CHECK_NULL
(
ni_addrsID
);
ni_bindsID
=
(
*
env
)
->
GetFieldID
(
env
,
ni_class
,
"bindings"
,
"[Ljava/net/InterfaceAddress;"
);
CHECK_NULL
(
ni_bindsID
);
ni_childsID
=
(
*
env
)
->
GetFieldID
(
env
,
ni_class
,
"childs"
,
"[Ljava/net/NetworkInterface;"
);
CHECK_NULL
(
ni_childsID
);
ni_ctor
=
(
*
env
)
->
GetMethodID
(
env
,
ni_class
,
"<init>"
,
"()V"
);
CHECK_NULL
(
ni_ctor
);
ni_iacls
=
(
*
env
)
->
FindClass
(
env
,
"java/net/InetAddress"
);
CHECK_NULL
(
ni_iacls
);
ni_iacls
=
(
*
env
)
->
NewGlobalRef
(
env
,
ni_iacls
);
CHECK_NULL
(
ni_iacls
);
ni_ia4cls
=
(
*
env
)
->
FindClass
(
env
,
"java/net/Inet4Address"
);
CHECK_NULL
(
ni_ia4cls
);
ni_ia4cls
=
(
*
env
)
->
NewGlobalRef
(
env
,
ni_ia4cls
);
CHECK_NULL
(
ni_ia4cls
);
ni_ia4Ctor
=
(
*
env
)
->
GetMethodID
(
env
,
ni_ia4cls
,
"<init>"
,
"()V"
);
CHECK_NULL
(
ni_ia4Ctor
);
ni_ia6cls
=
(
*
env
)
->
FindClass
(
env
,
"java/net/Inet6Address"
);
CHECK_NULL
(
ni_ia6cls
);
ni_ia6cls
=
(
*
env
)
->
NewGlobalRef
(
env
,
ni_ia6cls
);
CHECK_NULL
(
ni_ia6cls
);
ni_ia6ctrID
=
(
*
env
)
->
GetMethodID
(
env
,
ni_ia6cls
,
"<init>"
,
"()V"
);
CHECK_NULL
(
ni_ia6ctrID
);
ni_ibcls
=
(
*
env
)
->
FindClass
(
env
,
"java/net/InterfaceAddress"
);
CHECK_NULL
(
ni_ibcls
);
ni_ibcls
=
(
*
env
)
->
NewGlobalRef
(
env
,
ni_ibcls
);
CHECK_NULL
(
ni_ibcls
);
ni_ibctrID
=
(
*
env
)
->
GetMethodID
(
env
,
ni_ibcls
,
"<init>"
,
"()V"
);
CHECK_NULL
(
ni_ibctrID
);
ni_ibaddressID
=
(
*
env
)
->
GetFieldID
(
env
,
ni_ibcls
,
"address"
,
"Ljava/net/InetAddress;"
);
CHECK_NULL
(
ni_ibaddressID
);
ni_ibbroadcastID
=
(
*
env
)
->
GetFieldID
(
env
,
ni_ibcls
,
"broadcast"
,
"Ljava/net/Inet4Address;"
);
CHECK_NULL
(
ni_ibbroadcastID
);
ni_ibmaskID
=
(
*
env
)
->
GetFieldID
(
env
,
ni_ibcls
,
"maskLength"
,
"S"
);
}
/*
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录