mirror of
https://github.com/openharmony/kernel_common_modules_newip.git
synced 2026-07-20 00:53:31 -04:00
Merge branch 'master' of gitee.com:openharmony/kernel_common_modules_newip
This commit is contained in:
+23
-15
@@ -13,22 +13,30 @@ NEWIP_SOURCE_ROOT=$OHOS_SOURCE_ROOT/kernel/common_modules/newip
|
||||
|
||||
function main()
|
||||
{
|
||||
cd $KERNEL_BUILD_ROOT
|
||||
pushd .
|
||||
|
||||
ln -s -f $NEWIP_SOURCE_ROOT/src/linux/include/linux/*.h $KERNEL_BUILD_ROOT/include/linux/
|
||||
ln -s -f $NEWIP_SOURCE_ROOT/src/linux/include/net/netns/*.h $KERNEL_BUILD_ROOT/include/net/netns/
|
||||
ln -s -f $NEWIP_SOURCE_ROOT/src/linux/include/net/*.h $KERNEL_BUILD_ROOT/include/net/
|
||||
ln -s -f $NEWIP_SOURCE_ROOT/src/linux/include/uapi/linux/*.h $KERNEL_BUILD_ROOT/include/uapi/linux/
|
||||
ln -s -f $NEWIP_SOURCE_ROOT/src/linux/include/trace/hooks/*.h $KERNEL_BUILD_ROOT/include/trace/hooks/
|
||||
|
||||
if [ ! -d " $KERNEL_BUILD_ROOT/net/newip" ]; then
|
||||
mkdir $KERNEL_BUILD_ROOT/net/newip
|
||||
fi
|
||||
ln -s -f $NEWIP_SOURCE_ROOT/src/linux/net/newip/* $KERNEL_BUILD_ROOT/net/newip/
|
||||
ln -s -f $NEWIP_SOURCE_ROOT/src/common/* $KERNEL_BUILD_ROOT/net/newip/
|
||||
ln -s -f $NEWIP_SOURCE_ROOT/src/common/nip_addr.h $KERNEL_BUILD_ROOT/include/uapi/linux/nip_addr.h
|
||||
|
||||
cd -
|
||||
cd $KERNEL_BUILD_ROOT/include/linux/
|
||||
ln -s -f $(realpath --relative-to=$KERNEL_BUILD_ROOT/include/linux $NEWIP_SOURCE_ROOT/src/linux/include/linux)/*.h ./
|
||||
cd $KERNEL_BUILD_ROOT/include/net/netns
|
||||
ln -s -f $(realpath --relative-to=$KERNEL_BUILD_ROOT/include/net/netns $NEWIP_SOURCE_ROOT/src/linux/include/net/netns)/*.h ./
|
||||
cd $KERNEL_BUILD_ROOT/include/net
|
||||
ln -s -f $(realpath --relative-to=$KERNEL_BUILD_ROOT/include/net $NEWIP_SOURCE_ROOT/src/linux/include/net)/*.h ./
|
||||
cd $KERNEL_BUILD_ROOT/include/uapi/linux
|
||||
ln -s -f $(realpath --relative-to=$KERNEL_BUILD_ROOT/include/uapi/linux $NEWIP_SOURCE_ROOT/src/linux/include/uapi/linux)/*.h ./
|
||||
cd $KERNEL_BUILD_ROOT/include/trace/hooks
|
||||
ln -s -f $(realpath --relative-to=$KERNEL_BUILD_ROOT/include/trace/hooks $NEWIP_SOURCE_ROOT/src/linux/include/trace/hooks)/*.h ./
|
||||
|
||||
if [ ! -d " $KERNEL_BUILD_ROOT/net/newip" ]; then
|
||||
mkdir $KERNEL_BUILD_ROOT/net/newip
|
||||
fi
|
||||
|
||||
cd $KERNEL_BUILD_ROOT/net/newip/
|
||||
ln -s -f $(realpath --relative-to=$KERNEL_BUILD_ROOT/net/newip $NEWIP_SOURCE_ROOT/src/linux/net/newip)/*.h ./
|
||||
ln -s -f $(realpath --relative-to=$KERNEL_BUILD_ROOT/net/newip $NEWIP_SOURCE_ROOT/src/common)/*.h ./
|
||||
cd $KERNEL_BUILD_ROOT/include/uapi/linux
|
||||
ln -s -f $(realpath --relative-to=$KERNEL_BUILD_ROOT/include/uapi/linux $NEWIP_SOURCE_ROOT/src/common)/nip_addr.h nip_addr.h
|
||||
|
||||
popd
|
||||
}
|
||||
|
||||
main
|
||||
|
||||
@@ -51,7 +51,7 @@ int ninet_gifconf(struct net_device *dev, char __user *buf, int len, int size)
|
||||
done = -EFAULT;
|
||||
break;
|
||||
}
|
||||
len -= size;
|
||||
len -= size;
|
||||
done += size;
|
||||
}
|
||||
out:
|
||||
|
||||
@@ -787,9 +787,8 @@ static int ninet_addr_get(const struct net_device *dev, struct ninet_ifaddr *ifa
|
||||
struct nip_addr addr;
|
||||
|
||||
err = nip_get_firstaddr(dev, &addr);
|
||||
if (err)
|
||||
return err;
|
||||
ifa->addr = addr;
|
||||
if (!err)
|
||||
ifa->addr = addr;
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -360,7 +360,7 @@ struct dst_entry *nip_sk_dst_lookup_flow(struct sock *sk, struct flow_nip *fln)
|
||||
|
||||
int tcp_nip_queue_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl)
|
||||
{
|
||||
int err = -EFAULT;
|
||||
int err;
|
||||
struct net *net = sock_net(sk);
|
||||
struct nip_addr *saddr, *daddr;
|
||||
struct dst_entry *dst;
|
||||
@@ -389,13 +389,12 @@ int tcp_nip_queue_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl)
|
||||
if (!dst) {
|
||||
nip_dbg("no dst cache for sk, search newip rt");
|
||||
dst = nip_route_output(net, sk, &fln);
|
||||
err = dst->error;
|
||||
if (err)
|
||||
goto out_err_release;
|
||||
if (!dst) {
|
||||
nip_dbg("cannot find dst");
|
||||
goto out;
|
||||
}
|
||||
if (dst->error)
|
||||
goto out_err_release;
|
||||
sk_dst_set(sk, dst);
|
||||
}
|
||||
skb_dst_set_noref(skb, dst);
|
||||
|
||||
Reference in New Issue
Block a user