History

xfrm: Add a XFRM_STATE_AF_UNSPEC flag to xfrm_usersa_info

Add a XFRM_STATE_AF_UNSPEC flag to handle the AF_UNSPEC behavior for the selector family. Userspace applications can set this flag to leave the selector family of the xfrm_state unspecified. This can be used to to handle inter family tunnels if the selector is not set from userspace.

Steffen Klassert committed 18 years ago

Commit ccf9b3b1 parent 0ce28552 files · +2 −2Browse files

Unified · Split

2 files
  1. include/linux/xfrm.h +1 −0
  2. net/xfrm/xfrm_user.c +1 −2
include/linux/xfrm.h+1−0
@@ -339,6 +339,7 @@ struct xfrm_usersa_info { · 338 unmodified lines
339339 #define XFRM_STATE_NOPMTUDISC 4
340340 #define XFRM_STATE_WILDRECV 8
341341 #define XFRM_STATE_ICMP 16
342+#define XFRM_STATE_AF_UNSPEC 32
342343 };
343344
344345 struct xfrm_usersa_id {
net/xfrm/xfrm_user.c+1−2
@@ -277,9 +277,8 @@ static void copy_from_user_state(struct xfrm_state *x, struct xfrm_usersa_info * · 276 unmodified lines
277277 memcpy(&x->props.saddr, &p->saddr, sizeof(x->props.saddr));
278278 x->props.flags = p->flags;
279279
280− if (!x->sel.family)
280+ if (!x->sel.family && !(p->flags & XFRM_STATE_AF_UNSPEC))
281281 x->sel.family = p->family;
282−
283282 }
284283
285284 /*

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t