xfrm_user.c (492b558b3191319cbc859a9e025bc354d336c261) xfrm_user.c (2a0a6ebee1d68552152ae8d4aeda91d806995dec)
1/* xfrm_user.c: User interface to configure xfrm engine.
2 *
3 * Copyright (C) 2002 David S. Miller (davem@redhat.com)
4 *
5 * Changes:
6 * Mitsuru KANDA @USAGI
7 * Kazunori MIYAZAWA @USAGI
8 * Kunihiro Ishiguro <kunihiro@ipinfusion.com>

--- 994 unchanged lines hidden (view full) ---

1003 skb_pull(skb, rlen);
1004 }
1005
1006 return 0;
1007}
1008
1009static void xfrm_netlink_rcv(struct sock *sk, int len)
1010{
1/* xfrm_user.c: User interface to configure xfrm engine.
2 *
3 * Copyright (C) 2002 David S. Miller (davem@redhat.com)
4 *
5 * Changes:
6 * Mitsuru KANDA @USAGI
7 * Kazunori MIYAZAWA @USAGI
8 * Kunihiro Ishiguro <kunihiro@ipinfusion.com>

--- 994 unchanged lines hidden (view full) ---

1003 skb_pull(skb, rlen);
1004 }
1005
1006 return 0;
1007}
1008
1009static void xfrm_netlink_rcv(struct sock *sk, int len)
1010{
1011 unsigned int qlen = skb_queue_len(&sk->sk_receive_queue);
1012
1011 do {
1012 struct sk_buff *skb;
1013
1014 down(&xfrm_cfg_sem);
1015
1013 do {
1014 struct sk_buff *skb;
1015
1016 down(&xfrm_cfg_sem);
1017
1016 while ((skb = skb_dequeue(&sk->sk_receive_queue)) != NULL) {
1018 if (qlen > skb_queue_len(&sk->sk_receive_queue))
1019 qlen = skb_queue_len(&sk->sk_receive_queue);
1020
1021 while (qlen--) {
1022 skb = skb_dequeue(&sk->sk_receive_queue);
1017 if (xfrm_user_rcv_skb(skb)) {
1023 if (xfrm_user_rcv_skb(skb)) {
1018 if (skb->len)
1024 if (skb->len) {
1019 skb_queue_head(&sk->sk_receive_queue,
1020 skb);
1025 skb_queue_head(&sk->sk_receive_queue,
1026 skb);
1021 else
1027 qlen++;
1028 } else
1022 kfree_skb(skb);
1023 break;
1024 }
1025 kfree_skb(skb);
1026 }
1027
1028 up(&xfrm_cfg_sem);
1029
1029 kfree_skb(skb);
1030 break;
1031 }
1032 kfree_skb(skb);
1033 }
1034
1035 up(&xfrm_cfg_sem);
1036
1030 } while (xfrm_nl && xfrm_nl->sk_receive_queue.qlen);
1037 } while (qlen);
1031}
1032
1033static int build_expire(struct sk_buff *skb, struct xfrm_state *x, int hard)
1034{
1035 struct xfrm_user_expire *ue;
1036 struct nlmsghdr *nlh;
1037 unsigned char *b = skb->tail;
1038

--- 214 unchanged lines hidden ---
1038}
1039
1040static int build_expire(struct sk_buff *skb, struct xfrm_state *x, int hard)
1041{
1042 struct xfrm_user_expire *ue;
1043 struct nlmsghdr *nlh;
1044 unsigned char *b = skb->tail;
1045

--- 214 unchanged lines hidden ---