Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
463191c2
Commit
463191c2
authored
Nov 17, 2002
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[IPSEC]: Make xfrm_user key manager return proper errors.
parent
8a568f5b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
10 deletions
+16
-10
include/linux/netlink.h
include/linux/netlink.h
+2
-2
net/ipv4/xfrm_user.c
net/ipv4/xfrm_user.c
+2
-4
net/netlink/af_netlink.c
net/netlink/af_netlink.c
+12
-4
No files found.
include/linux/netlink.h
View file @
463191c2
...
...
@@ -110,8 +110,8 @@ extern int init_netlink(void);
extern
struct
sock
*
netlink_kernel_create
(
int
unit
,
void
(
*
input
)(
struct
sock
*
sk
,
int
len
));
extern
void
netlink_ack
(
struct
sk_buff
*
in_skb
,
struct
nlmsghdr
*
nlh
,
int
err
);
extern
int
netlink_unicast
(
struct
sock
*
ssk
,
struct
sk_buff
*
skb
,
__u32
pid
,
int
nonblock
);
extern
void
netlink_broadcast
(
struct
sock
*
ssk
,
struct
sk_buff
*
skb
,
__u32
pid
,
__u32
group
,
int
allocation
);
extern
int
netlink_broadcast
(
struct
sock
*
ssk
,
struct
sk_buff
*
skb
,
__u32
pid
,
__u32
group
,
int
allocation
);
extern
void
netlink_set_err
(
struct
sock
*
ssk
,
__u32
pid
,
__u32
group
,
int
code
);
extern
int
netlink_register_notifier
(
struct
notifier_block
*
nb
);
extern
int
netlink_unregister_notifier
(
struct
notifier_block
*
nb
);
...
...
net/ipv4/xfrm_user.c
View file @
463191c2
...
...
@@ -910,9 +910,8 @@ static int xfrm_send_notify(struct xfrm_state *x, int hard)
BUG
();
NETLINK_CB
(
skb
).
dst_groups
=
XFRMGRP_EXPIRE
;
netlink_broadcast
(
xfrm_nl
,
skb
,
0
,
XFRMGRP_EXPIRE
,
GFP_ATOMIC
);
return
0
;
return
netlink_broadcast
(
xfrm_nl
,
skb
,
0
,
XFRMGRP_EXPIRE
,
GFP_ATOMIC
)
;
}
/* XXX Make this xfrm_state.c:xfrm_get_acqseq() */
...
...
@@ -971,9 +970,8 @@ static int xfrm_send_acquire(struct xfrm_state *x, struct xfrm_tmpl *xt,
BUG
();
NETLINK_CB
(
skb
).
dst_groups
=
XFRMGRP_ACQUIRE
;
netlink_broadcast
(
xfrm_nl
,
skb
,
0
,
XFRMGRP_ACQUIRE
,
GFP_ATOMIC
);
return
0
;
return
netlink_broadcast
(
xfrm_nl
,
skb
,
0
,
XFRMGRP_ACQUIRE
,
GFP_ATOMIC
)
;
}
/* User gives us xfrm_user_policy_info followed by an array of 0
...
...
net/netlink/af_netlink.c
View file @
463191c2
...
...
@@ -503,13 +503,13 @@ static __inline__ int netlink_broadcast_deliver(struct sock *sk, struct sk_buff
return
-
1
;
}
void
netlink_broadcast
(
struct
sock
*
ssk
,
struct
sk_buff
*
skb
,
u32
pid
,
u32
group
,
int
allocation
)
int
netlink_broadcast
(
struct
sock
*
ssk
,
struct
sk_buff
*
skb
,
u32
pid
,
u32
group
,
int
allocation
)
{
struct
sock
*
sk
;
struct
sk_buff
*
skb2
=
NULL
;
int
protocol
=
ssk
->
protocol
;
int
failure
=
0
;
int
failure
=
0
,
delivered
=
0
;
/* While we sleep in clone, do not allow to change socket list */
...
...
@@ -544,8 +544,10 @@ void netlink_broadcast(struct sock *ssk, struct sk_buff *skb, u32 pid,
failure
=
1
;
}
else
if
(
netlink_broadcast_deliver
(
sk
,
skb2
))
{
netlink_overrun
(
sk
);
}
else
}
else
{
delivered
=
1
;
skb2
=
NULL
;
}
sock_put
(
sk
);
}
...
...
@@ -554,6 +556,12 @@ void netlink_broadcast(struct sock *ssk, struct sk_buff *skb, u32 pid,
if
(
skb2
)
kfree_skb
(
skb2
);
kfree_skb
(
skb
);
if
(
delivered
)
return
0
;
if
(
failure
)
return
-
ENOBUFS
;
return
-
ESRCH
;
}
void
netlink_set_err
(
struct
sock
*
ssk
,
u32
pid
,
u32
group
,
int
code
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment